# How to get Ip Address and Hostname in Grafana Slack Alerts

**URL:** <https://community.grafana.com/t/how-to-get-ip-address-and-hostname-in-grafana-slack-alerts/49106>\
**Category:** Alerting\
**Tags:** alerting\
**Created:** [June 17, 2021, 11:50pm UTC](https://community.grafana.com/t/how-to-get-ip-address-and-hostname-in-grafana-slack-alerts/49106 "2021-06-17T23:50:31Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![syedusamasubzwari](https://avatars.discourse-cdn.com/v4/letter/s/eb9ed0/32.png) [@syedusamasubzwari](https://community.grafana.com/u/syedusamasubzwari)\
**Post date:** [June 17, 2021, 11:50pm UTC](https://community.grafana.com/t/how-to-get-ip-address-and-hostname-in-grafana-slack-alerts/49106/1 "2021-06-17T23:50:31Z")

</div>

HI guys i am new to grafana monitoring system. What i am trying to do is to get the ip address and hostname of the specific host when alert triggers.

I am using grafana 8.0.2 with Influxdb and telegraf. And for notification is Slack.

I getting notifications but with the message what wrote in alert section.

Please help me out.

Many Thanks.

![image](https://us1.discourse-cdn.com/grafana/original/3X/b/e/be208ef2da98c0c24095736644752d34f93572cd.png)  
 ![image](https://us1.discourse-cdn.com/grafana/original/3X/b/e/be208ef2da98c0c24095736644752d34f93572cd.png)

---

<div class="post-metadata">

**Author:** ![anon70503803](https://avatars.discourse-cdn.com/v4/letter/a/8797f3/32.png) [@anon70503803](https://community.grafana.com/u/anon70503803)\
**Post date:** [July 14, 2021, 8:41pm UTC](https://community.grafana.com/t/how-to-get-ip-address-and-hostname-in-grafana-slack-alerts/49106/2 "2021-07-14T20:41:42Z")

</div>

Hi @syedusamasubzwari

I think you have a syntax issue in your message. Templated labels should go inside `{{ handlebars }}`:

> **[Create Grafana managed alert rule](https://grafana.com/docs/grafana/latest/alerting/unified-alerting/alerting-rules/create-grafana-managed-rule/#details)**
>
> Create Grafana managed alert rule

---

<div class="post-metadata">

**Author:** ![belanchuk](https://sea2.discourse-cdn.com/grafana/user_avatar/community.grafana.com/belanchuk/32/17668_2.png) [@belanchuk](https://community.grafana.com/u/belanchuk)\
**Post date:** [July 16, 2021, 2:50pm UTC](https://community.grafana.com/t/how-to-get-ip-address-and-hostname-in-grafana-slack-alerts/49106/3 "2021-07-16T14:50:13Z")

</div>

I set up the alert template like this:  
 ![screenshot-localhost_3000-2021.07.16-19_37_37](https://us1.discourse-cdn.com/grafana/original/3X/1/f/1fe8fc5dcc8bccbd26f6d41a7eff23519ece7bb1.png)

But I get it in telegram like this:  
 ![Снимок экрана от 2021-07-16 19-39-24](https://us1.discourse-cdn.com/grafana/original/3X/e/6/e6a7ce4a12859f39a56fae1b2498a45a91af3208.png)

templates do not work.  
what am I doing wrong?

Grafana v8.0.6 (68fe9e3431)

In defaults.ini:  
[feature\_toggles]  
enable = ngalert

---

<div class="post-metadata">

**Author:** ![anon20954878](https://avatars.discourse-cdn.com/v4/letter/a/fbc32d/32.png) [@anon20954878](https://community.grafana.com/u/anon20954878)\
**Post date:** [July 16, 2021, 5:21pm UTC](https://community.grafana.com/t/how-to-get-ip-address-and-hostname-in-grafana-slack-alerts/49106/4 "2021-07-16T17:21:30Z")

</div>

@belanchuk are you using the Classic Condition in Grafana 8 alerts? If so you won’t have the labels available to you. You’ll need to create a multi-dimensional rule

---

<div class="post-metadata">

**Author:** ![belanchuk](https://sea2.discourse-cdn.com/grafana/user_avatar/community.grafana.com/belanchuk/32/17668_2.png) [@belanchuk](https://community.grafana.com/u/belanchuk)\
**Post date:** [July 16, 2021, 5:40pm UTC](https://community.grafana.com/t/how-to-get-ip-address-and-hostname-in-grafana-slack-alerts/49106/5 "2021-07-16T17:40:19Z")

</div>

Clear, i will try, thanks!

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/grafana/original/2X/e/ef5308cc58c9e5a13187b5012eb99f406928462f.png) [@system](https://community.grafana.com/u/system)\
**Post date:** [June 17, 2022, 11:50pm UTC](https://community.grafana.com/t/how-to-get-ip-address-and-hostname-in-grafana-slack-alerts/49106/6 "2022-06-17T23:50:51Z")

</div>

Closed on June 17, 2022, 11:50pm UTC

This topic was automatically closed after 365 days. New replies are no longer allowed.
