本文介绍了Nagios(返回码255超出范围)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 http://localhost/nagios

但是当我从shell运行命令时,它运行正常

But when I run the command from the shell, it runs fine

推荐答案

如果您使用的是NRPE并收到"NRPE:无法读取输出" 错误,这是因为NRPE守护进程没有返回文本数据. Nagios核心依靠NRPE守护程序返回一个总结检查结果的字符串.例如,对于返回健康状态的检查结果,它看起来可能像前者,而显示不健康状态则是后者.

If you're using NRPE and receiving a 'NRPE: Unable to read output' error it is because the NRPE daemon is not returning text data. The Nagios core depends on NRPE daemons to return a string that summarizes the results of the checks. For instance, for a check result that is returning a healthy status, it may look like the former whereas an unhealthy status would be displayed the the latter.

OK - load average: 1.56, 1.37, 1.29 
CRITICAL - load average: 16.59, 19.41, 21.96 

如果NRPE返回以下内容:

If NRPE were to return something like this:

FOO: bar 

您将收到"NRPE:无法读取输出"错误,因为FOO不是Nagios的已知结果状态之一.通过运行以下命令来运行远程NRPE命令(取决于您的目录和检查):

You're going to get a 'NRPE: Unable to read output' error because FOO is not one of Nagios's known result states. Run the remote NRPE command by running something like this (depending on your directories and checks):

libexec/check_nrpe -n -H localhost -c check_load

应返回OK,WARNING,CRITICAL或UNKNOWN.其他任何情况都会导致该错误.

That should return OK, WARNING, CRITICAL, or UNKNOWN. Anything else will cause that error.

这篇关于Nagios(返回码255超出范围)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!