I am encountering a strange problem while configuring and using Nagios (nagios-1.2-2.1). I have written several scripts/plugins which i want to store on a local nagios server, this is the machine which runs nagios. I have several clients in the network which i want to monitor. In the plugins on the nagios server (/usr/lib/nagios/plugins) i do the following:
Sending the script to the client.
scp syslog_check nagios@$myhost:/home/nagios/
Running the script on the client.
ssh nagios@$myhost ./syslog_check > “$file”
echo “This is the returned output: .$status.”
So i scp the scripts to the client, run them there, and in those scripts i echo an integer (0-10) which will be evaluated in the script on the nagios server.
The problem is that this doesn’t seem to be working if i use nagios. It works great if i run it in bash, but if i run it in nagios, for some reason the return value is always “”. So it only gives me an empty string back…
Does anyone know what i am doing wrong here?