Page 1 of 1

Cant get Nagios to SMS me through gnokii. Lost all my hair!

Posted: Tue Nov 08, 2011 12:31 pm
by FTL
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 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 terminal command line 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
}


My gnokii cfg is attached and its called gnokiirc in /etc
I also have copies of the file in the following location or it would moan when i tried to send mail via command line with the nagios user but they are called config and not gnokiirc
/nagios/.config/gnokii/config

what can be going on

Please help me, im going insane

Thanks