Page 1 of 2
Monitoring Buffer slots
Posted: Fri Apr 07, 2017 3:32 am
by Fred Kroeger
Hi - I've got a a lot of Passive checks coming into NagiosXI and just wanted to check that I had enough Buffer slots.
Appears that this monitor no longer works ?
Code: Select all
# /usr/local/nagios/libexec/check_nagios_performance.php ucb
OK - Current command buffer usage:USEDCMDBUF | Command_buffer_usage=USEDCMDBUF;;;
# /usr/local/nagios/libexec/check_nagios_performance.php hcb
OK - High command buffer usage:HIGHCMDBUF | High_command_buffer_usage=HIGHCMDBUF;;;
I checked the other metrics that we monitor with check_nagios_performance and it appears that it is only these two that are broken.
Also what is the default value for command_check_interval ? My entry is commented out in the nagios.cfg file, so I'm assuming that it has a default value.
regards... Fred
Re: Monitoring Buffer slots
Posted: Fri Apr 07, 2017 10:23 am
by mcapra
The "Used/High/Total Command Buffers" metric was removed with Nagios 4. Here's the commit in which that was done (I think):
https://github.com/NagiosEnterprises/na ... 703783392b
It was removed from nagiostats because the setting itself was deprecated with the release of Nagios Core 4. Some notes I found:
Code: Select all
/*** as is external_command_buffer_slots */
else if(!strcmp(variable, "external_command_buffer_slots"))
obsoleted_warning(variable, "All commands are always processed upon arrival");
Fred Kroeger wrote:Also what is the default value for command_check_interval ? My entry is commented out in the nagios.cfg file, so I'm assuming that it has a default value.
I think the default value is "process all the commands all the time". Adding any sort of positive value would simply stagger the execution of those external commands. That can be handy if your system often gets massive influxes of commands to process.
Re: Monitoring Buffer slots
Posted: Mon Apr 10, 2017 6:55 pm
by Fred Kroeger
Thanks for the info - I'll remove those monitors then.
So what constitutes "massive influxes of commands"? I have two Nagios Instances sending events to this one via Outbound transfers. Approx 425 hosts & 4700 services.
Is there some way of measuring how many external commands are being processed and if I do change the command_check_interval value that I'm not getting a backlog ?
Fred
Re: Monitoring Buffer slots
Posted: Tue Apr 11, 2017 10:27 am
by mcapra
Fred Kroeger wrote:So what constitutes "massive influxes of commands"?
It's all relative. I would say any number that noticeably causes XI to drag. The nice thing about passive checks is regardless of how many of them you are running through the external command file, it's almost always cheaper than having XI run a script and do a thing.
Fred Kroeger wrote:Is there some way of measuring how many external commands are being processed
nagiostats has the "External Commands Last 1/5/15 min: 0 / 0 / 0" metric that should be useful. You could probably write a bash script to check that and compare it to some thresholds.
Re: Monitoring Buffer slots
Posted: Tue Apr 11, 2017 6:43 pm
by Fred Kroeger
I've been running that External Command stat for a while and it's either broken or reporting something else.
Typically it's usually 0 , maybe peaking at a 4 during the day.
Code: Select all
# ./check_nagios_performance.php eco1
OK - External commands last 1mn:0 | External_command_last_1mn=0;;;
# ./check_nagios_performance.php eco5
OK - External commands last 5mn:0 | External_command_last_5mn=0;;;
With the amount of Passive Host/Service Checks , I would expect the External Command stat to be a lot higher
Code: Select all
# ./check_nagios_performance.php phc1
OK - Passive Checks Last 1mn:66; | Passive_Checks_1mn=66;;;
# ./check_nagios_performance.php phc5
OK - Passive Checks Last 5mn:394; | Passive_Checks_5mn=394;;;
Re: Monitoring Buffer slots
Posted: Wed Apr 12, 2017 10:11 am
by mcapra
It would depend on how the check results are being submit. If you're doing it via the cmd value in your request set to submitcheck, that gets written to the check_results_dir directly and bypasses the external commands.
Re: Monitoring Buffer slots
Posted: Thu Apr 13, 2017 12:47 am
by Fred Kroeger
All the passive checks are Outbound NRDP Transfers from two other Nagios servers - I just assumed that the NRDP API would insert the check results as external commands.
Re: Monitoring Buffer slots
Posted: Thu Apr 13, 2017 10:27 am
by tmcdonald
The NRDP API as I understand it can do either. For example, in my Nagduino library it works by using the
cmd=submitcmd parameter which does enter it in as an external command:
https://github.com/tmcnag/nagduino/blob ... pp#L43-L52
Specifically, the
PROCESS_SERVICE_CHECK_RESULT command:
http://old.nagios.org/developerinfo/ext ... and_id=114
Line 27,
/usr/local/nrdp/server/plugins/nagioscorecmd/nagioscorecmd.inc.php in your XI server:
Code: Select all
// Normal nagios external commands
case "submitcmd":
nagioscorecmd_submit_nagios_command(false);
break;
But it can also use
cmd=submitcheck which in this case uses the function
nrdp_write_check_output_to_cmd to write the check result to a file in the check results directory. Line 133 in
/usr/local/nrdp/server/plugins/nagioscorepassivecheck/nagioscorepassivecheck.inc.php is where the function begins, and it writes to
/usr/local/nagios/var/spool/checkresults by default.
Re: Monitoring Buffer slots
Posted: Mon Apr 17, 2017 7:00 pm
by Fred Kroeger
Thanks - so which is the better method considering that I am receiving 400+ host & 4700+ service passive checks every 5mins? I am using a RAMDisk.
Also , in which file is "cmd=* " defined ?
Re: Monitoring Buffer slots
Posted: Tue Apr 18, 2017 10:26 am
by mcapra
Fred Kroeger wrote:Thanks - so which is the better method considering that I am receiving 400+ host & 4700+ service passive checks every 5mins? I am using a RAMDisk.
Assuming the checkresults file is on the RAMDisk, the differences are negligible. If you take the RAMDisk out of the equation, the external commands file is probably better since it's a direct pipe to memory. We'd have to do some benchmarking to say for sure, though.
Also , in which file is "cmd=* " defined ?
It's buried in one of the NRDP server files. I've highlighted it here:
https://github.com/NagiosEnterprises/nr ... hp#L16-L36
As far as what the "external commands" themselves are:
https://old.nagios.org/developerinfo/ex ... ndlist.php