Page 2 of 2

Re: Help In Setting Up Command Configuration

Posted: Tue Mar 22, 2016 11:17 pm
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

Re: Help In Setting Up Command Configuration

Posted: Wed Mar 23, 2016 9:14 am
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.

Re: Help In Setting Up Command Configuration

Posted: Wed Mar 23, 2016 9:16 am
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,

Re: Help In Setting Up Command Configuration

Posted: Wed Mar 23, 2016 2:03 pm
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

Re: Help In Setting Up Command Configuration

Posted: Wed Mar 23, 2016 3:49 pm
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

Re: Help In Setting Up Command Configuration

Posted: Wed Mar 23, 2016 4:07 pm
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.

Re: Help In Setting Up Command Configuration

Posted: Wed Mar 23, 2016 5:00 pm
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 "

Re: Help In Setting Up Command Configuration

Posted: Wed Mar 23, 2016 6:41 pm
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

Re: Help In Setting Up Command Configuration

Posted: Thu Mar 24, 2016 10:24 am
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.