Page 2 of 2

Re: as pnp4nagios do generate the graph of my script?

Posted: Wed Apr 29, 2015 10:28 am
by alexprinou
dear friend I have that same script running on other equipment along with the nagios he creates the txt file normally. when I put the script on other equipment that I want to monitor him from the uknow error.

Re: as pnp4nagios do generate the graph of my script?

Posted: Wed Apr 29, 2015 10:42 am
by Box293
Does the other equipment have correct directory permissions that allow the nagios user to create / update a file in that location?

What happens when you test the script as the nagios user?

Code: Select all

su nagios
./check_your_plugin blah blah blah

Re: as pnp4nagios do generate the graph of my script?

Posted: Wed Apr 29, 2015 1:03 pm
by alexprinou
thank you friends got was even x permission in directory

Re: as pnp4nagios do generate the graph of my script?

Posted: Wed Apr 29, 2015 2:31 pm
by Box293
Is your problem now resolved?

Re: Nagios will not return string from bash script

Posted: Wed May 06, 2015 7:10 am
by alexprinou
dear friends to this forum helped me solve my problems I decided to post my code


I hope it helps more people

Code: Select all

# bash -x check_ccq_estacao_tx_router
cd /home/nagios
rm -rf ccq-tx-estacao.txt
outputSSH=$ ssh user@10.255.255.133 "/interface wireless monitor 0 once"|grep tx-ccq|sed 's/%//' > ccq-tx-estacao.txt
output=$(sed 's/tx-ccq://g' ccq-tx-estacao.txt)
if [ $output -ge 85 ] ; then
   echo "$output % | ccqtx=$output"
   exit 0;
elif [ $output -le 85  ]; then
   echo "$output % | ccqtx=$output"
   exit 2;
else
   echo "$output"
   exit 1;
fi
exit 3;

Re: as pnp4nagios do generate the graph of my script?

Posted: Wed May 06, 2015 3:07 pm
by abrist
Thanks for the update!