Page 1 of 2
check_win_perfmon plugin configuraiton
Posted: Wed May 02, 2018 3:29 pm
by naranant
Team,
Need help with disk io for windows servers. I got the check_win_perfmon plugin from the exchange and did the test on the local server by executing the command and it works fine.
I need help in configuring this on nagios server to monitor the performance on target client . We have Nsclient++ installed on the target windows server so please provide me the steps.
I would need steps in defining this service in nagios. most of the documentation i got in the web were point to NCPA plugin but we are using Nsclient++ in our enviroment.
Thanks.
Re: check_win_perfmon plugin configuraiton
Posted: Thu May 03, 2018 9:58 am
by kyang
Hello,
I have never tried using this plugin, and the creator doesn't say how it works with NSClient++. This isn't a plugin created or maintained by us.
https://github.com/juangranados/check_win_perfmon
If you're looking to monitor Disk IO, does NSClient not work for you? You should be able to grab a list of counters using something like this from your Windows machine.
nscp sys -- --list Disk --all
Then set them correctly while using check_nt
Re: check_win_perfmon plugin configuraiton
Posted: Thu May 03, 2018 10:51 am
by naranant
@kyang : Could you give me more information or steps on how to add the performance counter using check_nt.
Also suggest the default plugin available from nagios to monitor the windows disk io along with complete documentation.
Regards..
Re: check_win_perfmon plugin configuraiton
Posted: Thu May 03, 2018 1:24 pm
by kyang
Try running this command from the XI terminal and let me know the output. (If you changed your hard drive letters, then change it in the command below as well)
Also, make sure to put in your windowsIP address and replace password with your password from the nsclient.ini file.
Code: Select all
/usr/local/nagios/libexec/check_nt -H windowsIP -p 12489 -s 'password' -v COUNTER -l "\\PhysicalDisk(0 C:)\\Avg. Disk Bytes//Write","Disk Write Time","MB" -w 1000 -c 500
Re: check_win_perfmon plugin configuraiton
Posted: Fri May 04, 2018 8:40 am
by naranant
This is the output I am receiving. Please let me know how do I incorporate this as service checks.. Was not very clear on how to add this using the configuration manager.
Disk Write Time = 0.00 MB | 'Disk Write Time'=0.000000MB;1000.000000;500.000000;
Re: check_win_perfmon plugin configuraiton
Posted: Fri May 04, 2018 9:18 am
by naranant
@kyang : I went ahead and tried the below steps in adding these performance counter by using the windows servers wizard and getting the error as shown in the attachment... The service check uses check_xi_service_nsclient and not check_nt.
Below is the command used in the nagios XI after adding the counter.
check_xi_service_nsclient!!COUNTER!-l "\\PhysicalDisk(0 C:)\\Avg. Disk Bytes//Write","MB" -w 1000 -c 500
Re: check_win_perfmon plugin configuraiton
Posted: Fri May 04, 2018 9:49 am
by kyang
I actually just wanted to see the output first.
Could you send me your list of counters?
On your Windows Machine that has nsclient++ installed follow these steps: (fill in your username)
1. Open the cmd.exe
Code: Select all
cd C:\Program Files\NSClient++
nscp sys -- --list Disk --all > "C:\Users\username\Desktop\nscp.txt"
2. Please post or PM me the nscp.txt file that is located on your desktop.
Adding counters in the wizard, can be shown in here with examples.
https://support.nagios.com/kb/article.php?id=127
https://support.nagios.com/kb/article.php?id=785
https://support.nagios.com/kb/article.php?id=779
Also, check_xi_service_nsclient is the template in which it uses check_nt
Re: check_win_perfmon plugin configuraiton
Posted: Fri May 04, 2018 10:26 am
by lmiltchev
I would like to add to what kyang said. The output you showed us:
Disk Write Time = 0.00 MB | 'Disk Write Time'=0.000000MB;1000.000000;500.000000;
indicates that the check is not working as expected (0.00 MB)... This may be because of some escaping issues or issues with check_nt and performance counters. In my experience, some performance counters are better checked via check_nrpe (instead of check_nt). There has been a push towards deprecating check_nt in general. Our wizard uses check_nt, so you won't be able to set up a check_nrpe service automatically (via the Windows Server wizard), however you could set up one manually.
Here's an example of a check that worked for me:
Code: Select all
/usr/local/nagios/libexec/check_nrpe -H x.x.x.x -c CheckCounter -a 'Counter:Disk Write Time=\PhysicalDisk(0 C:)\Avg. Disk Bytes/Write' ShowAll MinWarn=1000 MinCrit=500
Disk Write Time = 4915|'Disk Write Time'=4915;1000;500
If you don't want to use check_nrpe, you could try modifying your original (check_nt) command. Play with single/double quotes, and the use of backslash ("\") for escaping. You counter is:
Code: Select all
\PhysicalDisk(0 C:)\Avg. Disk Bytes/Write
so, if you use double quotes, I believe that it needs to be escaped as such:
Code: Select all
\\PhysicalDisk(0 C:)\\Avg. Disk Bytes\/Write
Or you can try using single quotes as such:
Code: Select all
/usr/local/nagios/libexec/check_nt -H windowsIP -p 12489 -s 'password' -v COUNTER -l '\PhysicalDisk(0 C:)\Avg. Disk Bytes/Write','Disk Write Time','MB' -w 1000 -c 500
Example:
Code: Select all
/usr/local/nagios/libexec/check_nt -H x.x.x.x -p 12489 -s 'password' -v COUNTER -l '\PhysicalDisk(0 C:)\Avg. Disk Bytes/Write', 'Disk Write Time','MB' -w 1000 -c 500
5546
For more information on monitoring performance counter in Nagios using NSClient++, please read our KB article on the topic here:
https://support.nagios.com/kb/article/n ... t-127.html
Re: check_win_perfmon plugin configuraiton
Posted: Fri May 04, 2018 12:36 pm
by naranant
Hello,
I was able to execute the below command and with the following output.
/usr/local/nagios/libexec/check_nt -H xx.xx.xx.xx -p 12489 -s '' -v COUNTER -l '\PhysicalDisk(0 C:)\Avg. Disk Bytes/Write','Disk Write Time','MB' -w 1000 -c 50
Disk Write Time = 12288.00 MB | 'Disk Write Time'=12288.000000MB;1000.000000;50.000000;
I am ok in using the nrpe but i couldn't execute the provided command was getting connection refused.
connect to address 1xx.xx.xx.x port 5666: Connection refused
Also, I couldn't execute the below command on the server as it couldn't recognize nscp
cd C:\Program Files\NSClient++
nscp sys -- --list Disk --all > "C:\Users\username\Desktop\nscp.txt"
Re: check_win_perfmon plugin configuraiton
Posted: Fri May 04, 2018 2:46 pm
by kyang
Hello,
Given the options of checks, are you looking to use
check_nt or
check_nrpe?
lmiltchev, has provided great examples, but I'm not sure if you wanted to use both or only one?
connect to address 1xx.xx.xx.x port 5666: Connection refused
This is leading into another issue in which its either your firewall or what you have for allowed hosts.
https://support.nagios.com/kb/article/n ... t-622.html