[Nagiosplug-help] creating a plugin script
Gerhard Lausser
Gerhard.Lausser at consol.de
Tue Jan 22 14:03:20 CET 2008
Hi Robert,
> NRPE: Unable to read output
i would say, this is correct, because your plugin does not output anything.
Please try
...
if [ $result -eq 0 ]; then
echo "CRITICAL - database error"
exit 2
else
echo "OK - database working fine"
exit 0
fi
What about the result from the mysql call? What happens if the database is
not reachable? You compare $result numerically with 0. If something goes
wrong, then the $result may not be a number, but some error message instead.
Better use the exit code $? of the mysql command.
Greetings from Munich,
Gerhard
More information about the Help
mailing list