About NRPE: Unable to read output
Detect check_oracle_table through check_nrpe
/ usr/local/nagios/libexec/check_nrpe-H 10.10.10.10-c check_oracle_table
Error NRPE: Unable to read output
Execute / usr/local/nagios/libexec/check_oracle_table.py output directly locally and the result is normal
According to the online blog http://blog.chinaunix.net/uid-25266990-id-3431778.html
Prompt to modify / etc/sudoers
Add a row
Nagios ALL= (ALL) NOPASSWD:/usr/local/nagios/libexec/check_oracle_table.py
Comment Defaults requiretty
Then execute it at the remote end, and still report an error NRPE: Unable to read output
Follow the blog prompts above to switch nagios users to execute scripts.
# usermod-s / bin/bash nagiosp
# su-nagios
-bash-4.1 $/ usr/local/nagios/libexec/check_oracle_table.py
File "/ usr/local/nagios/libexec/check_oracle_table.py", line 5, in
Import cx_Oracle,sys
ImportError: libclntsh.so.10.1: cannot open shared object file: No such file or directory
Copy the .bash _ profile of the root user to the nagios user
Execute again
Traceback (most recent call last):
File "/ usr/local/nagios/libexec/check_oracle_table.py", line 55, in
Conn = cx_Oracle.connect ('test','test',dsn)
Cx_Oracle.InterfaceError: Unable to acquire Oracle environment handle
Detection found that no permission was assigned to ORACLE_HOME=/opt/oracle/product/10.2/db_1 in .bash _ profile
I give weight to the entire directory 755.
Execute it again, success!
Switch to the remote end
/ usr/local/nagios/libexec/check_nrpe-H 10.10.10.10-c check_oracle_table
It looks normal.