We've moved to a new support system!

The Nagios Answer Hub is a place where you can get help with technical questions from our experts. There, you can quickly open tickets and join discussion boards.

Request Nagios Answer Hub access here: https://info.nagios.com/answer-hub-access-new-users

After completing the access form, you will be given access to a portal where new tickets can be created. We will keep the old customer forum sections and ticket system available for current cases to be resolved.

Go to the Answer Hub

CHANGE_SVC_EVENT_HANDLER External Command Failed

Engage with the community of users including those using the open source solutions.
Includes Nagios Core, Plugins, and NCPA

CHANGE_SVC_EVENT_HANDLER External Command Failed

Postby blevans » Fri Mar 11, 2022 1:14 pm

Im having no luck with this external command:
Code: Select all
/usr/bin/printf "[%lu] CHANGE_SVC_EVENT_HANDLER;<HOST>;<SERVICE>;ack_service\n" >> /usr/local/nagios/var/rw/nagios.cmd


Nagios.log shows:
Code: Select all
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


I am submitting other external commands in the same way with no problems.
For the service Im using,
--Event Handler (EH) is enabled.
--I have an existing EH which differs from the one Im trying to switch to.
In nagios.cfg I have check_external_commands=1

Any thoughts?

The debug log isnt any help either:
Code: Select all
[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
blevans
 
Posts: 10
Joined: Mon Mar 23, 2015 3:40 pm

Re: CHANGE_SVC_EVENT_HANDLER External Command Failed

Postby blevans » Fri Mar 11, 2022 2:17 pm

Well here's the reason. Would have been nice if the error indicated what's going on!

https://github.com/NagiosEnterprises/na ... 3fc257a236

The following macros are disabled:
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
blevans
 
Posts: 10
Joined: Mon Mar 23, 2015 3:40 pm


Return to Community Support

Who is online

Users browsing this forum: No registered users and 26 guests