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:
Post
by Frank4dd » Tue Mar 22, 2016 11:17 pm
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
Post
by rkennedy » Wed Mar 23, 2016 9:14 am
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
Post
by CloudOps » Wed Mar 23, 2016 9:16 am
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
Post
by rkennedy » Wed Mar 23, 2016 2:03 pm
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
Post
by CloudOps » Wed Mar 23, 2016 3:49 pm
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
Post
by rkennedy » Wed Mar 23, 2016 4:07 pm
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
Post
by CloudOps » Wed Mar 23, 2016 5:00 pm
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
Post
by CloudOps » Wed Mar 23, 2016 6:41 pm
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
Post
by rkennedy » Thu Mar 24, 2016 10:24 am
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