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.
I found your script pretty hard to read, so I rewrote certain parts of it while I was looking at it. Use or don't use my changes. Anyway, when you run it from the command line are you running it as the root user or as the nagios user? Often these kinds of issues are permission problems, and will work when run as run but not as some other user. You should try testing it like this:
I did changed the permission for the plugin. the owner is nagios now, but still same problem. The Nagios can run the command and just does not display the performace data I defined. It displayed other output messages.
I also tried Nagios -c, but I got a -c is not a valid option.
I tried your code, but there is a warning: here-document at line 22 delimited by end-of-file (wanted `EOF')
I didn't actually test my changes since I don't have an Oracle database to run it against. Most of my changes were only cosmetic anyway, feel free to revert anything that doesn't work back to how you had it.
I think you missed the 'su' command that I put in front of 'nagios' in my last post. Try running it again with the 'su' in there. I didn't mean to imply that the permissions on the command should be owned by nagios - only that the command needs to be run as nagios (that's what the 'su' command accomplishes).
The queuenumx is a number returned from sqlplus in my shell script.
$queuenumx =`echo "$result"`. In this way it can be displayed in terminal but not Nagios
But if I assigned $queuenumx a constant like
$queuenumx =27
Then the value can be displayed in the Nagios. WHY? Why I can not assign a variable to another variable?