Hi,
First of all, i'm sorry for my bad English.
I would like to see on my MAP, the remaining space on my server's disks with SNMP.
I don't found the good OID on internet.
Can you help me ?
Here, a screen on my Probe :
Make a function called disk01test
if(array_size(oid_column("1.3.6.1.2.1.25.2.3.1.6",10,5)),round((oid("1.3.6.1.2.1.25.2.3.1.6.1",10,5)/oid("1.3.6.1.2.1.25.2.3.1.5.1",10,5))*100),"False")
Repeat the above for as many disks as you have, incrementing the names and oid values by one. Note Drive C is normally disk02.
disk02test
if(array_size(oid_column("1.3.6.1.2.1.25.2.3.1.6",10,5)),round((oid("1.3.6.1.2.1.25.2.3.1.6.2",10,5)/oid("1.3.6.1.2.1.25.2.3.1.5.2",10,5))*100),"False")
Create a probe DriveC
Available : disk02test()<>"False"
Error : if(disk02test()<>"False",if(disk02test() < 80, "", concatenate("Warning: Drive C = ", disk02test(), "%")), "Failed to read Drive C the server might be down")
Value : disk02test()
Unit %
So I did create the function for the % part and I have no error in it. Probe is also created with no error.Thanks to a number of people on this forum I have managed to finish a group of functions and probes to monitor disk free space both in MB and in % free for Windows Servers based on the drive letter rather than the disk number. I needed to do this as we monitor a number of servers with differing drive configurations and did not want to have to be specific as to which drive number was C: etc, rather just reference the drive by the drive letter.
These functions and probes can obviously be modified to look at whatever drive letter you want to just by changing the drive letter in the code.
Thanks again to the people who help put this together, you are awesome ! and I hope that this information can be of value to other users.
Please note that this is based on V3.1 of The Dude.
Functions
Function:
Name: win_diskc_free
Description: Disk C free space in megabytes
Code:
if(
string_find(oid_column("1.3.6.1.2.1.25.2.3.1.3",600),"C:")<>4294967295,
round(((oid(concatenate("iso.org.dod.internet.mgmt.mib-2.host.hrStorage.hrStorageTable.hrStorageEntry.hrStorageSize.",
array_find(oid_column("1.3.6.1.2.1.25.2.3.1.3",600),
string_substring(oid_column("1.3.6.1.2.1.25.2.3.1.3",600),
string_find(oid_column("1.3.6.1.2.1.25.2.3.1.3",600),"C:"),
(
string_find(oid_column("1.3.6.1.2.1.25.2.3.1.3",600),",",
string_find(oid_column("1.3.6.1.2.1.25.2.3.1.3",600),"C:"))
-string_find(oid_column("1.3.6.1.2.1.25.2.3.1.3",600),"C:"
)
)))+1))*4096)/1024)/1024)
-
round(((oid(concatenate("iso.org.dod.internet.mgmt.mib-2.host.hrStorage.hrStorageTable.hrStorageEntry.hrStorageUsed.",
array_find(oid_column("1.3.6.1.2.1.25.2.3.1.3",600),
string_substring(oid_column("1.3.6.1.2.1.25.2.3.1.3",600),
string_find(oid_column("1.3.6.1.2.1.25.2.3.1.3",600),"C:"),
(
string_find(oid_column("1.3.6.1.2.1.25.2.3.1.3",600),",",
string_find(oid_column("1.3.6.1.2.1.25.2.3.1.3",600),"C:"))
-string_find(oid_column("1.3.6.1.2.1.25.2.3.1.3",600),"C:"
)
)))+1))*4096)/1024)/1024)
,
""
)
Function:
Name: win_diskc_free_percent
Description: Disk C free space in percent
Code:
if(
string_find(oid_column("1.3.6.1.2.1.25.2.3.1.3",600),"C:")<>4294967295,
string_substring(((
oid(concatenate("iso.org.dod.internet.mgmt.mib-2.host.hrStorage.hrStorageTable.hrStorageEntry.hrStorageSize.",
array_find(oid_column("1.3.6.1.2.1.25.2.3.1.3",600),
string_substring(oid_column("1.3.6.1.2.1.25.2.3.1.3",600),
string_find(oid_column("1.3.6.1.2.1.25.2.3.1.3",600),"C:"),
(
string_find(oid_column("1.3.6.1.2.1.25.2.3.1.3",600),",",
string_find(oid_column("1.3.6.1.2.1.25.2.3.1.3",600),"C:"))
-string_find(oid_column("1.3.6.1.2.1.25.2.3.1.3",600),"C:"
)
)))+1))*4096
-
oid(concatenate("iso.org.dod.internet.mgmt.mib-2.host.hrStorage.hrStorageTable.hrStorageEntry.hrStorageUsed.",
array_find(oid_column("1.3.6.1.2.1.25.2.3.1.3",600),
string_substring(oid_column("1.3.6.1.2.1.25.2.3.1.3",600),
string_find(oid_column("1.3.6.1.2.1.25.2.3.1.3",600),"C:"),
(
string_find(oid_column("1.3.6.1.2.1.25.2.3.1.3",600),",",
string_find(oid_column("1.3.6.1.2.1.25.2.3.1.3",600),"C:"))
-string_find(oid_column("1.3.6.1.2.1.25.2.3.1.3",600),"C:"
)
)))+1))*4096
)
/
(
oid(concatenate("iso.org.dod.internet.mgmt.mib-2.host.hrStorage.hrStorageTable.hrStorageEntry.hrStorageSize.",
array_find(oid_column("1.3.6.1.2.1.25.2.3.1.3",600),
string_substring(oid_column("1.3.6.1.2.1.25.2.3.1.3",600),
string_find(oid_column("1.3.6.1.2.1.25.2.3.1.3",600),"C:"),
(
string_find(oid_column("1.3.6.1.2.1.25.2.3.1.3",600),",",
string_find(oid_column("1.3.6.1.2.1.25.2.3.1.3",600),"C:"))
-string_find(oid_column("1.3.6.1.2.1.25.2.3.1.3",600),"C:"
)
)))+1))*4096
))
*100
, 0, 4)
,
""
)
Probes
Probe Name: win_diskc_free
Available: if(win_diskc_free() > 500, 1, -1)
Error: if(win_diskc_free() < 500, concatenate("Low Disk Space C: ", win_diskc_free(), " MB Free"), "")
Value: win_diskc_free()
Unit: MB
Rate: None
Probe Name: win_diskc_free_percent
Available: if(win_diskc_free_percent() > 10, 1, -1)
Error: if(win_diskc_free_percent() < 10, concatenate("Low Disk Space C: ", win_diskc_free_percent(), " % Free"), "")
Value: win_diskc_free_percent()
Unit: %
Rate: None
Regards
Paul