Nagios alerting problem


I know that SMS-Client is not supported in nagios. I hope there are more admins here that are using SMS-Cient that may can help me.

I installed the sms_Client acoording the manual.

If i sent an sms in the linux prompt. it goes successfully.

[root@localhost ~]# /bin/sms_client kpn:06xxxxxxxx "Test message"
Dialing SMSC 0653151515...
WARNING: read() Timeout
Connection Established.
kpn Service Time: 37 Seconds
[000] kpn:06xxxxxxxx "Test message"
Total Elapsed Time: 37 Seconds
[root@localhost ~]#  

in the commands.cfg i’f added the flowing rules:

# 'notify-by-pager' command definition
define command{
	command_name notify-by-pager
	command_line /bin/sms_client -q kpn:06xxxxxxxx "  $NOTIFICATIONTYPE$: $HOSTNAME$: $SERVICEDESC$ is $SERVICESTATE$"

# 'host-notify-by-pager' command definition
define command{
	command_name host-notify-by-pager
	command_line /bin/sms_client -q kpn:06xxxxxxxx "VDCnrw $NOTIFICATIONTYPE$: $HOSTNAME$ is $HOSTSTATE$"

and the service is defined like this

define service{
        use                                    generic-service         ; Name of service template to use
        host_name                        "Switch name"
        service_description            CISCO Chassis Environment Check
        is_volatile                          0
        check_period                     24x7
        max_check_attempts          2
        normal_check_interval       2
        retry_check_interval           1
        contact_groups                  admins
        notification_options           w,u,c,r
        notification_interval           960
        notification_period             24x7
        check_command                check_cisco

all should be alright
If i pull the powersupply of the switch

and i check the nagios log i see the following:

Warning: Attempting to execute the command “/usr/bin/sms_client -q kpn:06xxxxxxxx " PROBLEM: “Switch name”: CISCO Chassis Environment Check is CRITICAL”" resulted in a return code of 127. Make sure the script or binary you are trying to execute actually exists…

not good… i correct’et the path to the file and puled the power suply again.

SERVICE NOTIFICATION: nagiosadmin;“Switchname”;CISCO Chassis Environment Check;CRITICAL;notify-by-pager;CRITICAL - Fan Power Supply 2 Fan state critical(3) Supply Power Supply 2, WS-CAC-6000W state critical(3)

But no sms.
no error.
no nothing.
I’m looking for a week now but nothing i can find what could be wrong.

I hope that someone can help me with this.
thx in advanced…

greets Palermo


Have you properly configured contact and contactgroups that are defined in your service definitions? And have you reloaded Nagios configuration after every change?

And check the sms_client log for any error messages.



I think its all ok i’m never sure with this.
i checked it again yesterday and in did a recheck

after the configuration was done in did a check with the famous rule:

/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg 

All seems t be OK. no errors.
And of course after the check i issued a service nagios reset.

unfortunately no joy.


have your hashed out requiretty in your sudoers file? (visudo) If not, that will/might break it.


Hi Strides,
I don’t know exactly wat you mean.
could you please clafify?

i found a file :

What should i do with it


When you run visudo, you are essentially using vi to edit the sudoers file. This file sets permissions on such things as what users can and can’t do using the sudo command to perform a function as root with or without using the root password. In particular, there should be an entry like

you need to hash this out, like

As far as I can make out, some things, and in particular I found this to be the case with my own SMS functionallity, will cause linux to whine and moan about it requiring certain commands to be performed from a ‘tty’ (or a logged in user) or it won’t let whatever it is happen. When it happened to me I found that it was a real bind trying to discern what was going wrong with it as (as you have found) when logged in as the nagios user for example, everything is just peachy, but nagios just wouldn’t work it no way no how - and no error message of any sort was finding it’s way out of the plugin back to me… Lots of debugging and head scratching finally turned out an error message the contents and origin of which I now forget, but the gist of it was that no logged in user, no functionality. A bit more research and I found the requiretty line in the sudoers file switched off this little gem, so I used visudo and fixed it, then everything sprang to life. Now, I’m not saying you will have the same success with it, but I figure it might be worth a shot…

Best of luck



well that did not work t ether. But i was messing around with rights. and that did the trik.
I gave ale the files that sms_client 777 rights changed all the file to nagios owner en now i get paget messages…

thx for your help. It gave me more insight of hou this all works. thx