email / gnokii not working

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
hatster
Posts: 1
Joined: Thu May 16, 2013 3:11 am

email / gnokii not working

Post by hatster »

Hi,

Ive installed this before many times and never had a problem but this time i just cant get it working, ive re-installed my opensuse about 10 times now and still no joy.

My commands.cfg looks like this:

define command{
command_name notify-service-by-pager
command_line /bin/echo $HOSTALIAS$/$SERVICEDESC$ is $SERVICESTATE$ $SERVICEOUTPUT$ $SHORTDATETIME$ |/usr/bin/gnokii --sendsms xxxxxxxxx
}

i tried changing this command line to: /bin/echo test | >/var/log/test
thinking that this should just generate a text file but it doesnt, if i run it from the command line as root it works fine.

Anyone any ideas ?

thanks.
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: email / gnokii not working

Post by abrist »

hatster wrote:i tried changing this command line to: /bin/echo test | >/var/log/test
You will get a permission denied error for this as the nagios user should most likely not have write access to /var/log.
Have you verified that gnokii is working correctly? Try running the following from the cli as root (replace xxx.. with your phone number):

Code: Select all

echo "Hello" | gnokii --config /etc/gnokiirc --sendsms +xxxxxxxx
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
Locked