

Send Signalgrid push notifications directly from Nagios monitoring
The Signalgrid Nagios plugin forwards monitoring alerts to the Signalgrid push notification API. It automatically maps Nagios states such as OK, WARNING, and CRITICAL to the appropriate Signalgrid notification types.
This allows you to receive monitoring 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 nagios user
Installation
Save the script to your server:
/usr/local/bin/signalgrid-notify.shMake the script executable:
chmod +x /usr/local/bin/signalgrid-notify.shEdit the script and insert your credentials:
CLIENT_KEY="[your-client-key]"
CHANNEL_TOKEN="[your-channel-token]"Script Arguments
The script accepts four positional arguments:
Argument
Description
$1Title of the notification
$2Message body or plugin output
$3State:
OK, UP, WARNING, CRITICAL, or DOWN$4Critical flag:
true or falseDefine Notification Commands
Add the following commands to your Nagios configuration:
define command {
command_name notify-service-signalgrid
command_line /usr/local/bin/signalgrid-notify.sh "$SERVICEDESC$ on $HOSTNAME$ is $SERVICESTATE$" "$SERVICEOUTPUT$" "$SERVICESTATE$" "false"
}
define command {
command_name notify-host-signalgrid
command_line /usr/local/bin/signalgrid-notify.sh "Host $HOSTNAME$ is $HOSTSTATE$" "$HOSTOUTPUT$" "$HOSTSTATE$" "false"
}Assign the Notification Commands
Attach the commands to a contact definition:
define contact {
contact_name your_user
alias Your User
service_notification_commands notify-service-signalgrid
host_notification_commands notify-host-signalgrid
}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"