Page 2 of 3

Re: SNMP OID Query for Windows Partition

Posted: Wed Aug 22, 2012 2:31 pm
by yancy
I only see 14 possible drives, all of which have drive letters except Virtual Memory and Physical memory.

Your best bet is either NSClient or since this is a windows machine WMI.

Regards,

-Yancy

Re: SNMP OID Query for Windows Partition

Posted: Thu Aug 23, 2012 6:33 am
by cccbbb
The issue is M$ list these partitions under disk instance not storage in snmp?
INFORMANT-STD 1.3.6.1.4.1.9600.1.1.1.1.1.13.69.58.92.76.111.103.115.92.76.79.71.83.51 lDiskInstance.13.69.58.92.76.111.103.115.92.76.79.71.83.51 E:\Logs\LOGS3

Re: SNMP OID Query for Windows Partition

Posted: Thu Aug 23, 2012 6:44 am
by cccbbb
Thanks Yancy can you recommend a plugin for this query? Wmi or point to the right direction for the Docs on NSClient ++ running a query of this sort.
I just need to monitor the disk space....how I get that accomplished doesnt really matter to me.

Re: SNMP OID Query for Windows Partition

Posted: Thu Aug 23, 2012 11:49 am
by yancy
As I mentioned previosly,

you could add this to NSClient++ ini file for example (you'll want to enable NRPE on NSClient and add check_external_scripts.dll to NSClient ini file)

for example:

Code: Select all

alias_individual=CheckFileSize ShowAll MaxWarn=17G MaxCrit=20G "File:_Individual="E:\Database\TempStore*.*"
This would allow you to check the folder size recursively of E:\Database\TempStore. Use check_nrpe from the nagios to run this check.

Another option is WMI, which you could do without installing an agent such as NSClient++. Crack open powershell, and test if WMI will list your volume

Code: Select all

 Get-WmiObject -Query "select * from Win32_LogicalDisk" 
lastly, have you tried check_snmp using OID = lDiskInstance.13.69.58.92.76.111.103.115.92.76.79.71.83.51

for example:

Code: Select all

./check_snmp -H <your ip> -C public -v 2c -o  lDiskInstance.13.69.58.92.76.111.103.115.92.76.79.71.83.51

Regards,

-Yancy

Re: SNMP OID Query for Windows Partition

Posted: Fri Aug 24, 2012 8:29 am
by cccbbb
Thanks the WMI query works but how would I integrate this into a nagios plugin or script? Sorry I have written Nagios plugins and
have only made minor modifications to exiting scripts. I also havent ever used a WMI plugin.

Re: SNMP OID Query for Windows Partition

Posted: Fri Aug 24, 2012 9:56 am
by yancy
cccb,

To setup WMI query on Nagios, there are two components needed.

-WMIC needs to be installed ( this will return a WMI query on the local machine)
-Check_WMI_Plus which parsese the output returned from WMIC into a Nagios check

Here's an example of running WMIC from your linux command line.
./wmic -U administrator%password //<your ip> "select * from Win32_Volume"

We have an automated install script for WMIC for NagiosXI here:
http://assets.nagios.com/downloads/nagi ... install.py

check_WMI_Plus can be found here:
http://www.edcint.co.nz/checkwmiplus/

here are some example checks
http://www.edcint.co.nz/checkwmiplus/?q ... mmandlines

You may need to define a cusom check with check_wmi_plus which I can help with if you go that route.

Your other option is to create a powershell or vbscript to run on the client side in concert with NSClient++ or NRDS_Win which I can also help with.

Re: SNMP OID Query for Windows Partition

Posted: Fri Aug 24, 2012 10:03 am
by cccbbb
How would you determine disk space sizes. They are included in the data returned but I am not a programer?
__GENUS : 2
__CLASS : Win32_Volume
__SUPERCLASS : CIM_StorageVolume
__DYNASTY : CIM_ManagedSystemElement
__RELPATH : Win32_Volume.DeviceID="\\\\?\\Volume{b1ba57ba-4a3b-11e1-90f3-005056a3001a}\\"
__PROPERTY_COUNT : 44
__DERIVATION : {CIM_StorageVolume, CIM_StorageExtent, CIM_LogicalDevice, CIM_LogicalElement, CIM_Manage
dSystemElement}
__SERVER : DAG2
__NAMESPACE : root\cimv2
__PATH : \\DAG2\root\cimv2:Win32_Volume.DeviceID="\\\\?\\Volume{b1ba57ba-4a3b-11e1-90f3-0
05056a3001a}\\"
Access :
Automount : True
Availability :
BlockSize : 65536
BootVolume : False
Capacity : 397281263616
Caption : E:\Database\DB6\
Compressed : False
ConfigManagerErrorCode :
ConfigManagerUserConfig :
CreationClassName :
Description :
DeviceID : \\?\Volume{b1ba57ba-4a3b-11e1-90f3-005056a3001a}\
DirtyBitSet :
DriveLetter :
DriveType : 3
ErrorCleared :
ErrorDescription :
ErrorMethodology :
FileSystem : NTFS
FreeSpace : 153496125440
IndexingEnabled : True
InstallDate :
Label : DB6-S
LastErrorCode :
MaximumFileNameLength : 255
Name : E:\Database\DB6\
NumberOfBlocks :
PageFilePresent : False
PNPDeviceID :
PowerManagementCapabilities :
PowerManagementSupported :
Purpose :
QuotasEnabled :
QuotasIncomplete :
QuotasRebuilding :
SerialNumber : 2558053893
Status :
StatusInfo :
SupportsDiskQuotas : True
SupportsFileBasedCompression : False
SystemCreationClassName :
SystemName : DAG2
SystemVolume : False

Re: SNMP OID Query for Windows Partition

Posted: Fri Aug 24, 2012 10:04 am
by cccbbb
Thanks I will work on this

Re: SNMP OID Query for Windows Partition

Posted: Tue Aug 28, 2012 6:03 am
by cccbbb
I had some issue with compiling/installing because this is a Opensuse 10.3 box but I worked around them.
Now I get this error
using wmic
/usr/local/bin/wmic -U domain\usernbame%password //10.x.x.x "select* from Win32_Volume"

NTSTATUS: NT code 0x80041017 - NT code 0x80041017
I am checking but the answers are kind of murky....

using the check_wmi_plus.pl script I get this

./check_wmi_plus.pl -U domain\username%password //10.x.x.x "select* from Win32_Volume"

Can't locate Number/Format.pm in @INC (@INC contains: /usr/lib/nagios/plugins /usr/lib/perl5/5.8.8/x86_64-linux-thread-multi /usr/lib/perl5/5.8.8 /usr/lib/perl5/site_perl/5.8.8/x86_64-linux-thread-multi /usr/lib/perl5/site_perl/5.8.8 /usr/lib/perl5/site_perl /usr/lib/perl5/vendor_perl/5.8.8/x86_64-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.8 /usr/lib/perl5/vendor_perl .) at ./check_wmi_plus.pl line 52.
BEGIN failed--compilation aborted at ./check_wmi_plus.pl line 52.

Re: SNMP OID Query for Windows Partition

Posted: Tue Aug 28, 2012 9:29 am
by yancy
It looks like your missing perl-TimeDate module. You can use either cpan or possibly zypper to install it.


Regards,

-Yancy