Page 1 of 1

How to filter check output

Posted: Wed Feb 01, 2012 5:46 am
by fao
Hi,
We are using CheckDriveSize command through check_nrpe to query the available disk space on local drives of Windows servers. This returns a very long output (see below) and we need to read all the line to discover which specific disk triggered the alert. Is there an option to limit the output only to that disk where the error is?
Thanks.


CRITICAL: C:\: 10.5G, D:\: 14G, E:\: 40.2G, F:\: 21.5G, G:\: 58G, H:\: Total: 104G - Used: 104G (100%) - Free: 0B (0%) < critical, I:\: 35.7G, J:\: 22G, K:\: Total: 104G - Used: 104G (100%) - Free: 0B (0%) < critical, L:\: 61.8G, M:\: 88.8G, N:\: 27.8G

Re: How to filter check output

Posted: Wed Feb 01, 2012 10:21 am
by scottwilkerson
By default the NSClient++ CheckDriveSize checks all drives in one check, but it doesn't have to be this way.

The NSClient++ CheckDriveSize command has options you can change, if you add the Drive parameter you can make a check for each drive
The documentation is here
http://nsclient.org/nscp/wiki/CheckDriveSize

Re: How to filter check output

Posted: Wed Feb 01, 2012 10:30 am
by fao
Thanks, but I don't want to configure a service scheck for each disk separately and this will be additional work since all the servers don't have the same number of drives.
I will be happy if something like "--errors-only" can exist like with the check_disk command to return only the culprit.

Re: How to filter check output

Posted: Wed Feb 01, 2012 11:31 am
by lmiltchev
I am not sure if this could be done... it has to be done on the client site and maybe the NSClient++ support forum is a good place to start with.

http://www.nsclient.org/nscp/