At Least One Solution to "notification problem, $CONTACTPAGER$ not passed correctly?"
Stover, Beth
BStover at NorcalMutual.com
Tue Apr 12 20:23:09 CEST 2005
Hi there,
I tried some more testing. First, I simplified the command line: /usr/local/bin/sms_client 1234567890 'this is a test'
It still didn't work.
Next, I logged in as the nagios user and tried to execute the same command, and I got some errors (AHA!):
/var/adm (root) $ su - nagios
$ /usr/local/bin/sms_client 1234567890 'this is a test'
ERROR: Opening logfile: /var/adm/smslog
ERROR: Opening logfile: /var/adm/smslog
My problem is a permissions issue with the /var/adm/smslog. Your smslog file may be located somewhere else. I installed the application as root, so the "nagios" user did not have permissions to write to the sms log file:
-rw-r--r-- 1 root bin 5651 Apr 12 10:25 smslog
Probably not the most secure way to fix it, but I changed the mode so that all users can write to the file:
/var/adm (root) $ chmod 777 smslog
-rwxrwxrwx 1 root bin 5651 Apr 12 10:25 smslog
Next, I restored my command line to include the macros:
# 'notify-by-sms' command definition
define command{
command_name notify-by-sms
command_line /usr/local/bin/sms_client -q $CONTACTPAGER$ '$NOTIFICATIONTYPE$: $HOSTNAME$: $SERVICEDESC$ is $SERVICESTATE$ ($OUTPUT$)'
}
# 'host-notify-by-sms' command definition
define command{
command_name host-notify-by-sms
command_line /usr/local/bin/sms_client -q $CONTACTPAGER$ '$NOTIFICATIONTYPE$: $HOSTNAME$: $SERVICEDESC$ is $SERVICESTATE$ ($OUTPUT$)'
}
Now, I'm getting the properly formatted alerts on my cell phone. :-)
This was working fine for me before, so I don't know how the permissions issue came into being. I have not re-installed sms_client. It's been installed for 2 years. If anyone has any ideas, then please let me know.
Beth
-----Original Message-----
From: Fischer Matthias [mailto:matthias.fischer at gundlach.de]
Sent: Monday, April 11, 2005 10:47 PM
To: Stover, Beth
Subject: AW: [Nagios-users] appendix to "notification problem, $CONTACTPAGER$ not passed correctly?"
Hi Beth
I wasn´t able to solve it yet :(
Though I wonder that noone else came across this problem yet, sms_client seems to be quite a popular tool for doing sms_notfications. If you have any Idea on how to resolve this, I would appreciate to hear from you :) I´ll send an Email to the list as soon as I´ve resolved this problem here.
Regards
Matthias
-----Ursprüngliche Nachricht-----
Von: Stover, Beth [mailto:BStover at NorcalMutual.com]
Gesendet: Dienstag, 12. April 2005 02:08
An: Fischer Matthias
Betreff: FW: [Nagios-users] appendix to "notification problem, $CONTACTPAGER$ not passed correctly?"
Hi there,
I'm having a similar problem with my SMS_Client with the same version of Nagios. Were you able to resolve your problem?
Beth
-----Original Message-----
From: nagios-users-admin at lists.sourceforge.net [mailto:nagios-users-admin at lists.sourceforge.net] On Behalf Of Fischer Matthias
Sent: Wednesday, April 06, 2005 11:36 PM
To: nagios-users at lists.sourceforge.net
Subject: [Nagios-users] appendix to "notification problem, $CONTACTPAGER$ not passed correctly?"
Uhhh .. in the heat of the action I forgot to tell you the version :
It´s Nagios 1.2 from Feb 2002 on a FC 3 sytsem and sms_client 2.0.8y
Sorry!
Cheers
Matthias
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_ide95&alloc_id396&op=ick
_______________________________________________
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
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_ide95&alloc_id396&op=click
_______________________________________________
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