Running the same plugin once vs. multiple times

Matthew Jurgens nagiosusers at edcint.co.nz
Mon Oct 8 00:20:59 CEST 2012


On 3/10/2012 7:02 AM, Tech Support wrote:
>
> All;
>
>     I wrote a plugin to collect data for a particular service. I 
> invoke the plugin with whatever parameter I want to return information 
> on.  In fact, it collects information on about 30 different params at 
> once, then returns the data that I specified.  For example, 
> ./get_sysinfo -p param1 or ./get_sysinfo -p param2, etc. It seems to 
> me to be a waste of resources to call the same script 30 times. Is it 
> possible to call the plugin once and return all the data (including 
> the performance data) at the same time? The benefit that I have 
> calling the same script 30 different times is that Nagiosgraph creates 
> a separate graph for each parameter and I don't want to lose that 
> ability. Any insight at all would be greatly appreciated.
>
> Thanks;
>
> John V.
>
>
Yes you can pass all data including performance data back in one call.
Here's an example output from check_wmi_plus

Plugin data:
Overall Status - OK (Sample Period 300 sec) - Logical Drive Name="C:" 
(OK) - _PercentIdleTime=99%, _PercentBusyTime=1%, _PercentDiskTime=1%, 
_PercentDiskReadTime=0%, _PercentDiskWriteTime=1%, 
_DiskReadBytesPersec=0B/sec, _DiskReadsPersec=0/sec, 
_DiskWriteBytesPersec=51.6KB/sec, _DiskWritesPersec=3/sec, 
CurrentDiskQueueLength=0, _AvgDiskQueueLength=0.0, 
_AvgDiskReadQueueLength=0.0, _AvgDiskWriteQueueLength=0.0

Performance Data:
'_PercentIdleTimeC:'=99; '_PercentBusyTimeC:'=1; '_PercentDiskTimeC:'=1; 
'_PercentDiskReadTimeC:'=0; '_PercentDiskWriteTimeC:'=1; 
'_DiskReadBytesPersecC:'=0; '_DiskReadsPersecC:'=0; 
'_DiskWriteBytesPersecC:'=52838; '_DiskWritesPersecC:'=3; 
'CurrentDiskQueueLengthC:'=0; '_AvgDiskQueueLengthC:'=0.0; 
'_AvgDiskReadQueueLengthC:'=0.0; '_AvgDiskWriteQueueLengthC:'=0.0;

You just need to make sure all the field names (for perf data) are 
different. Something like PNP4Nagios will draw multiple graphs using 
output like that.

If you didn't like returning it all at once you could:
- You could rewrite the plugin to be run on a cron schedule. When it is 
run, collect all 30 bits of information and pass the data to Nagios as 
passive results to 30 different services.
- You could rewrite the plugin to check multiple parameters at once eg 
10 and then pass all 10 back to Nagios as an active plugin. Then just 
call it 3 times (making it parameter driven to return group1 data, 
group2 data group3 data etc)



-- 
Smartmon System Monitoring <http://www.smartmon.com.au>
www.smartmon.com.au <http://www.smartmon.com.au>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.monitoring-lists.org/archive/users/attachments/20121008/006c59ea/attachment.html>
-------------- next part --------------
------------------------------------------------------------------------------
Don't let slow site performance ruin your business. Deploy New Relic APM
Deploy New Relic app performance management and know exactly
what is happening inside your Ruby, Python, PHP, Java, and .NET app
Try New Relic at no cost today and get our sweet Data Nerd shirt too!
http://p.sf.net/sfu/newrelic-dev2dev
-------------- next part --------------
_______________________________________________
Nagios-users mailing list
Nagios-users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue. 
::: Messages without supporting info will risk being sent to /dev/null


More information about the Users mailing list