as pnp4nagios do generate the graph of my script?

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.
alexprinou
Posts: 23
Joined: Sat Apr 18, 2015 9:06 am

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

Post 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.
User avatar
Box293
Too Basu
Posts: 5126
Joined: Sun Feb 07, 2010 10:55 pm
Location: Deniliquin, Australia
Contact:

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

Post 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
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
alexprinou
Posts: 23
Joined: Sat Apr 18, 2015 9:06 am

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

Post by alexprinou »

thank you friends got was even x permission in directory
User avatar
Box293
Too Basu
Posts: 5126
Joined: Sun Feb 07, 2010 10:55 pm
Location: Deniliquin, Australia
Contact:

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

Post by Box293 »

Is your problem now resolved?
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
alexprinou
Posts: 23
Joined: Sat Apr 18, 2015 9:06 am

Re: Nagios will not return string from bash script

Post 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;
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

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

Post by abrist »

Thanks for the update!
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