Community discussions

MikroTik App
 
firefox905
just joined
Topic Author
Posts: 2
Joined: Mon May 10, 2010 1:36 pm

HD space/usage

Mon May 10, 2010 1:52 pm

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
 
User avatar
sergejs
MikroTik Support
MikroTik Support
Posts: 6697
Joined: Thu Mar 31, 2005 3:33 pm
Location: Riga, Latvia
Contact:

Re: HD space/usage

Mon May 10, 2010 3:41 pm

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
 
firefox905
just joined
Topic Author
Posts: 2
Joined: Mon May 10, 2010 1:36 pm

Re: HD space/usage

Mon May 10, 2010 4:20 pm

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... .
 
marcopolo
newbie
Posts: 45
Joined: Wed Feb 03, 2010 7:17 pm

Re: HD space/usage

Mon May 10, 2010 6:28 pm

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
 
User avatar
stmx38
Long time Member
Long time Member
Posts: 651
Joined: Thu Feb 14, 2008 4:03 pm
Location: Moldova, Chisinau

Re: HD space/usage

Fri May 14, 2010 2:37 pm

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
 
nbruk
just joined
Posts: 2
Joined: Thu Jun 10, 2010 9:02 pm

Re: HD space/usage

Fri Jun 11, 2010 12:32 pm

This is working great - thanks to the above posters. Anyone know how to get the figures to round to 2 decimal places?
 
User avatar
gsandul
Member Candidate
Member Candidate
Posts: 154
Joined: Mon Oct 19, 2009 1:42 pm

Re: HD space/usage

Fri Jun 11, 2010 2:30 pm

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