Plugin for Nagios Core that sends SMS notifications via the seven gateway.
- Native Nagios Plugin - Drop-in
seven.pyscript fornotify-host-by-smsandnotify-service-by-smscommands - Custom Sender - Override the displayed sender via
--from - Advanced SMS Options - Flash, TTL, performance tracking, foreign ID, label
- Nagios Core
- Python 2 or 3
- A seven account with API key (How to get your API key)
Copy seven.py into the Nagios plugins directory (typically /usr/local/nagios/libexec).
Edit /usr/local/nagios/etc/objects/contacts.cfg:
define contact {
# ...
pager +491234567890
host_notification_commands notify-host-by-sms
service_notification_commands notify-service-by-sms
}Append to /usr/local/nagios/etc/objects/commands.cfg:
define command {
command_name notify-service-by-sms
command_line python $USER1$/seven.py MY_SEVEN_API_KEY $CONTACTPAGER$ "$NOTIFICATIONTYPE$:$SERVICEDESC$ on $HOSTADDRESS$@$HOSTNAME$, State $SERVICESTATE$, Output: $SERVICEOUTPUT$, Date: $SHORTDATETIME$" --from=Nagios
}
define command {
command_name notify-host-by-sms
command_line python $USER1$/seven.py MY_SEVEN_API_KEY $CONTACTPAGER$ "$NOTIFICATIONTYPE$ on $HOSTADDRESS$@$HOSTNAME$, State: $HOSTSTATE$, Output: $HOSTOUTPUT$, Date: $SHORTDATETIME$" --from=Nagios
}Append to /usr/local/nagios/etc/objects/localhost.cfg:
define service {
use local-service
host_name localhost
service_description SMS
check_command notify-host-by-sms
}seven.py [-h] [--delay DELAY] [--flash] [--foreign_id FOREIGN_ID]
[--from FROM] [--label LABEL] [--performance_tracking]
[--ttl TTL] [--udh UDH]
api_key to text
Need help? Feel free to contact us or open an issue.