Page 1 of 1

HD space/usage

Posted: Mon May 10, 2010 1:52 pm
by firefox905
Hi i'm new here so sorry if I post dubble.

I'm using The Dude on my network now(works great!) I want to add a Funtion disk space / usage. I know there is a standard Disk Funtion but thats a overall space / usage. I want to know how you can see the diskspace / usage off every partition (C: / D: / E:).

Firefox905

Re: HD space/usage

Posted: Mon May 10, 2010 3:41 pm
by sergejs
If you operating system can provide information about each partition by SNMP (for example), then I do not see any problem to get the information to Dude.

As MikroTik RouterOS is standalone OS, it works on entire partition and you can monitor only this partition. SNMP OID is available from,
/system resource print oid

Re: HD space/usage

Posted: Mon May 10, 2010 4:20 pm
by firefox905
I found the solution:

NAME: Disk1UsedSpace

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<80, "", concatenate("Disk 1 (", string_substring(oid("1.3.6.1.2.1.25.2.3.1.3.1"),0,2), ") used space is currently at (", string_substring (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 , ") % "))

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

If you want to check disk 2, only change the last number of all OIDs from "1" to "2", and the message text from "Disk 1" to "Disk 2". The same for disk 3,4,5... .

Re: HD space/usage

Posted: Mon May 10, 2010 6:28 pm
by marcopolo
I have this setup in the appearance of my servers, simply insert into the 'label' though you will need to make sure you have the correct OID

Current disk space available
C:[round(((((oid("1.3.6.1.2.1.25.2.3.1.5.2")-oid("1.3.6.1.2.1.25.2.3.1.6.2"))*oid("1.3.6.1.2.1.25.2.3.1.4.2"))/1024)/1024)/1024)] GB
D:[round(((((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)] GB
E:[round(((((oid("1.3.6.1.2.1.25.2.3.1.5.4")-oid("1.3.6.1.2.1.25.2.3.1.6.4"))*oid("1.3.6.1.2.1.25.2.3.1.4.4"))/1024)/1024)/1024)] GB

Re: HD space/usage

Posted: Fri May 14, 2010 2:37 pm
by stmx38
Disk Space: Free/Total

Image

Disk Space: C:\=[round(((((oid("1.3.6.1.2.1.25.2.3.1.5.1")-oid("1.3.6.1.2.1.25.2.3.1.6.1"))*oid("1.3.6.1.2.1.25.2.3.1.4.1"))/1024)/1024)/1024)]/[round(((oid("1.3.6.1.2.1.25.2.3.1.5.1")*oid("1.3.6.1.2.1.25.2.3.1.4.1")/1024)/1024)/1024)] GB D:\=[round(((((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)]/[round(((oid("1.3.6.1.2.1.25.2.3.1.5.3")*oid("1.3.6.1.2.1.25.2.3.1.4.3")/1024)/1024)/1024)] GB

Re: HD space/usage

Posted: Fri Jun 11, 2010 12:32 pm
by nbruk
This is working great - thanks to the above posters. Anyone know how to get the figures to round to 2 decimal places?

Re: HD space/usage

Posted: Fri Jun 11, 2010 2:30 pm
by gsandul
Anyone know how to get the figures to round to 2 decimal places?
It's simple, like a programming, just use your imagination :)
round(My_Function()*100)/100  -- for 2 decimal places
round(My_Function()*1000)/1000 -- for 3 decimal places