CMK version: 2.3.0p28
OS version: Ubuntu Server LTS 24.04
Hello everyone,
I am trying to implement notifications to a Zammad Ticket system in which a ticket is created when a host or service goes down / critical. For that, Zammad offers two pre-made scripts which work fine, but lack the Host’s IP Address for easier identification.
Here’s the service script in my my ~/local/share/check_mk/notifications folder:
#!/bin/bash
# Zammad Service
curl --insecure -X POST \
-F "event_id=$NOTIFY_SERVICEPROBLEMID" \
-F "host=$NOTIFY_HOSTNAME" \
-F "hostip=$NOTIFY_HOSTADDRESS" \
-F "service=$NOTIFY_SERVICEDESC" \
-F "state=$NOTIFY_SERVICESTATE" \
-F "text=$NOTIFY_SERVICEOUTPUT" \
https://[URL]
Example output is the following:
EventID: 431
Host: [Hostname as set up in checkmk]
Service: Check_MK Discovery
State: CRITICAL
Text: [Text]
RemoteIP: [GatewayIP]
UserAgent: curl/8.5.0
What I want is to have the -F “hostip=$NOTIFY_HOSTADDRESS” line to properly show the host’s IP address when creating a new ticket. This would make troubleshooting way easier for me. I’ve tried different variables for this (such as $NOTIFY_HOST_ADDRESS_4) as well but no matter what I do, the Host IP won’t show up in a new ticket. Does anyone know how to implement this?
Many thanks.