Nagios, do you pay for sms service?
April 22, 2008
I don’t think nagios need any introduction. Neither does the fact that it can send out email and sms alert.
But what about getting alerts on your phone ? And at free of cost?
A few weeks back, I found this gateway. Surely, there are many other such gateways, but I did not have time to search for them. Rather, I decided to go on with my experiment on the network I manage at WBUT.
This gateway supports email2sms. But it requires you to register and upload your phone number and mail id ( from which you are sending these alert mails) to be added to your portal profile. So I registered an account with them with my mobile number 9999999999 and email nagios@orca.wbut.ac.in.
The gateway also requires that the mail, which will be converted to sms, have your mobile number as a subject.
So to accomplish that, without any loss of functionality of the alerts, I had to change the command.cfg file a bit.
All I did was to change the mail function to
‘notify-host-by-email’ command definition
define command{
command_name notify-host-by-email
command_line /usr/bin/printf “Nagios Host: $HOSTNAME$ $HOSTSTATE$ Time: $LONGDATETIME$\n” | /bin/mail -s “9999999999″ $CONTACTEMAIL$
}
Where 9999999999 would be your mobile number and nagios@your_server would be email registered with the portal.
Thats all. Just shut down one of your hosts and wait. You received a sms. Didn’t you?
Of course, this is implemented for monitoring the servers at WBUT. Whenever a server is down or unreachable for more that 15 mins, we get a sms !!! ![]()
Leave a Reply