check_oracle

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.
Locked
AnotherNagiosUser
Posts: 19
Joined: Tue Feb 26, 2019 4:51 am

check_oracle

Post by AnotherNagiosUser »

I'm having trouble with the check_oracle plugin now. This is how it's set up at the moment.

nrpe.cfg

Code: Select all

command[check_oracle]=/usr/local/nagios/libexec/check_oracle $ARG1$

Code: Select all

define service {
        use                            generic-service
        host_name                      db1-serv
        service_description            database1
        check_command                  check_nrpe!check_oracle! '--db database1'
I get this error on nagios

(No output returned from plugin)

I think I need to specify the path to oracle in nrpe?

Code: Select all

LD_LIBRARY_PATH=/usr/lib/oracle/11.2/client/lib ORACLE_HOME=/usr/lib/oracle/11.2/client 
Not sure how I do this , or maybe i need to be doing this in the service bit.

The nagios user on the database server has the oracle enviromental settings in bash_profile.
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: check_oracle

Post by scottwilkerson »

Change this

Code: Select all

command[check_oracle]=/usr/local/nagios/libexec/check_oracle $ARG1$
to this

Code: Select all

command[check_oracle]=/usr/bin/env LD_LIBRARY_PATH=/usr/lib/oracle/11.2/client/lib ORACLE_HOME=/usr/lib/oracle/11.2/client /usr/local/nagios/libexec/check_oracle $ARG1$
then restart NRPE
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
AnotherNagiosUser
Posts: 19
Joined: Tue Feb 26, 2019 4:51 am

Re: check_oracle

Post by AnotherNagiosUser »

scottwilkerson wrote:Change this

Code: Select all

command[check_oracle]=/usr/local/nagios/libexec/check_oracle $ARG1$
to this

Code: Select all

command[check_oracle]=/usr/bin/env LD_LIBRARY_PATH=/usr/lib/oracle/11.2/client/lib ORACLE_HOME=/usr/lib/oracle/11.2/client /usr/local/nagios/libexec/check_oracle $ARG1$
then restart NRPE
I'm still getting this message
(No output returned from plugin)
NRPE Plugin for Nagios
Copyright (c) 1999-2008 Ethan Galstad (nagios@nagios.org)
Version: 2.15
Last Modified: 09-06-2013
License: GPL v2 with exemptions (-l for more info)
SSL/TLS Available: Anonymous DH Mode, OpenSSL 0.9.6 or higher required

Usage: check_nrpe -H <host> [ -b <bindaddr> ] [-4] [-6] [-n] [-u] [-p <port>] [-t <timeout>] [-c <command>] [-a <arglist...>]
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: check_oracle

Post by scottwilkerson »

Can you show what you have configured as your check_nrpe command on the nagios server?
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
AnotherNagiosUser
Posts: 19
Joined: Tue Feb 26, 2019 4:51 am

Re: check_oracle

Post by AnotherNagiosUser »

define command{
command_name check_nrpe
command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -c $ARG1$ $ARG2$
}
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: check_oracle

Post by scottwilkerson »

So, the $ARG2$ in you service description is going to need the -a flag in it to pass the arguments, something like this

Code: Select all

define service {
        use                            generic-service
        host_name                      db1-serv
        service_description            database1
        check_command                  check_nrpe!check_oracle! -a ' --db database1'
I'm not sure what the full command you are trying to send is, but the argumnts you want to send would go in the quotes after the -a flag
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
AnotherNagiosUser
Posts: 19
Joined: Tue Feb 26, 2019 4:51 am

Re: check_oracle

Post by AnotherNagiosUser »

Thanks, adding the -a worked! :D :D
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: check_oracle

Post by scottwilkerson »

AnotherNagiosUser wrote:Thanks, adding the -a worked! :D :D
Excellent!

Locking thread
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
Locked