Setting up Probes to monitor Disk Usage

I am trying to figure out using a probe for HDD_USAGE. I have seen a previous post regarding this and it suggested doing the following:

Create a new probe:

Type: function
Available: if(hdd_usage()>0, 1, -1)
Error: if(hdd_usage()<90, “”, “Disk usage > 89%”)
Value: hdd_usage()
Unit: %
Rate: none

Note: this probe uses the built in hdd_usage function, so for devices with multiple hard disks it looks at the average disk space usage. Of course, the above example is easily adapted for a specific hard drive. Just replace ‘hdd_usage’ with the appropriate oid(“xxxxx”) call.

This has worked ok except it looks like the probes are still working for HDD average. I have created 3 separate probes for 3 different disks. I then replaced the HDD_USAGE parameter with the Value parameter for the hard drive e.g: ‘C:\ Label:Oracle Serial Number 47565f0’ this works ok except when I replace the HDD_USAGE parameter in the error section. When I do this I get a notification that says ‘(parse failed)’.

What exactly is it that I have to do?

I’m also having this problem I’m assuming i have to replace every instance of hdd_usage() with the specified oid (oid(“iso.1.3.6.1.2.1.25.2.3.1.6.2”)) in this case.
Do i have my syntax correct? I’m getting parse errors. What i want to do is set up probes for each disk, unless someone has a probe that will report if a disk reaches say, 70 or 75% on any single disk, rather than an average across all disks.
Cliff.

Hi all
I´d love to have your problem :slight_smile:

Because i´m unable to use correctly the hdd_usage…

Every times it says it´s ok, even when i change it to 10% or every other value…
I´m feeling dumb :S:S

In the graphic, it is always at 0…
[img=http://img221.imageshack.us/img221/8138/diskusageth4.th.jpg]

Can anyone help me?

I’m the ‘creator’ of the above suggested probe, so I guess I’ll help you further along :smiley:

You have to adjust the function that retrieves the specific disk’s relative usage. As a matter of fact, such an OID does not exist, but you can find OID’s for the absolute disk size and usage, so we can use those to calculate the relative usage (percent of disk space used). (I don’t know the units (sectors perhaps?) of those OID’s, but since we’re only interested in the percentage, not the actual bytes, that doesn’t matter.)

Perform an SNMP walk and look in the iso.org.dod.internet.mgmt.mib-2.host.hrStorage.hrStorageTable… neighborhood. You can find the proper drive’s name in the description part of that table. For example, in my case this piece of text will display the C-drive’s usage when pasted onto a device’s appearance label:

C-drive: [(oid("iso.org.dod.internet.mgmt.mib-2.host.hrStorage.hrStorageTable.hrStorageEntry.hrStorageUsed.1")/oid("iso.org.dod.internet.mgmt.mib-2.host.hrStorage.hrStorageTable.hrStorageEntry.hrStorageSize.1"))*100]%

Now simply replace the ‘hdd_usage()’ part in the above suggested probe with

(oid("iso.org.dod.internet.mgmt.mib-2.host.hrStorage.hrStorageTable.hrStorageEntry.hrStorageUsed.1")/oid("iso.org.dod.internet.mgmt.mib-2.host.hrStorage.hrStorageTable.hrStorageEntry.hrStorageSize.1"))*100

and you’ll have a probe triggers when the C-drive goes over 90% usage.

To make it really copy-paste :slight_smile:

Name: Disk C < 90% (cause the probe actually checks if the usage is lower than 90%: then it’s good :slight_smile:
Type: function
Available: if((oid(“iso.org.dod.internet.mgmt.mib-2.host.hrStorage.hrStorageTable.hrStorageEntry.hrStorageUsed.1”)/oid(“iso.org.dod.internet.mgmt.mib-2.host.hrStorage.hrStorageTable.hrStorageEntry.hrStorageSize.1”))*100>0, 1, -1)
Error: if((oid(“iso.org.dod.internet.mgmt.mib-2.host.hrStorage.hrStorageTable.hrStorageEntry.hrStorageUsed.1”)/oid(“iso.org.dod.internet.mgmt.mib-2.host.hrStorage.hrStorageTable.hrStorageEntry.hrStorageSize.1”))*100<90, “”, “Disk usage > 89%”)
Value: (oid(“iso.org.dod.internet.mgmt.mib-2.host.hrStorage.hrStorageTable.hrStorageEntry.hrStorageUsed.1”)/oid(“iso.org.dod.internet.mgmt.mib-2.host.hrStorage.hrStorageTable.hrStorageEntry.hrStorageSize.1”))*100
Unit: %
Rate: none

Tested and works! :sunglasses:

hi

partially useful :slight_smile:

I installed and configured snmp, now the probe doesn´t timeout everytime :open_mouth:
feeling nerd :confused: :smiley:

but your probe isnt universal…
i cant use it in an heterogeneus environment, in the “Available”, “Error” and “Value” I can submit only one oid, number 1,2,3, whathever… that can refer to diferent physical things, like a diskette or a cd drive, or a disk, …

oid(“iso.org.dod.internet.mgmt.mib-2.host.hrStorage.hrStorageTable.hrStorageEntry.hrStorageUsed.1” can refer in one server to the diskette drive and in other server to the C drive, do you see?

take a look here:

server 1:

As you can see in in hrStorageDescr, oid…1 is A:, oid…2 is C: and oid…3 is D:

and it changes in other machines, take a look at server 2:




but your ideia is correct, maybe we can develop it a bit in order to make it universal :wink:
tomorrow´s job :slight_smile:
any help appreciated


See you

Yes, I know, that’s why I wrote:

You can find the > proper drive’s name in the description part > of that table. For > example, in my case > this piece of text will display the C-drive’s usage when pasted onto a device’s appearance label:

There is no universal way, because the exact OID of a particular drive can change in any computer. Usually 'A:' will be ‘1’ and 'C:' perhaps ‘2’, but in a computer without 'A:' 'C:' may become ‘1’. It all depends on the computers disks.

That’s why you have to verify the description to see which drive actually is which number…

:smiley:

I make 1 2 3 4 5 disk partition monitor


######## Disk 1 - Disk space <90% monitored, 1 partition

Name:Disk 1 usage < 90%
Type:function

Available:if((oid(“1.3.6.1.2.1.25.2.3.1.6.1”)/oid(“1.3.6.1.2.1.25.2.3.1.5.1”))*100>0, 1, -1)

Error:if((oid(“1.3.6.1.2.1.25.2.3.1.6.1”)/oid(“1.3.6.1.2.1.25.2.3.1.5.1”))*100<90, “”, “Disk usage > 89%”)


Value:(oid(“1.3.6.1.2.1.25.2.3.1.6.1”)/oid(“1.3.6.1.2.1.25.2.3.1.5.1”))*100

Unit:%

Rate:none


####### Disk 2 - Disk space <90% monitored, 2 partition
Name:Disk 2 usage < 90%

Type:function

Available:if((oid(“1.3.6.1.2.1.25.2.3.1.6.2”)/oid(“1.3.6.1.2.1.25.2.3.1.5.2”))*100>0, 1, -1)

Error:if((oid(“1.3.6.1.2.1.25.2.3.1.6.2”)/oid(“1.3.6.1.2.1.25.2.3.1.5.2”))*100<90, “”, “Disk usage > 89%”)

Value:(oid(“1.3.6.1.2.1.25.2.3.1.6.2”)/oid(“1.3.6.1.2.1.25.2.3.1.5.2”))*100

Unit:%

Rate:none


####### Disk 3 - Disk space <90% monitored, 3 partition
Name:Disk 3 usage < 90%

Type:function

Available:if((oid(“1.3.6.1.2.1.25.2.3.1.6.3”)/oid(“1.3.6.1.2.1.25.2.3.1.5.3”))*100>0, 1, -1)

Error:if((oid(“1.3.6.1.2.1.25.2.3.1.6.3”)/oid(“1.3.6.1.2.1.25.2.3.1.5.3”))*100<90, “”, “Disk usage > 89%”)

Value:(oid(“1.3.6.1.2.1.25.2.3.1.6.3”)/oid(“1.3.6.1.2.1.25.2.3.1.5.3”))*100

Unit:%

Rate:none


####### Disk 4 - Disk space <90% monitored, 4 partition
Name:Disk 4 usage < 90%

Type:function

Available:if((oid(“1.3.6.1.2.1.25.2.3.1.6.4”)/oid(“1.3.6.1.2.1.25.2.3.1.5.4”))*100>0, 1, -1)

Error:if((oid(“1.3.6.1.2.1.25.2.3.1.6.4”)/oid(“1.3.6.1.2.1.25.2.3.1.5.4”))*100<90, “”, “Disk usage > 89%”)

Value:(oid(“1.3.6.1.2.1.25.2.3.1.6.4”)/oid(“1.3.6.1.2.1.25.2.3.1.5.4”))*100

Unit:%

Rate:none


####### Disk 5 - Disk space <90% monitored, 5 partition
Name:Disk 5 usage < 90%
Type:function

Available:if((oid(“1.3.6.1.2.1.25.2.3.1.6.5”)/oid(“1.3.6.1.2.1.25.2.3.1.5.5”))*100>0, 1, -1)

Error:if((oid(“1.3.6.1.2.1.25.2.3.1.6.5”)/oid(“1.3.6.1.2.1.25.2.3.1.5.5”))*100<90, “”, “Disk usage > 89%”)

Value:(oid(“1.3.6.1.2.1.25.2.3.1.6.5”)/oid(“1.3.6.1.2.1.25.2.3.1.5.5”))*100

Unit:%

Rate:none

Hi.
I try to monitor dick space with less GB

####### Disk 3 - Disk space < 2Gb monitored, 3 partition
Name:Disk 3 usage < 2 Gb
Type:function

Available:if((oid(“1.3.6.1.2.1.25.2.3.1.5.3”)-oid(“1.3.6.1.2.1.25.2.3.1.6.3”))*oid(“1.3.6.1.2.1.25.2.3.1.4.3”)/1024/1024/1024>2, 1, -1)

Error:if((oid(“1.3.6.1.2.1.25.2.3.1.5.3”)-oid(“1.3.6.1.2.1.25.2.3.1.6.3”))*oid(“1.3.6.1.2.1.25.2.3.1.4.3”)/1024/1024/1024<2, “”, “Disk 3 space < 2Gb”)

Value:if((oid(“1.3.6.1.2.1.25.2.3.1.5.3”)-oid(“1.3.6.1.2.1.25.2.3.1.6.3”))*oid(“1.3.6.1.2.1.25.2.3.1.4.3”)/1024/1024/1024

Unit:Gb

Rate:none

but it doesn’t work :frowning:
Why ?

I try to make universal function to monitor space on disk C in Windws, but in doesn’t work.

**name:**disk_C
**Description:**disk C on WIndows
**Code:**oid(array_element(oid_column(“iso.org.dod.internet.mgmt.mib-2.host.hrStorage.hrStorageTable.hrStorageEntry.hrStorageSize”, 600),array_find(oid_column(“iso.org.dod.internet.mgmt.mib-2.host.hrStorage.hrStorageTable.hrStorageEntry.hrStorageDescr”, 600),“C:\ Label:”)))/1024/1024

Any idea ?

Thanks.

Hello friends!
How to display the free space in gigabytes on the map for a linux computer ?

for example, I see that the root size has an index of 31, but when I put
drive: [oid(“iso.org.dod.internet.mgmt.mib-2.host.hrStorage.hrStorageTable.hrStorageEntry.hrStorageUsed.31”)/4096]
it shows only used place space

Masyanich, to get free space you probably should use a formula: Available-Used
Something like this:

(oid("Avaliable")-oid("Used")/1024/1024/1024)