Monitor Directory (Folders) Size with NSClient++

Jorge Pañeda jlpaneda at sciodev.com
Thu Mar 8 17:02:29 CET 2012


Thank you Phil for your help. That was helpful. 
 
I didn’t find the GetFileSize command but I accomplish to make it work with the command CheckFileSize using the following syntax: 
 
alias_individual=CheckFileSize ShowAll MaxWarn=17G MaxCrit=20G "File:_Individual=d:\Network Shares\individual\*.*"
 
The only problem that I have now is that when I apply the syntax to my individual folder (d:\Network Shares\individual\*.*), nsclient++ service crash and stops working. But if I try to monitor a folder inside individual it works perfectly, I don’t know if it has something to do with the fact that my individual folder actual size is over 50GB, because I tried monitoring a folder inside individual directory with almost 20 GB of size and it worked perfectly. 
 
1.       Does CheckFileSize command has a limitation size to monitor? or maybe,  
2.       Could be that my individual folder had a lot of subfolders that also have subfolders and files?
3.       Also, Does CheckFileSize command has a directory depth level limitation?, Windows has a limitation on name lengths for the folders in the path, could be this limitation affecting? (I know some of the folders inside individual directory has a very deep directory structure)
 
Anyone who can help me figure out this? 
 
I almost forgot this is the Error logged in Event Viewer when NSClient++ crashes. 

 
Thanks in advance, 
 
Jorge L. Pañeda
 

 
Systems Administrator
Scio Consulting | IT & Infrastructure Dept.
Las Cañadas 501 Int. 230 Col. Tres Marías 
Morelia, Mich., México Tel. (443) 310-96-01 y (443) 310-96-02 ext. 402
U.S. Phone: 408 404 3897 Ext. 402
www.sciodev.com
 
From: Randal, Phil [mailto:phil.randal at hoopleltd.co.uk] 
Sent: miércoles, 07 de marzo de 2012 12:05 p.m.
To: Jorge Pañeda; Nagios Users List
Subject: RE: [Nagios-users] Monitor Directory (Folders) Size with NSClient++
 
GetFileSize works for me using backslashes and not forward slashes.
 
Try using “\” or “\\” instead of “/” in the path.
 
e.g. d:\\Network Shares\\individual\\*.*
 
This might be a bug in NSClient++ and/or its documentation.
 
Cheers,
 
Phil
 
-- 
Phil Randal
Infrastructure Engineer
Hoople Ltd | Thorn Office Centre | Hereford HR2 6JT
Tel: 01432 260415 | Email: phil.randal at hoopleltd.co.uk
 
From: Jorge Pañeda [mailto:jlpaneda at sciodev.com] 
Sent: 07 March 2012 16:49
To: 'Nagios Users List'
Subject: [Nagios-users] Monitor Directory (Folders) Size with NSClient++
 
Hello all, 
 
I’m using NSClient++ 0.3.9, nsca and passive checks to monitor my Windows server behind a firewall. In one of this servers I have  a folder that inside have many other folders and files, I want to monitor this folder and let Nagios send me a warning or critical notification when the size of this folder grows too much (Ex. Folder Size 50 GB, warning when is over 70 GB and critical when is over 80 GB). 
 
I tried to accomplish this using CheckFileSize and CheckDriveSize but not succeeded at all. 
 
When I use CheckFileSize like this: 
 
alias_individual=CheckFileSize ShowAll MaxWarn=60G MaxCrit=70G "File:_Individual=d:/Network Shares/individual/*.*"
 
I got that the result is ok but 0 Bytes. I even got the same result if I eliminate the *.* at the end of the path. 
 

 
When CheckDriveSize is used:
 
alias_individual=CheckDriveSize MaxWarn=60G MaxCrit=70G ShowAll=long "Drive=\\servername\\individual"
 
I got the size but this size is the size of all the Hard Disk and not the size of the folder. 
 
Hope you can help me to solve this issue or give any ideas to accomplish the monitoring of size folders. 
 
Thanks in advance. 
 
Jorge L. Pañeda
 

 
Systems Administrator
Scio Consulting | IT & Infrastructure Dept.
Las Cañadas 501 Int. 230 Col. Tres Marías 
Morelia, Mich., México Tel. (443) 310-96-01 y (443) 310-96-02 ext. 402
U.S. Phone: 408 404 3897 Ext. 402
www.sciodev.com
 
“Any opinion expressed in this e-mail or any attached files are those of the individual and not necessarily those of Hoople Ltd. You should be aware that Hoople Ltd. monitors its email service. This e-mail and any attached files are confidential and intended solely for the use of the addressee. This communication may contain material protected by law from being passed on. If you are not the intended recipient and have received this e-mail in error, you are advised that any use, dissemination, forwarding, printing or copying of this e-mail is strictly prohibited. If you have received this e-mail in error please contact the sender immediately and destroy all copies of it. 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.monitoring-lists.org/archive/users/attachments/20120308/67a00350/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image003.png
Type: image/png
Size: 6453 bytes
Desc: not available
URL: <https://www.monitoring-lists.org/archive/users/attachments/20120308/67a00350/attachment.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image002.png
Type: image/png
Size: 12915 bytes
Desc: not available
URL: <https://www.monitoring-lists.org/archive/users/attachments/20120308/67a00350/attachment-0001.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.jpg
Type: image/jpeg
Size: 3466 bytes
Desc: not available
URL: <https://www.monitoring-lists.org/archive/users/attachments/20120308/67a00350/attachment.jpg>
-------------- next part --------------
------------------------------------------------------------------------------
Virtualization & Cloud Management Using Capacity Planning
Cloud computing makes use of virtualization - but cloud computing 
also focuses on allowing computing to be delivered as a service.
http://www.accelacomm.com/jaw/sfnl/114/51521223/
-------------- 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