Monitoring Buffer slots

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Fred Kroeger
Posts: 588
Joined: Wed Oct 19, 2011 11:36 pm
Location: Perth, Western Australia
Contact:

Monitoring Buffer slots

Post 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.

Code: Select all

#command_check_interval=-1
regards... Fred
User avatar
mcapra
Posts: 3739
Joined: Thu May 05, 2016 3:54 pm

Re: Monitoring Buffer slots

Post 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.
Former Nagios employee
https://www.mcapra.com/
Fred Kroeger
Posts: 588
Joined: Wed Oct 19, 2011 11:36 pm
Location: Perth, Western Australia
Contact:

Re: Monitoring Buffer slots

Post 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
User avatar
mcapra
Posts: 3739
Joined: Thu May 05, 2016 3:54 pm

Re: Monitoring Buffer slots

Post 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.
Former Nagios employee
https://www.mcapra.com/
Fred Kroeger
Posts: 588
Joined: Wed Oct 19, 2011 11:36 pm
Location: Perth, Western Australia
Contact:

Re: Monitoring Buffer slots

Post 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;;;
User avatar
mcapra
Posts: 3739
Joined: Thu May 05, 2016 3:54 pm

Re: Monitoring Buffer slots

Post 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.
Former Nagios employee
https://www.mcapra.com/
Fred Kroeger
Posts: 588
Joined: Wed Oct 19, 2011 11:36 pm
Location: Perth, Western Australia
Contact:

Re: Monitoring Buffer slots

Post 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.
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: Monitoring Buffer slots

Post 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.
Former Nagios employee
Fred Kroeger
Posts: 588
Joined: Wed Oct 19, 2011 11:36 pm
Location: Perth, Western Australia
Contact:

Re: Monitoring Buffer slots

Post 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 ?
User avatar
mcapra
Posts: 3739
Joined: Thu May 05, 2016 3:54 pm

Re: Monitoring Buffer slots

Post 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
Former Nagios employee
https://www.mcapra.com/
Locked