Saturday, May 24. 2008Nagios 2-way alerting via SMS - Part 3Comments
Display comments as
(Linear | Threaded)
Thanks for this, just what I was looking for! Now to figure out how to hack the script so one can respond via email as well for us blackberry users.
2-Way alerting is not working for me. I've followed the whole tutorial and managed to get 1-Way alerting working but not the 2-Way alerting. It seems like the readsms.pl script is not doing much for me. I'm running Ubuntu 7.10 Linux server.
When I acknowledge a fault by way of SMS reply, the reply can be seen in the smsd database's "Inbox" table but the readsms.pl is not updating Nagios by inserting a comment and subsequently sending an acknowledgement sms (via Outbox table) to other contacts who are supposed to get sms alerts. I have a crontab to run the readsms.pl script every minute: # m h dom mon dow command * * * * * perl /usr/local/nagios/readsms.pl When I run the readsms.pl script manually, this is what I get: perl /usr/local/nagios/readsms.pl Lockfile: /var/tmp/smsread.lck exists. Exiting. Anyone who has an idea what I may be doing wrong? Thanks in advance, Lasin
I finally got the whole 2-Way SMS Alerting working some days later after I sent my previous post. Thank you to Matt Bottrell for the excellent tutorial!!!
My next objective is to try and get SMS alerts sent to an SMSC via SMPP instead of going to the GSM phone or GSM Modem Terminal. Is there a Linux app and tutorial that I can use to achieve this??? I'm trying out Kannel at the moment but there isn't much of a tutorial out there on the Net. Anyone reading this post that has done SMPP for Nagios SMS alerts please respond. Thanks, Lasin
I finally got Kannel to connect to SMSC using SMPP. Now all I need to do is modify the scripts as per the tutorials to send Nagios alerts via this SMPP connection.
Anyone with an idea of how I can modify the scripts to do this? I have an idea but am not 100% sure. Thanks in advance!!!
This is great! I've done this also to our Nagios Staging (Test Environment). However, this is very impractical if you have a 24/7 NOC watching all servers and applications alerts. Also, SMS Alerts to Email would be better since you will not be spending lots of cellphone loads or credits. Imagine if you have over a thousand services and let's say each day you are acknowledging tons of alerts. Phewww! Real Expensive right. Unlessm if your company are giving cellphone load allowances. Cheers!
For me, I have free SMS to our other phones, so it's not expensive.
You wouldn't need to use a SMS => Email gateway, as Nagios provides access to an Email alert. Be aware that the use of SMS alerts is primarily a notification and when required an acknowledgement service. Ideally during the day or when in front of the computer you would use Nagios's web-based front end and acknowledge alerts that way. As you mentioned, for a NOC it's probably not ideal. However for smaller setups or even application owners within the Nagios setup (who basically have only a select number of servers/services0 this works extremely well.
It is great!i have a couple of question, I just want Nagios to send SMS to mobile (I am not worry about cost etc we have sms gateway).
Am i connecting mobile to nagios server and let server find the device ? can you elaborate this more as I am a new in this world. coolbro
Hi all,
I think I'll write up a follow up posting that covers many of these questions, and expands a bit further on it. I should get to it in the next week (sorry hectic at the moment, just moved into a new house 4 weeks ago... so it's a little crazy around here).
Hi Matt,
Thanks for the update! Look forward to your follow-up posting. Happy settling into your new house. Rgds, Lasin
Hi LASIN,
Could you show us how you configured your commands.cfg file so as to send SMS via kannel? thanks
Hi,
I'm in the same problem than Phil, my 2-way SMS is not working, I always get the same message "Lockfile: /var/tmp/smsread.lck exists. Exiting" when I launch the readsms.pl script. How did you resolve it? anyone can help me? Thanks in advance, Victor
Hi Victor,
That will occur if you have killed the readsms.pl script unexpectedly. Confirm it's not running... then just delete the /var/tmp/smsread.lck file. It will then work again.
Hi Matt,
but I had already try that. If I delete the /var/tmp/smsread.lck file and launch the script then I get an error saying that the file at line 43 doesn't exist but does generate the file, and the next try it syas again that the file Exists. I'm in a loop, always with error.
Are you running under the Nagios user's crontab?
This is where readsms.pl needs to be executed.
Wow, this really was the easiest part to set up!
Now I have a fully working sms-notifying-sms-replying-problem-acknowledging solution. Thank you very much for these very useful tutorials and scripts. When I come to Australia (I want to see the Great Barrier Reef) I'll check you up and buy you a drink Best of luck, Alex.
Hi Matt,
Thanks for this great howto. Receiving SMS's as never before Only replying to them doesn't work (yet). If i reply to one SMS. It is coming into Nagios but then nothing happens. This is from the Nagios log when inserted via SMS: [1274438230] EXTERNAL COMMAND: ACKNOWLEDGE_SVC_PROBLEM;MCFISA66 ;Check When Mitmanuals SSL Expires ;1;1;1;Wijnand Boon SMS; As you can see, it has carriage returns in it. If i do the same via the Nagios interface then this will be logged: [1274431310] EXTERNAL COMMAND: ACKNOWLEDGE_SVC_PROBLEM;MCFISA66;Check When Mitmanuals SSL Expires;2;1;0;nagiosadmin;WAB But without carriage returns.
I noticed that some commands might cause a problem to people trying to acknowledge problems via sms. This issue is caused by the fact that Nagios has two ways to refer to hosts i.e there is $NAGIOS_HOSTNAME and $NAGIOS_HOSTALIAS. In the script sendsms.sh the $NAGIOS_HOSTALIAS variable is used instead of NAGIOS_HOSTNAME. If the hostname and alias are different in your host configuration, the acknowledgment SMS will fail and Nagios won't update the host with the notification. So, it's either the HOSTNAME and HOSTALIAS be the same or; In my case I changed the sendsms.sh script so that the command refers to NAGIOS_HOSTNAME instead of NAGIOS_HOSTALIAS.
I hope this is of help to someone.
Try taking in the to next level and have the alert resolved automatically! This is a new and upcoming company that provides closed loop integration with Monitoring systems allowing for automated resolution to problems and alerts. It's free, give it a try.
URL: http://www.simplysemantics.com/support/connectors/nagios Registration code: WI88ZQTV4B
Great detailed explanation of how to use a GSM modem to send SMS notifications for Nagios alerts.
A different (non-hardware) option is to use web based services for folks that do not want to deal with installing and maintaining a modem. Of course, both approaches have pros and cons. We've recently implemented support for sending Nagios alerts to iPhone/iPad and Android devices using push notifications (in addition to notifications via email and SMS). OpsGenie (http://www.opsgenie.com) is offered as a FREE service up to 2 users. How to configure Nagios to send alerts via OpsGenie is described here http://support.opsgenie.com/customer/portal/articles/780193-nagios-integration Regards, |
QuicksearchCalendar
My PhotosWhat I've been listening toUndecided by Silverchair on Tue 6 Mar 2012, 11:10:37 AM Young Man, Old Man by The Dissociatives on Tue 6 Mar 2012, 11:06:33 AM black fingernails red wine by Eskimo Joe on Tue 6 Mar 2012, 11:02:27 AM Chasing Cars by Snow Patrol on Tue 6 Mar 2012, 10:57:59 AM Sour Sour Times by Portishead on Tue 6 Mar 2012, 10:54:04 AM She Wants To Move (Album Version) by N*E*R*D on Tue 6 Mar 2012, 10:50:31 AM Last Chance by Jet on Tue 6 Mar 2012, 10:48:39 AM Sick and Tired by Anastacia on Tue 6 Mar 2012, 10:45:07 AM Somethings Gotta Give by The John Butler Trio on Tue 6 Mar 2012, 10:42:02 AM Slip Into Something More Comfortable (Instrumental Version) by Kinobe on Tue 6 Mar 2012, 10:37:20 AM Fri 24 May 2013, 08:47:13 AM
Recently BookmarkedBlog StatsLast entry: 2011-01-10 18:19
279 entries written
521 comments have been made
Blog Tags accounting advertising alerting apps asterisk australia birthday building coding cricket email entertainment failure family firefox football friends gnome google government hardware health holiday house humour Internet ISP java life linksys Linux marriage microsoft mistake monitoring movies mozilla nagios networking news office openoffice open source opinion oss pets phone photo play politics power relax respect review security shopping sms snom snoring society software spam sport support sysadmin technology telephony tennis terrorism tv twitter ups virtualbox virtualization voip web weekend wildlife windows wine wireless workLicense |
|||||||||||||||||||||||||||||||||||||||||||||||||
This is a 3 part posting that covers how you can setup 2-way Nagios alerting via SMS. The series is broken down as such: Part 1: Background and Requirements (this article)Part 2: Sending SMS messages from NagiosPart 3: Acknowledging SMS messages For
Tracked: May 24, 03:05
This is a 3 part posting that covers how you can setup 2-way Nagios alerting via SMS. The series is broken down as such: Part 1: Background and RequirementsPart 2: Sending SMS messages from Nagios (this article)Part 3: Acknowledging SMS messages Sen
Tracked: May 24, 03:06