Nagios Core and SMS alerts (or lack of) through Nagios

David Ribeiro david.ribeiro at altitudeinfra.fr
Fri Nov 11 12:28:09 CET 2011


Hi Andrew, 

# 'notify-host-by-sms' command definition 
define command{ 
command_name notify-host-by-sms 
command_line /usr/bin/printf "%.120s" "***** Nagios ***** $NOTIFICATIONTYPE$: Host $HOSTALIAS$ is $HOSTSTATE$ " | /usr/bin/gnokii --sendsms $CONTACTPAGER$ 
} 

# 'notify-service-by-sms' command definition 
define command{ 
command_name notify-service-by-sms 
command_line /usr/bin/printf "%.120" "***** Nagios ***** $HOSTALIAS$/$SERVICEDESC$ is $SERVICESTATE$ " | /usr/bin/gnokii --sendsms $CONTACTPAGER$ 
} 

Maybe the last " ? 














David Ribeiro 

De: "Andrew Thompson" <andrew at fulgent.co.uk> 
À: nagios-users at lists.sourceforge.net 
Envoyé: Vendredi 11 Novembre 2011 10:30:23 
Objet: [Nagios-users] Nagios Core and SMS alerts (or lack of) through Nagios 




Hi all, 

Im at my wits end. 
Spent 2 days now trying to get Nagios to SMS me through gnokii but a lunar eclipse is a more frequent event! 

So i have Ubuntu 11.04 installed using postfix to email me alerts (works flawlessly) 

Now i also want a text message as a failover incase my Exchange server or internet line goes down. 

I have installed and configured gnokii to what i think is at a functioning level. 
I have a Nokia 6301 mobile hooked up to Ubuntu via USB cable. 

I can send a text message out through the phone via the CLI no issue at all with both my admin user logged in and also when i log in as the nagios user so i know i have the correct permissions on the ttyACM0 port that is assigned to the 6301. 

Will Nagios send an SMS - will it f*£$!! 

Here is my command.cfg relevant part 

# 'notify-host-by-sms' command definition 
define command{ 
command_name notify-host-by-sms 
command_line /usr/bin/printf "%.120s" "***** Nagios ***** $NOTIFICATIONTYPE$: Host $HOSTALIAS$ is $HOSTSTATE$ | /usr/bin/gnokii --sendsms $CONTACTPAGER$ 
} 

# 'notify-service-by-sms' command definition 
define command{ 
command_name notify-service-by-sms 
command_line /usr/bin/printf "%.120" "***** Nagios ***** $HOSTALIAS$/$SERVICEDESC$ is $SERVICESTATE$ | /usr/bin/gnokii --sendsms $CONTACTPAGER$ 
} 


Here is my contact.cfg 

define contact{ 
contact_name MYNAME 
use generic-contact 
alias MYNAME 
host_notification_options d,u,r,f 
service_notification_options w,u,c,r,f 
email MYEMAIL 
pager +44XXXXXXXXX 
host_notification_period 24x7 
service_notification_period 24x7 
host_notification_commands notify-host-by-email,notify-host-by-sms 
service_notification_commands notify-service-by-email,notify-service-by-sms 

Here is my templates.cfg 

define contact{ 
name generic-contact 
service_notification_period 24x7 
host_notification_period 24x7 
service_notification_options w,u,c,r,f,s 
host_notification_options d,u,r,f,s 
service_notification_commands notify-service-by-email, notify-service-by-sms 
host_notification_commands notify-host-by-email, notify-host-by-sms 
register 0 
} 

what can be going on – why will nagios not SMS me? Its got to be a nagios config issue and not gnokii error as I can send text through CLI fine, 

Please help me, im going insane 

Thanks 



Kind Regards 

Andrew 



T: 01386 834000 
F: 01386 834100 



Andrew at fulgent.co.uk 
www.fulgent.co.uk 




Fulgent Technologies Limited, Haddonsacre, Station Road, Offenham, Evesham, WR11 8JJ. This communication contains information which is confidential and may also be privileged or protected by copyright. It is for the exclusive use of the addressee. If you are not the addressee please note that any distribution, reproduction, copying, publication or use of this communication or the information is prohibited. If you have received this communication in error, please telephone us immediately and also delete the communication from your computer. 




------------------------------------------------------------------------------ 
RSA(R) Conference 2012 
Save $700 by Nov 18 
Register now 
http://p.sf.net/sfu/rsa-sfdev2dev1 
_______________________________________________ 
Nagios-users mailing list 
Nagios-users at lists.sourceforge.net 
https://lists.sourceforge.net/lists/listinfo/nagios-users 
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue. 
::: Messages without supporting info will risk being sent to /dev/null


Ce message et toutes les pieces jointes (ci-apres le "message" ) sont confidentiels et etablis a l'intention exclusive de ses destinataires. Toute utilisation de ce message non conforme a sa destination, toute diffusion ou toute publication, totale ou partielle, est interdite, sauf autorisation expresse. Si vous recevez ce message par erreur, merci de le detruire sans en conserver de copie et d'en avertir immediatement l'expediteur. Internet ne permettant pas de garantir l'integrite de ce message, AltitudeInfrastructure decline toute responsabilite au titre de ce message s'il a ete modifie, altere, deforme ou falsifie.                                                                                       
                                                                                                                                                                                    
This message and any attachments (the "message") are confidential and intended solely for the addressees. Any use not in accord with its purpose, any dissemination or disclosure, either whole or partial, is prohibited except formal approval. If you receive this message in error, please delete it without storing any evidence and immediately notify the sender. Internet can not guarantee the integrity of this message, neither AltitudeInfrastructure shall be liable for the message if modified, altered, changed or falsified.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.monitoring-lists.org/archive/users/attachments/20111111/125aae5e/attachment.html>
-------------- next part --------------
------------------------------------------------------------------------------
RSA(R) Conference 2012
Save $700 by Nov 18
Register now
http://p.sf.net/sfu/rsa-sfdev2dev1
-------------- next part --------------
_______________________________________________
Nagios-users mailing list
Nagios-users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue. 
::: Messages without supporting info will risk being sent to /dev/null


More information about the Users mailing list