Help In Setting Up Command Configuration

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Frank4dd
Posts: 1
Joined: Mon Jun 02, 2014 7:36 am
Contact:

Re: Help In Setting Up Command Configuration

Post by Frank4dd »

Hi,

For this plugin, both the argument number and the order of arguments is fixed:
check_tablespace_oracle <ip> <db-port> <db-name> <db-user> <db-pwd>

In your Nagios example above, $ARG1$ is given the db-name, and it is placed before the db-port number. This prevents the successful execution.

Just for reference, a working definition looks as follows:

command_line /usr/bin/java -classpath /usr/local/nagios/libexec/ check_dbversion_oracle $HOSTADDRESS$ $ARG1$ $ARG2$ $ARG3$ $ARG4$ -f /srv/app/nagios/libexec/check_dbversion.cfg
  • $ARG1$ = db-port
    $ARG2$ = db-name
    $ARG3$ = db-user
    $ARG4$ = db-pass
Best Wishes,
Frank
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: Help In Setting Up Command Configuration

Post by rkennedy »

Frank4dd wrote:Hi,

For this plugin, both the argument number and the order of arguments is fixed:
check_tablespace_oracle <ip> <db-port> <db-name> <db-user> <db-pwd>

In your Nagios example above, $ARG1$ is given the db-name, and it is placed before the db-port number. This prevents the successful execution.

Just for reference, a working definition looks as follows:

command_line /usr/bin/java -classpath /usr/local/nagios/libexec/ check_dbversion_oracle $HOSTADDRESS$ $ARG1$ $ARG2$ $ARG3$ $ARG4$ -f /srv/app/nagios/libexec/check_dbversion.cfg
  • $ARG1$ = db-port
    $ARG2$ = db-name
    $ARG3$ = db-user
    $ARG4$ = db-pass
Best Wishes,
Frank
Thanks for clarification @Frank4dd! @CloudOps - this should work for you. Let us know if you have any questions.
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:
Frank4dd wrote:Hi,

For this plugin, both the argument number and the order of arguments is fixed:
check_tablespace_oracle <ip> <db-port> <db-name> <db-user> <db-pwd>

In your Nagios example above, $ARG1$ is given the db-name, and it is placed before the db-port number. This prevents the successful execution.

Just for reference, a working definition looks as follows:

command_line /usr/bin/java -classpath /usr/local/nagios/libexec/ check_dbversion_oracle $HOSTADDRESS$ $ARG1$ $ARG2$ $ARG3$ $ARG4$ -f /srv/app/nagios/libexec/check_dbversion.cfg
  • $ARG1$ = db-port
    $ARG2$ = db-name
    $ARG3$ = db-user
    $ARG4$ = db-pass
Best Wishes,
Frank
Thanks for clarification @Frank4dd! @CloudOps - this should work for you. Let us know if you have any questions.

Hi Frank and rkennedy,

Thanks a lot, now i am able to pull the information. its working as expected. But need help in making some changes, i want the output to show like its enterprise or standard oracle edition? can we get that output?

output like : Version OK: Oracle Database 11g Enterprise Edition v11.2.0.4.0

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

Re: Help In Setting Up Command Configuration

Post by rkennedy »

What output are you currently seeing in Nagios?

It looked like above it was outputting that above -

Code: Select all

[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
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:What output are you currently seeing in Nagios?

It looked like above it was outputting that above -

Code: Select all

[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
Hi rkennedy,

I am seeing output as :

Version OK: Oracle v11.2.0.4.0

Thats all is coming on dashboard
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: Help In Setting Up Command Configuration

Post by rkennedy »

Got it, you'll need to modify the output of the actual script. It is parsing everything after the | as performance data, which is why you are not seeing it.

Take a look at this line for example -

Code: Select all

      System.out.println("Version OK: " + version + "|" + perfdata);
and change it to -

Code: Select all

      System.out.println("Version OK: " + version + " " + perfdata);
There may be a few more replacements like that to be made in the file, but that will have it stop processing performance data and show you 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:Got it, you'll need to modify the output of the actual script. It is parsing everything after the | as performance data, which is why you are not seeing it.

Take a look at this line for example -

Code: Select all

      System.out.println("Version OK: " + version + "|" + perfdata);
and change it to -

Code: Select all

      System.out.println("Version OK: " + version + " " + perfdata);
There may be a few more replacements like that to be made in the file, but that will have it stop processing performance data and show you the result.
As per your suggestion , but still not getting the exact output, also i have made some changes like :

System.out.println("OK:" + " " +perfdata);


Now i am getting output like this : OK: Oracle Database 11g v11.2.0.3.0 ,its not showing " Enterprise Edition ". Complete output should come like this " Oracle Database 11g Enterprise Edition v11.2.0.3.0 "
CloudOps
Posts: 88
Joined: Mon Feb 08, 2016 12:52 am

Re: Help In Setting Up Command Configuration

Post by CloudOps »

Hi rkennedy,

I modified some lines and now i am getting correct output.you can close this thread.

Thank you so much for helping on this.

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

Re: Help In Setting Up Command Configuration

Post by rkennedy »

Your welcome. Glad to hear!

Closing this thread out now, but feel free to make a new one if you need any assistance in the future.
Former Nagios Employee
Locked