calls from nagios

i’ve been using nagios to monitor my infrastructure for long time.
in most cases it’s sending just e-mails. at ecowin/reuters i also had it connected with sms gateway. Siements TC35 connected via serial cable to linux box served us very well. i used debian’s scmxx to send messages.

i’ve been thinking recently about using SIP as another method for sending notifications about some events [ assuming that out-of-band SMS notifications will still be used in case of network blackout ]. pjsua seems to be nice command-line application that can be easily used in scripts to call given sip account / number and play back provided wav file. sample syntax:

./pjsua-x86_64-unknown-linux-gnu --duration=10 --auto-answer 200 --auto-play \
--id sip:6555@sip_provider.com --contact sip:6555@10.1x.10.xxx --registrar sip:proxy.sip_provider.com --realm sip_provider.com --username 6555 --password 6555 --local-port 5060 --null-audio --play-file file_to_be_played.wav sip:number_to_call@sip_provider.com

project seems to have quite rich python API – so it’s probably possible to customize it in more suble way than using ugly hacks in bash.

getting wav file out of nagios should be fairly easy with festival.

echo "something, something" | text2wave > a.wav

Leave a Reply

Your email address will not be published. Required fields are marked *

(Spamcheck Enabled)