check_oracle problem


#1

Hi,

I have Nagios 3.0.6 and full Oracle client 11.1.0.7 installed on RHEL5.2 host.

I can run command as nagios or root user:
[blockquote]
nagios@monitor:~$ /usr/local/nagios/libexec/check_oracle --login db01
OK - dummy login connected
[/blockquote]
but on the CGI I have:
Cannot determine ORACLE_HOME for sid am10gr2

There are my configs:

[blockquote]
define host {
host_name oradb102
alias Test Oracle RDBMS Server
address 172.24.10.55
use linux-server
_sid db01
}
define host {
host_name am-msoorcl
alias AMMSO Oracle RDBMS Server
address 134.44.96.97
use linux-server
_sid am10gr2
}

define hostgroup{
hostgroup_name oracle-rdbms
alias Oracle RDBMS Servers for tests
members oradb102,am-msoorcl
}
define command{
command_name check_oradb_sid
command_line $USER1$/check_oracle --login $_HOSTSID$
}
define service {
hostgroup_name oracle-rdbms
service_description ORADB_SID
check_command check_oradb_sid

max_check_attempts              10
normal_check_interval           2			; Check the service every 10 minutes under normal conditions
retry_check_interval            1			; Re-check the service every two minutes until a hard state can be determined

use                             generic-service
notification_interval           0 ; set > 0 if you want to be renotified
}

[/blockquote]
nagios log:
[blockquote]
[1228317618] SERVICE ALERT: oradb102;ORADB_SID;UNKNOWN;SOFT;9;Cannot determine ORACLE_HOME for sid db01
[1228317658] SERVICE ALERT: am-msoorcl;ORADB_SID;UNKNOWN;SOFT;9;Cannot determine ORACLE_HOME for sid am10gr2
[/blockquote]

Can you tell me where I wrong or how I can debug this plugin?
Thanks a lot.


#2

The problem is solved.
There is no ORACLE_HOME variable defined for script check_oracle.
But I’ve defined it for all users in /etc/profile