Unknown code while code should be OK


#1

Hello,

I wrote a small perl program for Nagios, which checks if the Queue manager is up and running.
That script works, and also gives an exit 0.

When I run the perl command from shell (perl -w), it’s giving the following output:

Connection to MQ: OK

And gives an exit 0.

In the Nagios window you can also see that text 'Connection to MQ: Ok’
But it always gives the state ‘unknown’

Can somebody help me ?

B

#2

My only suggestion would be to look at how the other perl plugins pass info to nagios. Perhaps you have no definition of what “OK” status is. That way, if the check results in exit 0, then $status or some variable will be set to “OK”.


#3

I copied that from other plugins, and the state is ‘ok’. I also tried this with exit 0, but same result.


#4

if i’m not wrong you can parse the output as a regex on some plugins… don’t know if this helps much…

Luca


#5

This person in the following thread had the same sort of trouble. Check it out.
meulie.net/forum_viewtopic.php?21.1279