通过check_nrpe 来检测check_oracle_table/usr/local/nagiOS/libexec/check_nrpe -H 10.10.10.10 -c check_oracle_t
通过check_nrpe 来检测check_oracle_table
/usr/local/nagiOS/libexec/check_nrpe -H 10.10.10.10 -c check_oracle_table
报错 NRPE: Unable to read output
在本地直接执行/usr/local/nagios/libexec/check_oracle_table.py 输出结果正常
根据网上博客Http://blog.chinaunix.net/uid-25266990-id-3431778.html
提示 修改 /etc/sudoers
添加一行
nagios ALL=(ALL) NOPASSWD:/usr/local/nagios/libexec/check_oracle_table.py
注释Defaults requiretty
然后在远端执行,依旧报错 NRPE: Unable to read output
根据上面博客提示 切换nagios 用户执行脚本
#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 <module>
import cx_Oracle,sys
ImportError: libclntsh.so.10.1: cannot open shared object file: No such file or directory
将 root 用户的 .bash_profile 复制到 nagios 用户
再次执行
Traceback (most recent call last):
File "/usr/local/nagios/libexec/check_oracle_table.py", line 55, in <module>
conn = cx_Oracle.connect('test','test',dsn)
cx_Oracle.InterfaceError: Unable to acquire Oracle environment handle
检测发现没有给 .bash_profile 中ORACLE_HOME=/opt/oracle/product/10.2/db_1 赋权限,
我将 整个目录 赋权 755
再次执行,成功!
切换到远端
/usr/local/nagios/libexec/check_nrpe -H 10.10.10.10 -c check_oracle_table
显示正常。
--结束END--
本文标题: 关于 NRPE: Unable to read output
本文链接: https://www.lsjlt.com/news/35748.html(转载时请注明来源链接)
有问题或投稿请发送至: 邮箱/279061341@qq.com QQ/279061341
下载Word文档到电脑,方便收藏和打印~
2024-05-03
2024-05-03
2024-05-03
2024-05-03
2024-05-03
2024-05-03
2024-05-03
2024-05-03
2024-05-03
2024-05-03
回答
回答
回答
回答
回答
回答
回答
回答
回答
回答
0