Hi all,

 

I have decided that I would write my own bash script to send notification via sms and incorporate it into an existing Nagios script. When I run the script from the command prompt as the nagios user it works like a dream and I get my sms. As soon as I activate it in Nagios I get the following error in the nagios.log file

 

[1143218696] SERVICE NOTIFICATION: george;test-server;Current Users;WARNING;notify-by-sms;USERS WARNING - 1 users currently logged in

[1143218696] Warning: Attempting to execute the command "/usr/bin/printf "***** Nagios  *****\n\nNotification Type: PROBLEM\n\nService: Current Users\nHost: test-server\nIP: 10.0.0.200\nState: WARNING\nDate/Time: Fri Mar 24 18:44:56 SAST 2006\n\nAdditional Info:\n\nUSERS WARNING - 1 users currently logged in" | pipesend" resulted in a return code of 127.  Make sure the script or binary you are trying to execute actually exists...

 

Pipesent code:

 

#!/bin/bash

 

echo "" > /opt/tools/pipesend/send.out

while read line

do

   echo "$line" >> /opt/tools/pipesend/send.out

done

 

sendSMS "1234567890" "$(cat /opt/tools/pipesend/send.out)"

 

 

If I remove the ‘pipesend’ and replace it with ‘mail’ and execute it via Nagios it works.

 

So the question is, does Nagios only work with special scripts and/or binaries?

 

Thanks in advance

George


--
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.385 / Virus Database: 268.3.0/290 - Release Date: 2006/03/23

Reply via email to