CHANGE_SVC_EVENT_HANDLER 外部命令失败
CHANGE_SVC_EVENT_HANDLER External Command Failed
我对这个外部命令不满意:
/usr/bin/printf "[%lu] CHANGE_SVC_EVENT_HANDLER;<HOST>;<SERVICE>;ack_service\n" >> /usr/local/nagios/var/rw/nagios.cmd
Nagios.log 显示:
[1647021762] EXTERNAL COMMAND: CHANGE_SVC_EVENT_HANDLER;<HOST>;<SERVICE>;ack_service
[1647021762] Error: External command failed -> CHANGE_SVC_EVENT_HANDLER;<HOST>;<SERVICE> ack_service
[1647021762] External command [1647021762] CHANGE_SVC_EVENT_HANDLER;<HOST>;<SERVICE>;ack_service returned error Command failed
我以同样的方式提交其他外部命令没有问题。
对于我使用的服务,
-- 启用事件处理程序 (EH)。
-- 我有一个现有的 EH,它与我试图切换到的 EH 不同。
在 nagios.cfg 我有 check_external_commands=1
有什么想法吗?
调试日志也没有任何帮助:
[1647022292.354006] [256.2] [pid=10560] Read 78 bytes from command worker
[1647022292.354040] [256.1] [pid=10560] Read raw external command '[1647021762] CHANGE_SVC_EVENT_HANDLER;<HOST>;<SERVICE>;ack_service'
[1647022292.354045] [001.0] [pid=10560] process_external_command1()
[1647022292.354049] [128.2] [pid=10560] Raw command entry: [1647021762] CHANGE_SVC_EVENT_HANDLER;<HOST>;<SERVICE>;ack_service
[1647022292.354094] [064.1] [pid=10560] Making callbacks (type 2)...
[1647022292.354100] [064.2] [pid=10560] Callback #1 (type 2) return code = 0
[1647022292.354104] [064.1] [pid=10560] Making callbacks (type 17)...
[1647022292.354107] [064.2] [pid=10560] Callback #1 (type 17) return code = 0
[1647022292.354110] [001.0] [pid=10560] process_external_command2()
[1647022292.354113] [128.1] [pid=10560] External Command Type: 126
[1647022292.354116] [128.1] [pid=10560] Command Entry Time: 1647021762
[1647022292.354119] [128.1] [pid=10560] Command Arguments: <HOST>;<SERVICE>;ack_service
[1647022292.354130] [064.1] [pid=10560] Making callbacks (type 2)...
[1647022292.354133] [064.2] [pid=10560] Callback #1 (type 2) return code = 0
[1647022292.354136] [064.1] [pid=10560] Making callbacks (type 17)...
[1647022292.354139] [064.2] [pid=10560] Callback #1 (type 17) return code = 0
[1647022292.354151] [064.1] [pid=10560] Making callbacks (type 2)...
[1647022292.354154] [064.2] [pid=10560] Callback #1 (type 2) return code = 0
[1647022292.354157] [4096.2] [pid=10560] ## 1 descriptors had input
这就是原因。如果错误指示发生了什么,那就太好了!
https://github.com/NagiosEnterprises/nagioscore/commit/3207e91193cb507401858a6136fc6e3fc257a236
以下宏被禁用:
CHANGE_GLOBAL_HOST_EVENT_HANDLER
CHANGE_GLOBAL_SVC_EVENT_HANDLER
CHANGE_HOST_EVENT_HANDLER
CHANGE_SVC_EVENT_HANDLER
CHANGE_HOST_CHECK_COMMAND
CHANGE_SVC_CHECK_COMMAND
我对这个外部命令不满意:
/usr/bin/printf "[%lu] CHANGE_SVC_EVENT_HANDLER;<HOST>;<SERVICE>;ack_service\n" >> /usr/local/nagios/var/rw/nagios.cmd
Nagios.log 显示:
[1647021762] EXTERNAL COMMAND: CHANGE_SVC_EVENT_HANDLER;<HOST>;<SERVICE>;ack_service
[1647021762] Error: External command failed -> CHANGE_SVC_EVENT_HANDLER;<HOST>;<SERVICE> ack_service
[1647021762] External command [1647021762] CHANGE_SVC_EVENT_HANDLER;<HOST>;<SERVICE>;ack_service returned error Command failed
我以同样的方式提交其他外部命令没有问题。 对于我使用的服务, -- 启用事件处理程序 (EH)。 -- 我有一个现有的 EH,它与我试图切换到的 EH 不同。 在 nagios.cfg 我有 check_external_commands=1
有什么想法吗?
调试日志也没有任何帮助:
[1647022292.354006] [256.2] [pid=10560] Read 78 bytes from command worker
[1647022292.354040] [256.1] [pid=10560] Read raw external command '[1647021762] CHANGE_SVC_EVENT_HANDLER;<HOST>;<SERVICE>;ack_service'
[1647022292.354045] [001.0] [pid=10560] process_external_command1()
[1647022292.354049] [128.2] [pid=10560] Raw command entry: [1647021762] CHANGE_SVC_EVENT_HANDLER;<HOST>;<SERVICE>;ack_service
[1647022292.354094] [064.1] [pid=10560] Making callbacks (type 2)...
[1647022292.354100] [064.2] [pid=10560] Callback #1 (type 2) return code = 0
[1647022292.354104] [064.1] [pid=10560] Making callbacks (type 17)...
[1647022292.354107] [064.2] [pid=10560] Callback #1 (type 17) return code = 0
[1647022292.354110] [001.0] [pid=10560] process_external_command2()
[1647022292.354113] [128.1] [pid=10560] External Command Type: 126
[1647022292.354116] [128.1] [pid=10560] Command Entry Time: 1647021762
[1647022292.354119] [128.1] [pid=10560] Command Arguments: <HOST>;<SERVICE>;ack_service
[1647022292.354130] [064.1] [pid=10560] Making callbacks (type 2)...
[1647022292.354133] [064.2] [pid=10560] Callback #1 (type 2) return code = 0
[1647022292.354136] [064.1] [pid=10560] Making callbacks (type 17)...
[1647022292.354139] [064.2] [pid=10560] Callback #1 (type 17) return code = 0
[1647022292.354151] [064.1] [pid=10560] Making callbacks (type 2)...
[1647022292.354154] [064.2] [pid=10560] Callback #1 (type 2) return code = 0
[1647022292.354157] [4096.2] [pid=10560] ## 1 descriptors had input
这就是原因。如果错误指示发生了什么,那就太好了!
https://github.com/NagiosEnterprises/nagioscore/commit/3207e91193cb507401858a6136fc6e3fc257a236
以下宏被禁用: CHANGE_GLOBAL_HOST_EVENT_HANDLER CHANGE_GLOBAL_SVC_EVENT_HANDLER CHANGE_HOST_EVENT_HANDLER CHANGE_SVC_EVENT_HANDLER CHANGE_HOST_CHECK_COMMAND CHANGE_SVC_CHECK_COMMAND