It works on the command line

I tried searching and came across some posts with similar problems but couldn’t find one I thought was the same as mine. So here’s what I know:

*The Nagios installation was moved from server a running 1.2 to server b running 2.4.
*Each check was cleaned up and moved over a host at a time.
*This particular check was not edited just copied.
*The check logs into an account we have and checks our subscription status. On the command line the information is returned properly. When Nagios checks we have -13000 or so days left. (We really have 240)
*No information needs to be passed to the script. It just needs to be run to do the check.

So in other words the check works fine from the cli but Nagios runs it and does some funny math.

I just double-checked that using the nagios user can run the check successfully from the command line. It just seems to screw up when the active check is run.

For the time being I’ve changed it to a passive check. But, I’d really like to know what could cause this behavior.

It’s a bash script if that helps.

The check from before was originally written by someone else in-house using bash.

I just wrote a different check in perl that performs a search on one of our webpages and parses the results. On the command line the script executes properly and tells me it found the expected 2 results in so many milliseconds. However when Nagios runs this check it returns 0 results. I’m getting really frustrated with this.