Unable to get output on custom check
Posted: Mon Aug 28, 2017 5:35 pm
Hi Team,
Nagios server OS - Centos 6.5 (64bit)
Nagios XI version - 5.4.8
I created custom check to monitor my oracle DB. in this case i have my own perl script which does the job.
1 - Set environment variable on nagios server.
-------------------
[nagios@laxco6nxi01 ~]$ echo $ORACLE_HOME
/usr/lib/oracle/11.2/client64
[nagios@laxco6nxi01 ~]$ echo $LD_LIBRARY_PATH
/usr/lib/oracle/11.2/client64/lib
[nagios@laxco6nxi01 ~]$ echo $ORACLE_BASE
/usr/lib/oracle
[nagios@laxco6nxi01 ~]$ echo $TNS_ADMIN
/usr/lib/oracle/11.2/client64/network/admin
-------------------
2 - I created command.
-------------------
Command Name = check_oracle.pl
Command line =$USER1$/check_oracle.pl -u $ARG1$ -p $ARG2$ -c $ARG3$ $ARG4$
-------------------
Applied the changes. All successfully submitted.
3 - Created a service.
Check command = check_oracle.pl
ARG1 = username
ARG2 = password
ARG3 = service name (tnsnames.ora)
ARG4 = thresholds
After that i clicked "Run Check command" & typed IP address of my DB server. Now the issue is its not showing me any output. where as i copied the command which i got after i clicked on "Run Check command" & executed on nagios server with user root as well as nagios & i got the desired output.
-------------------
# output from nagios webpage. -------------------
# output from command line (user - root) -------------------
# output from command line (user - nagios) -------------------
I am not able to find out why the same command works when i execute it on nagios server from command line & why it don't work when gets executed by nagios check (webpage).
Please help.
Regards,
Rohan Talkar
Nagios server OS - Centos 6.5 (64bit)
Nagios XI version - 5.4.8
I created custom check to monitor my oracle DB. in this case i have my own perl script which does the job.
1 - Set environment variable on nagios server.
-------------------
[nagios@laxco6nxi01 ~]$ echo $ORACLE_HOME
/usr/lib/oracle/11.2/client64
[nagios@laxco6nxi01 ~]$ echo $LD_LIBRARY_PATH
/usr/lib/oracle/11.2/client64/lib
[nagios@laxco6nxi01 ~]$ echo $ORACLE_BASE
/usr/lib/oracle
[nagios@laxco6nxi01 ~]$ echo $TNS_ADMIN
/usr/lib/oracle/11.2/client64/network/admin
-------------------
2 - I created command.
-------------------
Command Name = check_oracle.pl
Command line =$USER1$/check_oracle.pl -u $ARG1$ -p $ARG2$ -c $ARG3$ $ARG4$
-------------------
Applied the changes. All successfully submitted.
3 - Created a service.
Check command = check_oracle.pl
ARG1 = username
ARG2 = password
ARG3 = service name (tnsnames.ora)
ARG4 = thresholds
After that i clicked "Run Check command" & typed IP address of my DB server. Now the issue is its not showing me any output. where as i copied the command which i got after i clicked on "Run Check command" & executed on nagios server with user root as well as nagios & i got the desired output.
-------------------
# output from nagios webpage. -------------------
# output from command line (user - root) -------------------
# output from command line (user - nagios) -------------------
I am not able to find out why the same command works when i execute it on nagios server from command line & why it don't work when gets executed by nagios check (webpage).
Please help.
Regards,
Rohan Talkar