Nagios - Twitter alerts

This entry will cover how to send nagios alerts to twitter, in the examples to follow using curl. Firstly edit commands.cfg And add the two following line: define command { command_name notify-by-twitter command_line /usr/bin/curl --basic --user "twitteruser:twitterpassword" --data-ascii "status=[Nagios] $NOTIFICATIONTYPE$ $HOSTALIAS$/$SERVICEDESC$ is $SERVICESTATE$" http://twitter.com/statuses/update.json } define command { command_name host-notify-by-twitter command_line /usr/bin/curl --basic --user "twitteruser:twitterpassword" --data-ascii "status=[Nagios] $HOSTSTATE$ alert for $HOSTNAME$" http://twitter.com/statuses/update.json } Now define a contact for this twitter service into: contacts.cfg ...

27 February 2010 @ 13:22 · Updated: 30 June 2026 @ 03:28 · leo