# Rocket.Chat notification help

**URL:** <https://community.icinga.com/t/rocket-chat-notification-help/10243>\
**Category:** Visualization, Metrics & Reporting\
**Tags:** notifications, api, director, icinga2\
**Created:** [July 25, 2022, 3:33pm UTC](https://community.icinga.com/t/rocket-chat-notification-help/10243 "2022-07-25T15:33:41Z")\
**Posts on this page:** 15\
**Page:** 2

<div class="post-metadata">

**Author:** ![329854343](https://community.icinga.com/letter_avatar_proxy/v4/letter/3/7993a0/32.png) [@329854343](https://community.icinga.com/u/329854343)\
**Post date:** [July 28, 2022, 12:54pm UTC](https://community.icinga.com/t/rocket-chat-notification-help/10243/21 "2022-07-28T12:54:52Z")

</div>

Could you please give me a hint what colon I need to delete?  
Do I need to delete the “https:” ?

```auto
[2022-07-28 12:30:47 +0000] warning/PluginNotificationTask: Notification command for object 'test' (PID: 1271034, arguments: '/usr/bin/env' 'ROCKETCHAT_WEBHOOK_URL="https://URL/hooks/6xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"' '/etc/icinga2/scripts/notify_rocketchat' '-host.action_url' 'https://URL/hooks/6xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' '-host.display_name' 'test' '-host.name' 'test' '-host.output' 'PING CRITICAL - Packet loss = 100%' '-host.state' 'DOWN' '-icinga.timet' '1659011447') terminated with exit code 2, output: parse "\"https://URL/hooks/6xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\"": first path segment in URL cannot contain colon

```

---

<div class="post-metadata">

**Author:** ![moreamazingnick](https://community.icinga.com/user_avatar/community.icinga.com/moreamazingnick/32/7725_2.png) [@moreamazingnick](https://community.icinga.com/u/moreamazingnick)\
**Post date:** [July 28, 2022, 1:19pm UTC](https://community.icinga.com/t/rocket-chat-notification-help/10243/22 "2022-07-28T13:19:10Z")

</div>

> [@329854343](#):
>
> ## zones.d/s060w44/notification\_apply.conf
> 
> ```auto
> apply Notification "host rocketchat" to Host {
> import "rocketchat-notifiy-template"
> 
> assign where match("*", host.name)
> states = [Down, Up]
> types = [Acknowledgement, Custom, Problem, Recovery]
> users = ["rocket.chat"]
> vars.rocketchat_host_action_url = "https://URL/hooks/6xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
> vars.rocketchat_service_action_url = "https://URL/hooks/6xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
> }
> 
> ```

delete the service url here and try again

```auto
vars.rocketchat_service_action_url = "https://URL/hooks/6xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"

```

---

<div class="post-metadata">

**Author:** ![329854343](https://community.icinga.com/letter_avatar_proxy/v4/letter/3/7993a0/32.png) [@329854343](https://community.icinga.com/u/329854343)\
**Post date:** [July 28, 2022, 2:24pm UTC](https://community.icinga.com/t/rocket-chat-notification-help/10243/23 "2022-07-28T14:24:39Z")

</div>

Hello, I already did - the apply.conf looks like this rn:

```auto
zones.d/s060w44/notification_apply.conf

apply Notification "host rocketchat" to Host {
    import "rocketchat-notifiy-template-host"

    assign where match("*", host.name)
    states = [Down, Up]
    types = [Acknowledgement, Custom, Problem, Recovery]
    users = ["rocket.chat"]
    vars.rocketchat_host_action_url = "https://URL/hooks/6xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
}

```

---

<div class="post-metadata">

**Author:** ![moreamazingnick](https://community.icinga.com/user_avatar/community.icinga.com/moreamazingnick/32/7725_2.png) [@moreamazingnick](https://community.icinga.com/u/moreamazingnick)\
**Post date:** [July 28, 2022, 3:25pm UTC](https://community.icinga.com/t/rocket-chat-notification-help/10243/24 "2022-07-28T15:25:51Z")

</div>

restart icinga2 and post the log of a host notification

---

<div class="post-metadata">

**Author:** ![329854343](https://community.icinga.com/letter_avatar_proxy/v4/letter/3/7993a0/32.png) [@329854343](https://community.icinga.com/u/329854343)\
**Post date:** [July 29, 2022, 7:10am UTC](https://community.icinga.com/t/rocket-chat-notification-help/10243/25 "2022-07-29T07:10:58Z")

</div>

Hello,

```auto
[2022-07-29 07:03:17 +0000] notice/Process: PID 1609543 ('/usr/bin/env' 'ROCKETCHAT_WEBHOOK_URL="https://URL/hooks/6xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"' '/etc/icinga2/scripts/notify_rocketchat' '-host.action_url' 'https://URL/hooks/6xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' '-host.display_name' 'test' '-host.name' 'test' '-host.output' 'PING CRITICAL - Packet loss = 100%' '-host.state' 'DOWN' '-icinga.timet' '1659078197') terminated with exit code 2
[2022-07-29 07:03:17 +0000] warning/PluginNotificationTask: Notification command for object 'test' (PID: 1609543, arguments: '/usr/bin/env' 'ROCKETCHAT_WEBHOOK_URL="https://URL/hooks/6xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"' '/etc/icinga2/scripts/notify_rocketchat' '-host.action_url' 'https://URL/hooks/6xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' '-host.display_name' 'test' '-host.name' 'test' '-host.output' 'PING CRITICAL - Packet loss = 100%' '-host.state' 'DOWN' '-icinga.timet' '1659078197') terminated with exit code 2, output: parse "\"https://URL/hooks/6xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\"": first path segment in URL cannot contain colon

```

```auto
zones.d/director-global/commands.conf
object NotificationCommand "rocketchat host" {
    import "plugin-notification-command"
    command = [
        "/usr/bin/env",
        "ROCKETCHAT_WEBHOOK_URL=\"https://URL/hooks/6xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\"",
        "/etc/icinga2/scripts/notify_rocketchat"
    ]
    arguments += {
        "-host.action_url" = "$rocketchat_host_action_url$"
        "-host.display_name" = "$host.display_name$"
        "-host.name" = "$host.name$"
        "-host.output" = "$host.output$"
        "-host.state" = "$host.state$"
        "-icinga.timet" = "$icinga.timet$"
        "-service.action_url" = "$rocketchat_service_action_url$"
        "-service.display_name" = "$service.display_name$"
        "-service.name" = "$service.name$"
        "-service.output" = "$service.output$"
        "-service.state" = "$service.state$"
    }
    vars.rocketchat_host_action_url = "$host.action_url$"
    vars.rocketchat_service_action_url = "$service.action_url$"
}

```

```auto
zones.d/s060w44/notification_templates.conf
template Notification "rocketchat-notifiy-template-host" {
    command = "rocketchat host"
    states = [Critical, OK]
    types = [Acknowledgement, Problem, Recovery]
    users = ["rocket.chat"]
    vars.rocketchat_host_action_url = "https://URL/hooks/6xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
}

```

```auto
zones.d/s060w44/notification_apply.conf
apply Notification "host rocketchat" to Host {
    import "rocketchat-notifiy-template-host"

    assign where match("*", host.name)
    states = [Down, Up]
    types = [Acknowledgement, Custom, Problem, Recovery]
    users = ["rocket.chat"]
    vars.rocketchat_host_action_url = "https://URL/hooks/6xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
}

```

---

<div class="post-metadata">

**Author:** ![moreamazingnick](https://community.icinga.com/user_avatar/community.icinga.com/moreamazingnick/32/7725_2.png) [@moreamazingnick](https://community.icinga.com/u/moreamazingnick)\
**Post date:** [July 29, 2022, 7:47am UTC](https://community.icinga.com/t/rocket-chat-notification-help/10243/26 "2022-07-29T07:47:49Z")

</div>

remove the  
vars.rocketchat\_host\_action\_url = “[https://URL/hooks/6xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx](https://URL/hooks/6xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx)”  
from  
zones.d/s060w44/notification\_apply.conf  
and  
zones.d/s060w44/notification\_templates.conf

it causes troubles

---

<div class="post-metadata">

**Author:** ![329854343](https://community.icinga.com/letter_avatar_proxy/v4/letter/3/7993a0/32.png) [@329854343](https://community.icinga.com/u/329854343)\
**Post date:** [July 29, 2022, 8:46am UTC](https://community.icinga.com/t/rocket-chat-notification-help/10243/27 "2022-07-29T08:46:16Z")

</div>

Hello, I still get the error:

```auto
[2022-07-29 07:57:18 +0000] warning/PluginNotificationTask: Notification command for object 'test' (PID: 1626783, arguments: '/usr/bin/env' 'ROCKETCHAT_WEBHOOK_URL="https://URL/hooks/6xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"' '/etc/icinga2/scripts/notify_rocketchat' '-host.action_url' 'https://URL/hooks/6xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' '-host.display_name' 'test' '-host.name' 'test' '-host.output' 'PING CRITICAL - Packet loss = 100%' '-host.state' 'DOWN' '-icinga.timet' '1659081438') terminated with exit code 2, output: parse "\"https://URL/hooks/6xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\"": first path segment in URL cannot contain colon

```

```auto
object NotificationCommand "rocketchat host" {
    import "plugin-notification-command"
    command = [
        "/usr/bin/env",
        "ROCKETCHAT_WEBHOOK_URL=\"https://URL/hooks/6xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\"",
        "/etc/icinga2/scripts/notify_rocketchat"
    ]
    arguments += {
        "-host.action_url" = "$rocketchat_host_action_url$"
        "-host.display_name" = "$host.display_name$"
        "-host.name" = "$host.name$"
        "-host.output" = "$host.output$"
        "-host.state" = "$host.state$"
        "-icinga.timet" = "$icinga.timet$"
        "-service.action_url" = "$rocketchat_service_action_url$"
        "-service.display_name" = "$service.display_name$"
        "-service.name" = "$service.name$"
        "-service.output" = "$service.output$"
        "-service.state" = "$service.state$"
    }
    vars.rocketchat_host_action_url = "$host.action_url$"
    vars.rocketchat_service_action_url = "$service.action_url$"
}

```

```auto
zones.d/s060w44/notification_templates.conf
template Notification "rocketchat-notifiy-template-host" {
    command = "rocketchat host"
    states = [Critical, OK]
    types = [Acknowledgement, Problem, Recovery]
    users = ["rocket.chat"]
    vars.rocketchat_host_action_url = "https://URL/hooks/6xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
}

```

```auto
zones.d/s060w44/notification_apply.conf
apply Notification "host rocketchat" to Host {
    import "rocketchat-notifiy-template-host"

    assign where match("*", host.name)
    states = [Down, Up]
    types = [Acknowledgement, Custom, Problem, Recovery]
    users = ["rocket.chat"]
    vars.rocketchat_host_action_url = "https://URL/hooks/6xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
}

```

 ![image](https://community.icinga.com/uploads/default/original/2X/7/7e9b0f5ecb574542a8bf4d23b7b8aeb18b566022.png)

 ![image](https://community.icinga.com/uploads/default/original/2X/0/0eab4a61574c68cd6cbed9a44fa3b12797a6ec05.png)

---

<div class="post-metadata">

**Author:** ![moreamazingnick](https://community.icinga.com/user_avatar/community.icinga.com/moreamazingnick/32/7725_2.png) [@moreamazingnick](https://community.icinga.com/u/moreamazingnick)\
**Post date:** [July 29, 2022, 9:59am UTC](https://community.icinga.com/t/rocket-chat-notification-help/10243/28 "2022-07-29T09:59:00Z")

</div>

remove the!!!

vars.rocketchat\_host\_action\_url = “[https://URL/hooks/6xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx](https://url/hooks/6xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx)”  
!!!

restart icinga2 and post the log of a host notification

---

<div class="post-metadata">

**Author:** ![329854343](https://community.icinga.com/letter_avatar_proxy/v4/letter/3/7993a0/32.png) [@329854343](https://community.icinga.com/u/329854343)\
**Post date:** [July 29, 2022, 10:38am UTC](https://community.icinga.com/t/rocket-chat-notification-help/10243/29 "2022-07-29T10:38:25Z")

</div>

After recreating the command I can finally remove it:

```auto
zones.d/director-global/commands.conf
object NotificationCommand "rocketchat host" {
    import "plugin-notification-command"
    command = [
        "/usr/bin/env",
        "ROCKETCHAT_WEBHOOK_URL=\"https://URL/hooks/6xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\"",
        "/etc/icinga2/scripts/notify_rocketchat"
    ]
    arguments += {
        "-host.action_url" = "$rocketchat_host_action_url$"
        "-host.display_name" = "$host.display_name$"
        "-host.name" = {
            skip_key = true
            value = "$host.name$"
        }
        "-host.output" = "$host.output$"
        "-host.state" = "$host.state$"
        "-icinga.timet" = "$icinga.timet$"
        "-service.action_url" = "$rocketchat_service_action_url$"
        "-service.display_name" = "$service.display_name$"
        "-service.name" = "$service.name$"
        "-service.output" = "$service.output$"
        "-service.state" = "$service.state$"
    }
}

```

```auto
[2022-07-29 10:31:24 +0000] warning/PluginNotificationTask: Notification command for object 'test' (PID: 1674417, arguments: '/usr/bin/env' 'ROCKETCHAT_WEBHOOK_URL="https://URL/hooks/6xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"' '/etc/icinga2/scripts/notify_rocketchat' '-host.action_url' 'https://URL/hooks/6xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' '-host.display_name' 'test' 'test' '-host.output' 'PING CRITICAL - Packet loss = 100%' '-host.state' 'DOWN' '-icinga.timet' '1659090684') terminated with exit code 2, output: -host.* is given, missing some of: -host.name, -host.state

```

---

<div class="post-metadata">

**Author:** ![moreamazingnick](https://community.icinga.com/user_avatar/community.icinga.com/moreamazingnick/32/7725_2.png) [@moreamazingnick](https://community.icinga.com/u/moreamazingnick)\
**Post date:** [July 29, 2022, 10:45am UTC](https://community.icinga.com/t/rocket-chat-notification-help/10243/30 "2022-07-29T10:45:58Z")

</div>

no you didn’t or you didnt restart because it hostaction url is still in your log:  
-host.action\_url’ '[https://UR](https://UR)…

---

<div class="post-metadata">

**Author:** ![329854343](https://community.icinga.com/letter_avatar_proxy/v4/letter/3/7993a0/32.png) [@329854343](https://community.icinga.com/u/329854343)\
**Post date:** [August 1, 2022, 11:14am UTC](https://community.icinga.com/t/rocket-chat-notification-help/10243/31 "2022-08-01T11:14:39Z")

</div>

Hello, I’ve removed the the argument `-host.action_url` in the director.

But I still get the same error.

```auto
[2022-08-01 11:10:04 +0000] warning/PluginNotificationTask: Notification command for object 'test' (PID: 2997474, arguments: '/usr/bin/env' 'ROCKETCHAT_WEBHOOK_URL="https://URL/hooks/6xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"' '/etc/icinga2/scripts/notify_rocketchat' '-host.display_name' 'test' 'test' '-host.output' 'PING CRITICAL - Packet loss = 100%' '-host.state' 'DOWN' '-icinga.timet' '1659352204') terminated with exit code 2, output: -host.* is given, missing some of: -host.name, -host.state

```

---

<div class="post-metadata">

**Author:** ![moreamazingnick](https://community.icinga.com/user_avatar/community.icinga.com/moreamazingnick/32/7725_2.png) [@moreamazingnick](https://community.icinga.com/u/moreamazingnick)\
**Post date:** [August 1, 2022, 1:07pm UTC](https://community.icinga.com/t/rocket-chat-notification-help/10243/32 "2022-08-01T13:07:16Z")

</div>

your host.name argument in icinga director seems to have the setting skip key = true.  
please fix that

3rd image this post [Rocket.Chat notification help - #3 by 329854343](https://community.icinga.com/t/rocket-chat-notification-help/10243/3)

---

<div class="post-metadata">

**Author:** ![329854343](https://community.icinga.com/letter_avatar_proxy/v4/letter/3/7993a0/32.png) [@329854343](https://community.icinga.com/u/329854343)\
**Post date:** [August 1, 2022, 2:39pm UTC](https://community.icinga.com/t/rocket-chat-notification-help/10243/33 "2022-08-01T14:39:47Z")

</div>

Hey, sorry for stealing your time, but now I get the old error I used to get befor:

```auto
[2022-08-01 13:16:32 +0000] warning/PluginNotificationTask: Notification command for object 'test' (PID: 3036259, arguments: '/usr/bin/env' 'ROCKETCHAT_WEBHOOK_URL="https://URL/hooks/6xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"' '/etc/icinga2/scripts/notify_rocketchat' '-host.display_name' 'test' '-host.name' 'test' '-host.output' 'PING CRITICAL - Packet loss = 100%' '-host.state' 'DOWN' '-icinga.timet' '1659359792') terminated with exit code 2, output: parse "\"https://URL/hooks/6xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\"": first path segment in URL cannot contain colon

```

---

<div class="post-metadata">

**Author:** ![moreamazingnick](https://community.icinga.com/user_avatar/community.icinga.com/moreamazingnick/32/7725_2.png) [@moreamazingnick](https://community.icinga.com/u/moreamazingnick)\
**Post date:** [August 1, 2022, 2:58pm UTC](https://community.icinga.com/t/rocket-chat-notification-help/10243/34 "2022-08-01T14:58:31Z")

</div>

i think there is something wrong with your url  
or maybe the quotes are not needed:

use that as command:  
/usr/bin/env ROCKETCHAT\_WEBHOOK\_URL=[https://test/hook](https://test/hook) /etc/icinga2/scripts/notify\_rocketchat

deploy in director

---

<div class="post-metadata">

**Author:** ![329854343](https://community.icinga.com/letter_avatar_proxy/v4/letter/3/7993a0/32.png) [@329854343](https://community.icinga.com/u/329854343)\
**Post date:** [August 1, 2022, 3:32pm UTC](https://community.icinga.com/t/rocket-chat-notification-help/10243/35 "2022-08-01T15:32:27Z")

</div>

You are the god of Icinga2!!! It works! 😃

Your advice would be a great addition to the instructions of the plugin!

Thank you for helping me out so much!

[Previous page](https://community.icinga.com/t/rocket-chat-notification-help/10243.md?page=1)
