ADAPTIVE CHECK CHANGE_SVC_CHECK_COMMAND

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
javier.garces
Posts: 3
Joined: Fri Dec 28, 2012 3:05 am

ADAPTIVE CHECK CHANGE_SVC_CHECK_COMMAND

Post by javier.garces »

Hello
I would like to use the external command change_svc_check_command to change dicamically the warning and critical values of the checks
However it doesn´t work
I think the cause that it doesn't work is the modification introduced in the version 3.0.6 (Disabled adaptive check and eventhandler commands for security reasons ) as you can see in the URL:

http://www.nagios.org/projects/nagiosco ... ry/core-3x

I’m using the 3.2.1 version.
In this version and also in the latest version 3.4.3, I can see the next source code in the base/commands.c file

/* SECURITY PATCH - disable these for the time being */
switch(cmd) {
case CMD_CHANGE_GLOBAL_HOST_EVENT_HANDLER:
case CMD_CHANGE_GLOBAL_SVC_EVENT_HANDLER:
case CMD_CHANGE_HOST_EVENT_HANDLER:
case CMD_CHANGE_SVC_EVENT_HANDLER:
case CMD_CHANGE_HOST_CHECK_COMMAND:
case CMD_CHANGE_SVC_CHECK_COMMAND:
return ERROR;
}

I guess if I delete the above code, the external command change_svc_check_command will work

Is not recommended to enable these external command?
Why was it disabled in the version 3.0.6? This is not resolved in the latest version?
I haven´t found any offical documentation about this

Thanks
yancy
Posts: 523
Joined: Thu Oct 06, 2011 10:12 am

Re: ADAPTIVE CHECK CHANGE_SVC_CHECK_COMMAND

Post by yancy »

Hi javier.garces,

Have you tried restarting nagios after applying the command?

the only documentation i've seen so far is here:
http://old.nagios.org/developerinfo/ext ... and_id=108

Regards,

-Yancy
javier.garces
Posts: 3
Joined: Fri Dec 28, 2012 3:05 am

Re: ADAPTIVE CHECK CHANGE_SVC_CHECK_COMMAND

Post by javier.garces »

Hello Yancy
The command check that I want to use ( nrpe_CheckCPU ) it was already configured and working in nagios:

define service{
use generic-service,srv-pnp
host_name lgpx11
service_description CPU_Load_NRPE
check_command nrpe_CheckCPU!80!90
contacts contact1,contatc2
}


define command {
command_name nrpe_CheckCPU
command_line /opt/nagios/libexec/check_nrpe -t 60 -H $HOSTADDRESS$ -p 5666 -c CheckCPU -a warn=$ARG1$ crit=$ARG2$ time=20m time=10s time=4
}




I want to change dynamically the warning and critical values
I'm using this command to change the 80 and 90 values by 0 and 1 respectively but it doesn't work, it doesn't anything:

printf '[%lu] CHANGE_SVC_CHECK_COMMAND;lgpx11;CPU_Load_NRPE;nrpe_CheckCPU!0!1\n' `date +"%s"` > /dev/shm/nagios.cmd

I've tested a different external command: CHANGE_SVC_NOTIFICATION_TIMEPERIOD and it works, so I think that the
CHANGE_SVC_CHECK_COMMAND is disabled

Thanks
User avatar
jsmurphy
Posts: 989
Joined: Wed Aug 18, 2010 9:46 pm

Re: ADAPTIVE CHECK CHANGE_SVC_CHECK_COMMAND

Post by jsmurphy »

You would probably have to ask on the nagios development mailing list about this: https://lists.sourceforge.net/lists/lis ... gios-devel

The actual developers of Nagios core don't frequent this forum, if I had to take a wild stab in the dark as to why it was disabled... it would be either because:
a. It never worked in the first place.
or
b. It might have been a foundation change for Nagios v4.0 which is nearly 600 times more efficient but required significant stream lining of the internal processing and this may have been a casualty in that war.

At any rate I'm using my amazing powers of wild speculation and you would be better off asking the developers on the mailing list ;)
yancy
Posts: 523
Joined: Thu Oct 06, 2011 10:12 am

Re: ADAPTIVE CHECK CHANGE_SVC_CHECK_COMMAND

Post by yancy »

jsmurphy makes a good point that you may want to post to the devel-list on this one.

This feature looks to be abandoned, and i'm surprised there was/is the ability to update configurations without restarting Nagios.

Regards,

-Yancy
javier.garces
Posts: 3
Joined: Fri Dec 28, 2012 3:05 am

Re: ADAPTIVE CHECK CHANGE_SVC_CHECK_COMMAND

Post by javier.garces »

Thanks
I'll try to post the question to the devel-list
yancy
Posts: 523
Joined: Thu Oct 06, 2011 10:12 am

Re: ADAPTIVE CHECK CHANGE_SVC_CHECK_COMMAND

Post by yancy »

javier,

I would suggest posting to https://lists.sourceforge.net/lists/lis ... gios-users since this is not a dev question directly ( at least not yet)

-Yancy
Locked