Icinga Push Notifications
Use Signalgrid as an Icinga mobile app
to deliver real-time monitoring alerts to your iPhone and Android devices.
The Signalgrid Icinga integration forwards monitoring alerts to the Signalgrid push notification API. It maps monitoring states such as OK, WARNING, CRITICAL, and DOWN to the appropriate Signalgrid notification types.
This allows you to receive infrastructure alerts directly on your devices when hosts or services change state.
Prerequisites
- curl must be installed to send API requests
- The script must be executable by the icinga user
Installation
# Save the script to your server
/usr/local/bin/signalgrid-notify.sh
# Make the script executable
chmod +x /usr/local/bin/signalgrid-notify.sh
# Edit the script and insert your credentials
CLIENT_KEY="[your-client-key]"
CHANNEL_TOKEN="[your-channel-token]"
Script Arguments
The script accepts four positional arguments:
$1
Title of the notification
$2
Message body or plugin output
$3
State: OK, UP, WARNING, CRITICAL, or DOWN
$4
Critical flag: true or false
Define the NotificationCommand
Create a notification command in your Icinga configuration:
object NotificationCommand "signalgrid-notify" {
command = [ "/usr/local/bin/signalgrid-notify.sh" ]
arguments = {
0 = {
value = service ?
service.name + " on " + host.name + " is " + service.state :
"Host " + host.name + " is " + host.state
}
1 = {
value = service ? service.output : host.output
}
2 = {
value = service ? service.state : host.state
}
3 = {
value = (service && service.state == "Critical") ||
(!service && host.state == "Down") ?
"true" : "false"
}
}
}
Apply Service Notifications
apply Notification "signalgrid-service" to Service {
command = "signalgrid-notify"
states = [ OK, Warning, Critical, Unknown ]
types = [ Problem, Recovery ]
users = [ "icingaadmin" ]
assign where host.vars.enable_signalgrid == true
}
Apply Host Notifications
apply Notification "signalgrid-host" to Host {
command = "signalgrid-notify"
states = [ Up, Down ]
types = [ Problem, Recovery ]
users = [ "icingaadmin" ]
assign where host.vars.enable_signalgrid == true
}
Enable Signalgrid for a Host
object Host "my-server" {
import "generic-host"
address = "192.168.1.10"
vars.enable_signalgrid = true
}
Manual Testing
You can verify the integration directly from the command line:
/usr/local/bin/signalgrid-notify.sh \
"Test Alert" \
"Manual test from terminal" \
"CRITICAL" \
"false"