Page 1 of 1

NCPA Service Monitoring/Disk I/O

Posted: Thu Dec 04, 2014 11:08 am
by AMacintosh
We are in a situation where we have installed 100+ NCPA agents on Windows 2008 servers. We now are required to monitor Disk I/O and Windows Services(for Up/Down). Is this functionality available with NCPA or are we looking at uninstalling NCPA and going with NSClient+?

Thanks,

Re: NCPA Service Monitoring/Disk I/O

Posted: Thu Dec 04, 2014 1:08 pm
by lmiltchev
You can use a powershell script to query the Windows Performance counter, and call the script with NCPA. Here's a couple of links that can get you started:

https://github.com/sreinhardt/Nagios_Pe ... e_Counters

http://assets.nagios.com/downloads/ncpa/docs/html/

You can monitor services with NCPA. You can specify which services you would like to monitor in Step 3 of the wizard...
example01.PNG

Re: NCPA Service Monitoring/Disk I/O

Posted: Thu Dec 04, 2014 1:30 pm
by AMacintosh
Thank You. How about log file monitoring?

Re: NCPA Service Monitoring/Disk I/O

Posted: Thu Dec 04, 2014 1:43 pm
by WillemDH
Or you could also use http://exchange.nagios.org/directory/Pl ... ad/details

But I did not test it with NCPA, so I can't promise it will work. Can someone from Nagios support tell if NCPA can execute custom PS scripts?

It monitors 8 disk load related performance counters in one script. :) More info here: http://outsideit.net/check_ms_win_disk_load/ resulting in one graph that has all the info you need related to disk load, such as read / write queue, read/write latency, Nr of reads/writes, read/write rate.

Grtz

Re: NCPA Service Monitoring/Disk I/O

Posted: Thu Dec 04, 2014 3:33 pm
by lmiltchev
But I did not test it with NCPA, so I can't promise it will work. Can someone from Nagios support tell if NCPA can execute custom PS scripts?
It can... kind of... :) I just tested your script and here's what I see in the web UI:

Code: Select all

{
  "value": {
    "returncode": 0, 
    "stdout": "OK: Drive C: Avg of 2 samples: {Rate (Read: 15.55193MB/s)(Write: 0.26591MB/s)} {Avg Nr of (Reads: 256.00892r/s)(Writes: 256.00892w/s)} {Latency (Read: 4.20664us)(Write: 0.26130us)} {Queue Length (Read: 1.04959ql)(Write: 1.04959ql)} | 'Read_Latency'=4.20664us 'Write_Latency'=0.26130us 'Read_Queue'=1.04959ql 'Write_Queue'=0.00647ql 'Nnumber_of_Reads'=256.00892r/s 'Number_of_Writes'=22.21626w/s 'Read_Rate'=15.55193MB/s 'Write_Rate'=0.26591MB/s"
  }
}
In order to make this work I had to modify one line in the "ncpa.cfg" to look like this:

Code: Select all

.ps1 = powershell -ExecutionPolicy Bypass -File $plugin_name $plugin_args
I had an issue with running the command from the CLI.

Code: Select all

[root@testbox libexec]# ./check_ncpa.py -H 192.168.x.x -t token -M agent/plugin/check_ms_disk_load.ps1
Unable to run check on non-child node. Revise your query.
Our developers are looking into this as we speak. I hope this will be resolved soon.

Re: NCPA Service Monitoring/Disk I/O

Posted: Thu Dec 04, 2014 3:58 pm
by lmiltchev
Never mind. I mistyped the plugin's name. :oops:

It works just fine from the CLI:

Code: Select all

[root@testbox libexec]# ./check_ncpa.py -H 192.168.x.x -t token -M agent/plugin/check_ms_win_disk_load.ps1
OK: Drive C: Avg of 2 samples: {Rate (Read: 0.17719MB/s)(Write: 0.77577MB/s)} {Avg Nr of (Reads: 1.97220r/s)(Writes: 1.97220w/s)} {Latency (Read: 5.52499us)(Write: 0.69768us)} {Queue Length (Read: 0.02179ql)(Write: 0.02179ql)} | 'Read_Latency'=5.52499us 'Write_Latency'=0.69768us 'Read_Queue'=0.02179ql 'Write_Queue'=0.01316ql 'Nnumber_of_Reads'=1.97220r/s 'Number_of_Writes'=18.80838w/s 'Read_Rate'=0.17719MB/s 'Write_Rate'=0.77577MB/s

Re: NCPA Service Monitoring/Disk I/O

Posted: Thu Dec 04, 2014 4:54 pm
by WillemDH
Good to know it works with NCPA too. If I find some time one day I'll update my documentation with this information.

Grtz

Re: NCPA Service Monitoring/Disk I/O

Posted: Thu Dec 04, 2014 5:18 pm
by sreinhardt
One would hope it should, but agreed always nice to have confirmation!