Help In Setting Up Command Configuration

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
CloudOps
Posts: 88
Joined: Mon Feb 08, 2016 12:52 am

Help In Setting Up Command Configuration

Post by CloudOps »

Hi ,

I have setup one plugin which tells about the oracle version installed on windows and linux. I am trying to set command configuration but not able to.

Script is working fine from command line, but i am not able to set the commmand. i want to configure for all servers. can any one guide?

Here is the Plugin :

http://nagios.fm4dd.com/howto/db-monitoring.htm


Usage: java check_dbversion_oracle <db-ip> <db-port> <db-instance> <db-user> <db-pwd> [-d]

java -classpath /usr/local/nagios/libexec/ check_dbversion_oracle 172.26.2.15 1521 oracle monora "m0n0ra7"
Version OK: Oracle v11.2.0.4.0|Oracle Database 11g Enterprise Edition v11.2.0.4.0

Can any one help here.
User avatar
hsmith
Agent Smith
Posts: 3539
Joined: Thu Jul 30, 2015 11:09 am
Location: 127.0.0.1
Contact:

Re: Help In Setting Up Command Configuration

Post by hsmith »

Can you show us the working command line output?
Former Nagios Employee.
me.
CloudOps
Posts: 88
Joined: Mon Feb 08, 2016 12:52 am

Re: Help In Setting Up Command Configuration

Post by CloudOps »

hsmith wrote:Can you show us the working command line output?
My Command Line Output :

[root@vmcloudtest libexec]# java -classpath /usr/local/nagios/libexec/ check_dbversion_oracle 172.26.2.15 1521 oracle monora "m0n0ra7"
Version OK: Oracle v11.2.0.4.0|Oracle Database 11g Enterprise Edition v11.2.0.4.0

if i am checking through Console, its giving no output (screenshot attached)
You do not have the required permissions to view the files attached to this post.
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: Help In Setting Up Command Configuration

Post by rkennedy »

You may need to use the full path to java, what is the output of whereis java?

To add to that, what are the permissions of check_dbversion_oracle? ls -l /usr/local/nagios/libexec/check_dbversion_oracle

Lastly, your command line looks off, you'll need to add at least $HOSTADDRESS$ to the end of the command defined in the XI interface. You'll then need to decide if you are setting 'oracle monora "m0n0ra7" through the service as $ARG1$, or if you statically define it in the command. The choice is yours, as to what will make the best use in your environment.
Former Nagios Employee
CloudOps
Posts: 88
Joined: Mon Feb 08, 2016 12:52 am

Re: Help In Setting Up Command Configuration

Post by CloudOps »

rkennedy wrote:You may need to use the full path to java, what is the output of whereis java?

To add to that, what are the permissions of check_dbversion_oracle? ls -l /usr/local/nagios/libexec/check_dbversion_oracle

Lastly, your command line looks off, you'll need to add at least $HOSTADDRESS$ to the end of the command defined in the XI interface. You'll then need to decide if you are setting 'oracle monora "m0n0ra7" through the service as $ARG1$, or if you statically define it in the command. The choice is yours, as to what will make the best use in your environment.

Hi rkennedy,

I have done the modifications, as you suggested but still output is coming same as above (screenshot attached). Also there is no file check_dbversion_oracle.

java Location :
[root@VM-NAGIOSXI-TEST bin]# whereis java
java: /usr/bin/java /etc/java /usr/lib/java /usr/share/java /usr/share/man/man1/java.1.gz
[root@VM-NAGIOSXI-TEST bin]#


Please check the plugin page : http://nagios.fm4dd.com/plugins/manual/ ... oracle.htm

Let me how i can get the output in nagios dashboard ?
You do not have the required permissions to view the files attached to this post.
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: Help In Setting Up Command Configuration

Post by rkennedy »

rkennedy wrote:To add to that, what are the permissions of check_dbversion_oracle? ls -l /usr/local/nagios/libexec/check_dbversion_oracle
The test check over the web interface can have issues. What is the result of the service check that's running over the web interface?

For that service that's running the check, did you set $ARG1$ to oracle monora "m0n0ra7"? Can you paste a screenshot of that page from the CCM?
Former Nagios Employee
CloudOps
Posts: 88
Joined: Mon Feb 08, 2016 12:52 am

Re: Help In Setting Up Command Configuration

Post by CloudOps »

rkennedy wrote:
rkennedy wrote:To add to that, what are the permissions of check_dbversion_oracle? ls -l /usr/local/nagios/libexec/check_dbversion_oracle
The test check over the web interface can have issues. What is the result of the service check that's running over the web interface?

For that service that's running the check, did you set $ARG1$ to oracle monora "m0n0ra7"? Can you paste a screenshot of that page from the CCM?
When i am running the same command on CLI, i am getting the correct output, when i am trying to run from web-interface i am getting blank output.
You do not have the required permissions to view the files attached to this post.
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: Help In Setting Up Command Configuration

Post by rkennedy »

I'd like to rule out permissions, when you run it over the CLI, can you attempt to do so as the nagios user and post the result?
Former Nagios Employee
CloudOps
Posts: 88
Joined: Mon Feb 08, 2016 12:52 am

Re: Help In Setting Up Command Configuration

Post by CloudOps »

rkennedy wrote:I'd like to rule out permissions, when you run it over the CLI, can you attempt to do so as the nagios user and post the result?
Hi rkennedy,

Here is the output when run the command using nagios user :

[nagios@VM-NAGIOSXI-TEST libexec]$ java -classpath /usr/local/nagios/libexec/ check_dbversion_oracle 172.26.2.15 1521 disney monora m0n0ra7
Version OK: Oracle v11.2.0.4.0|Oracle Database 11g Enterprise Edition v11.2.0.4.0
[nagios@VM-NAGIOSXI-TEST libexec]$

its giving the output.

Thanks
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: Help In Setting Up Command Configuration

Post by rkennedy »

CloudOps wrote:
rkennedy wrote:I'd like to rule out permissions, when you run it over the CLI, can you attempt to do so as the nagios user and post the result?
Hi rkennedy,

Here is the output when run the command using nagios user :

[nagios@VM-NAGIOSXI-TEST libexec]$ java -classpath /usr/local/nagios/libexec/ check_dbversion_oracle 172.26.2.15 1521 disney monora m0n0ra7
Version OK: Oracle v11.2.0.4.0|Oracle Database 11g Enterprise Edition v11.2.0.4.0
[nagios@VM-NAGIOSXI-TEST libexec]$

its giving the output.

Thanks
This command has a different syntax then the above screenshot. Can you add disney to your check_db_version command after 1521 so that the parameters pass properly?
Former Nagios Employee
Locked