Get the App
SLTechnology News&Howtos  ›  Database  › 

About NRPE: Unable to read output

Shulou Source: shulou.com Published: 2022-06-01 18:24:43 11月13日 Update

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.

Tags: Users again blogs empowerment toggles prompts detection success one line comments directories results scripts output Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Shulou Technology Docker OPPO Reno Shulou Tech Info vpn