$ instead of phone number when sending sms

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
pofe
Posts: 1
Joined: Thu Feb 16, 2012 2:10 am

$ instead of phone number when sending sms

Post by pofe »

Hi All,

There is problem with nagios sms sending. We use postgres to store sms in database and gnokii-smsd-pgsql, which is send them out. The problem is that sometimes insert good phone number, sometimes insert only a $ sign in the database outbox table.

My commands which assembles the sms message in the commands.cfg:

define command{
command_name host-notify-by-sms
command_line /usr/bin/printf "%b" "Not Type: $NOTIFICATIONTYPE$\nHost: $HOSTNAME$\nState: $HOSTSTATE$\nInfo: $HOSTOUTPUT$\nIdo: $LONGDATETIME$\n\n" | /usr/local/nagios/libexec/sms2psql $CONTACTPAGER$
}


The sms2psql is own developed. It inserts the phone number and the whole sms message in sms database outbox table.

This is an example from my contact.cfg

define contact {
contact_name XY
alias XXXX YYYY
contactgroups NETadmins
host_notification_period 24x7
service_notification_period 24x7
host_notification_options d,r
service_notification_options w,u,c,r
host_notification_commands notify-host-by-email,host-notify-by-sms
service_notification_commands notify-service-by-email,notify-service-by-sms
email [email protected]
pager +3630XXXXXXX
}

When I try insert manually a sms message with sms2psql it works well. I think there is a problem in nagios and it gives wrong value in the $CONTACTPAGER$ .

Do you have any idea?
Locked