Hello,
Working a bit with check_mk agent lately and I was wondering if there is some way to do similar things with Nagios XI. If it would be possible to provide perfdata to several services with one plugin check, this would save a lot of resources for the Nagios server and for the monitored server. Has anyone tried this yet? I'm guessing for something like this to work, the Nagios XI server, the plugin and the used agent, as NSClient would have to be able to do this.
Would something like the above be realistic to work to or to make a feature request for?
Maybe if I could send perfdata from a Powershell script as a trap or so to a passive service. Can passive services handle perfdata?
I just have the feeling sometimes Nagios XI makes too many checks, something like the above could save some valuable resources no?
Grtz
Willem
Providing perfdata to several services with one plugin check
Re: Providing perfdata to several services with one plugin c
This is not really possible with active checks unless you made a wrapper script to run multiple checks at once.
If you are using passives, this point is mostly moot, as most of the load is on the remote system.
One other question, are you only interested in reducing the load from perfdata, or from all checks and status data?
If you are using passives, this point is mostly moot, as most of the load is on the remote system.
One other question, are you only interested in reducing the load from perfdata, or from all checks and status data?
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
-
sreinhardt
- -fno-stack-protector
- Posts: 4366
- Joined: Mon Nov 19, 2012 12:10 pm
Re: Providing perfdata to several services with one plugin c
I don't know of anything else quite like check_mk, but I believe with your thinking, you could likely do somewhat similar things. I have not looked into any numbers, but why do you feel that check_mk is so much better on resources? Does it not still perform the same checks and same number of checks, just allows returning in a singular fashion instead of multiple returns?
You can certainly put in a feature request, but I don't see it coming for a long ways out, just thinking about the core developers current workload. Also, it's kind of already there with nsca submissions separated by control characters, and check result reaping that nagios can do, just not from a network or web interface presently.
This is actually a pretty good idea! You could leverage this so that either the powershell sends multiple traps that are interpreted as individual checks, but run from a single script. Alternatively, you could submit a specially formatted trap that you modify the output of snmptraphandling.py to spit out as multiple individual check results, or a single correctly formatted check result file with all your results. As I mentioned above, I'd suggest looking into how the actual check result files are reaped and what is legal within them, you may be able to do this with everything that is already written.
You can certainly put in a feature request, but I don't see it coming for a long ways out, just thinking about the core developers current workload. Also, it's kind of already there with nsca submissions separated by control characters, and check result reaping that nagios can do, just not from a network or web interface presently.
This is actually a pretty good idea! You could leverage this so that either the powershell sends multiple traps that are interpreted as individual checks, but run from a single script. Alternatively, you could submit a specially formatted trap that you modify the output of snmptraphandling.py to spit out as multiple individual check results, or a single correctly formatted check result file with all your results. As I mentioned above, I'd suggest looking into how the actual check result files are reaped and what is legal within them, you may be able to do this with everything that is already written.
Nagios-Plugins maintainer exclusively, unless you have other C language bugs with open-source nagios projects, then I am happy to help! Please pm or use other communication to alert me to issues as I no longer track the forum.
Re: Providing perfdata to several services with one plugin c
Andy, Spenser
Where I would want to go was a situation similar to this. At the moment I have different Powershell plugins. Some of them gather disk load information, some network information, some other performance counters, for example on Exchage / SQL servers. Gathering performance counters over x samples from Windows perfmon with Powershell is very simple, just fill up an array, eg $PfcValues with all the performance counters you want to gather, then execute:
So the load for 4 performance counters, is almost identically to the load of 20 or more performance counters. If I have to execute one Powershell script for each set of counters, the load would be greater? I must say I did not test the difference in load in detail, but I would suspect there would be a difference.
I just not want to send all this information to one service, but to several services, one for each type of information. Maybe I could use send_nsca wit Powershell, but would I be able to send to different services? Does send_nsca.exe work with Nagios XI? http://exchange.nagios.org/directory/Ad ... nt/details
I'm interested in keeping load as low as possible on both the Nagios server as the monitored host, but gathering as much as possible information from the Windows host.
Even better would if I could get-counter $PerfCounterArray -computername from a WIndows gateway. That way the majority of the load would be on the gateway server. If this gateway server would gather the info in bulk and then send it to Nagios to different hosts and services...
Anyway it's just some thoughts I had this weekend. I'm not sure if I want to invest time in something like this. That's why I wanted to discuss this with you guys first..
Grtz
Willem
Where I would want to go was a situation similar to this. At the moment I have different Powershell plugins. Some of them gather disk load information, some network information, some other performance counters, for example on Exchage / SQL servers. Gathering performance counters over x samples from Windows perfmon with Powershell is very simple, just fill up an array, eg $PfcValues with all the performance counters you want to gather, then execute:
Code: Select all
$PfcValues = (Get-Counter $PerfCounterArray -MaxSamples $DiskStruct.MaxSamples)I just not want to send all this information to one service, but to several services, one for each type of information. Maybe I could use send_nsca wit Powershell, but would I be able to send to different services? Does send_nsca.exe work with Nagios XI? http://exchange.nagios.org/directory/Ad ... nt/details
I'm interested in keeping load as low as possible on both the Nagios server as the monitored host, but gathering as much as possible information from the Windows host.
Even better would if I could get-counter $PerfCounterArray -computername from a WIndows gateway. That way the majority of the load would be on the gateway server. If this gateway server would gather the info in bulk and then send it to Nagios to different hosts and services...
Anyway it's just some thoughts I had this weekend. I'm not sure if I want to invest time in something like this. That's why I wanted to discuss this with you guys first..
Grtz
Willem
Nagios XI 5.8.1
https://outsideit.net
https://outsideit.net
Re: Providing perfdata to several services with one plugin c
Currently here is what I would do:
Run your PowerShell script once and have it check many things in an array. Then have it call send_nsca for each item in the array using the syntax outlined on this page:
http://manpages.ubuntu.com/manpages/har ... sca.1.html
It should be the same for the Windows send_nsca binary if they did it right. Each will come in as a passive result with perfdata included. The load on the Nagios system is minimal, and the load on the Windows system is as low as you can optimize within your script.
Run your PowerShell script once and have it check many things in an array. Then have it call send_nsca for each item in the array using the syntax outlined on this page:
http://manpages.ubuntu.com/manpages/har ... sca.1.html
It should be the same for the Windows send_nsca binary if they did it right. Each will come in as a passive result with perfdata included. The load on the Nagios system is minimal, and the load on the Windows system is as low as you can optimize within your script.
Former Nagios employee
Re: Providing perfdata to several services with one plugin c
Thanks Trevor, you confirmed what I was thinking. Now just find some time to work it out.. 
Nagios XI 5.8.1
https://outsideit.net
https://outsideit.net
Re: Providing perfdata to several services with one plugin c
That, unfortunately, I can't help with :)
Are we free to lock this up?
Are we free to lock this up?
Former Nagios employee
Re: Providing perfdata to several services with one plugin c
Sure. Thanks all.
Nagios XI 5.8.1
https://outsideit.net
https://outsideit.net