我有一个在 nagios command.cfg 和服务定义中定义的自定义脚本。当在监控主机上以 nagios 本地运行时,它会返回预期的输出(来自 redis 实例的大量统计信息哈希):
[nagios@mon1 scripts]$ /etc/nagios/application-nagios/scripts/check_dataquality.rb -w 10 -c 25 -h redis01
Critical: {"DATA.table1":{"ok":135628,"in_progress":2,"failed":0,"warn":0,"started":135630},"DATA.table2.237-2016-04-24":{"ok":26,"in_progress":1,"failed":0,"warn":0,"started":27},"PROCESS.table2":{"ok":6062,"in_progress":118,"failed":0,"warn":0,"started":6180},"PROCESS.table4":{"ok":2868,"in_progress":-10945,"failed":12361,"warn":0,"started":4284},"PROCESS.table5.application/octet-stream":{"ok":6062,"in_progress":118,"failed":0,"warn":0,"started":6180},"PROCESS.table6":{"ok":57,"in_progress":-3782,"failed":0,"warn":13778,"started":10053},"PROCESS.table7":{"ok":1512,"in_progress":0,"failed":2,"warn":0,"started":1514},"PROCESS.table8":{"ok":61,"in_progress":-128,"failed":3,"warn":571,"started":507},"PROCESS.table9":{"ok":82,"in_progress":3,"failed":0,"warn":0,"started":85}}
但在我的 Thruk UI 和日志中,它返回 (null):
日志记录显示同样的事情:
[1461791704] SERVICE ALERT: Blue Team;dataquality-services;WARNING;HARD;5;(null)
我不确定这是服务命令输出的限制,还是这里有一些非法字符。任何关于为什么这个服务命令返回