Community discussions

MikroTik App
 
User avatar
Belyivulk
Member Candidate
Member Candidate
Topic Author
Posts: 285
Joined: Mon Mar 06, 2006 10:53 pm
Location: Whangarei, New Zealand
Contact:

Dude Beta 6 showing diskusage to 8 decimal places

Tue Apr 24, 2007 11:27 pm

Has anyone else seen / fixed this before?

Thanks in advance
 
firebat
Member
Member
Posts: 390
Joined: Mon Apr 11, 2005 8:38 am

Tue Apr 24, 2007 11:30 pm

Just modify the hdd_usage function. Take the result, multiply by 100, round (will remove to nearest integer) and then divide by 100. This will give you two decimal points. You can multiply/divide by whatever you want to get the resolution desired.
 
User avatar
Belyivulk
Member Candidate
Member Candidate
Topic Author
Posts: 285
Joined: Mon Mar 06, 2006 10:53 pm
Location: Whangarei, New Zealand
Contact:

Tue Apr 24, 2007 11:34 pm

Thanks, Can you please give a working example of that?
 
firebat
Member
Member
Posts: 390
Joined: Mon Apr 11, 2005 8:38 am

Wed Apr 25, 2007 5:49 am

edit the hdd_usage function. Using the example below, subsitute current_function with the existing code in hdd_usage and save.

(round((current_function)*100))/100
 
User avatar
Belyivulk
Member Candidate
Member Candidate
Topic Author
Posts: 285
Joined: Mon Mar 06, 2006 10:53 pm
Location: Whangarei, New Zealand
Contact:

Wed Apr 25, 2007 6:14 am

This is under probes - hdd?
 
User avatar
Belyivulk
Member Candidate
Member Candidate
Topic Author
Posts: 285
Joined: Mon Mar 06, 2006 10:53 pm
Location: Whangarei, New Zealand
Contact:

Wed Apr 25, 2007 6:36 am

Ok, when i do as you say around this segment of code

(oid(concatenate("iso.org.dod.internet.mgmt.mib-2.host.hrStorage.hrStorageTable.hrStorageEntry.hrStorageUsed.",
array_element(
oid_column("iso.org.dod.internet.mgmt.mib-2.host.hrStorage.hrStorageTable.hrStorageEntry.hrStorageIndex", 600),
array_find(
oid_column("iso.org.dod.internet.mgmt.mib-2.host.hrStorage.hrStorageTable.hrStorageEntry.hrStorageType", 600),
"iso.org.dod.internet.mgmt.mib-2.host.hrStorage.hrStorageTypes.hrStorageFixedDisk"
))))

* 100 /

oid(concatenate("iso.org.dod.internet.mgmt.mib-2.host.hrStorage.hrStorageTable.hrStorageEntry.hrStorageSize.",
array_element(
oid_column("iso.org.dod.internet.mgmt.mib-2.host.hrStorage.hrStorageTable.hrStorageEntry.hrStorageIndex", 600),
array_find(
oid_column("iso.org.dod.internet.mgmt.mib-2.host.hrStorage.hrStorageTable.hrStorageEntry.hrStorageType", 600),
"iso.org.dod.internet.mgmt.mib-2.host.hrStorage.hrStorageTypes.hrStorageFixedDisk"
))))

like so

(round(oid(concatenate("iso.org.dod.internet.mgmt.mib-2.host.hrStorage.hrStorageTable.hrStorageEntry.hrStorageUsed.",
array_element(
oid_column("iso.org.dod.internet.mgmt.mib-2.host.hrStorage.hrStorageTable.hrStorageEntry.hrStorageIndex", 600),
array_find(
oid_column("iso.org.dod.internet.mgmt.mib-2.host.hrStorage.hrStorageTable.hrStorageEntry.hrStorageType", 600),
"iso.org.dod.internet.mgmt.mib-2.host.hrStorage.hrStorageTypes.hrStorageFixedDisk"
))))

* 100 /

oid(concatenate("iso.org.dod.internet.mgmt.mib-2.host.hrStorage.hrStorageTable.hrStorageEntry.hrStorageSize.",
array_element(
oid_column("iso.org.dod.internet.mgmt.mib-2.host.hrStorage.hrStorageTable.hrStorageEntry.hrStorageIndex", 600),
array_find(
oid_column("iso.org.dod.internet.mgmt.mib-2.host.hrStorage.hrStorageTable.hrStorageEntry.hrStorageType", 600),
"iso.org.dod.internet.mgmt.mib-2.host.hrStorage.hrStorageTypes.hrStorageFixedDisk"
)))))*100))/100

it doesnt work, the dude just displays [device_function]
 
firebat
Member
Member
Posts: 390
Joined: Mon Apr 11, 2005 8:38 am

Wed Apr 25, 2007 8:01 am

IF this is hdd_usage:

(oid(concatenate("iso.org.dod.internet.mgmt.mib-2.host.hrStorage.hrStorageTable.hrStorageEntry.hrStorageUsed.",
array_element(
oid_column("iso.org.dod.internet.mgmt.mib-2.host.hrStorage.hrStorageTable.hrStorageEntry.hrStorageIndex", 600),
array_find(
oid_column("iso.org.dod.internet.mgmt.mib-2.host.hrStorage.hrStorageTable.hrStorageEntry.hrStorageType", 600),
"iso.org.dod.internet.mgmt.mib-2.host.hrStorage.hrStorageTypes.hrStorageFixedDisk"
))))

Then replace it with:

(round(((oid(concatenate("iso.org.dod.internet.mgmt.mib-2.host.hrStorage.hrStorageTable.hrStorageEntry.hrStorageUsed.",
array_element(
oid_column("iso.org.dod.internet.mgmt.mib-2.host.hrStorage.hrStorageTable.hrStorageEntry.hrStorageIndex", 600),
array_find(
oid_column("iso.org.dod.internet.mgmt.mib-2.host.hrStorage.hrStorageTable.hrStorageEntry.hrStorageType", 600),
"iso.org.dod.internet.mgmt.mib-2.host.hrStorage.hrStorageTypes.hrStorageFixedDisk"
)))) *100))/100


After saving, ensure that the error column is blank and not reporting any issues with the function.
Last edited by firebat on Wed Apr 25, 2007 8:09 am, edited 2 times in total.
 
User avatar
Belyivulk
Member Candidate
Member Candidate
Topic Author
Posts: 285
Joined: Mon Mar 06, 2006 10:53 pm
Location: Whangarei, New Zealand
Contact:

Wed Apr 25, 2007 8:03 am

i have, see what ive posted above
 
firebat
Member
Member
Posts: 390
Joined: Mon Apr 11, 2005 8:38 am

Wed Apr 25, 2007 8:12 am

I don't have access to dude at the moment. Is hdd_usage this entire piece:

(oid(concatenate("iso.org.dod.internet.mgmt.mib-2.host.hrStorage.hrStorageTable.hrStorageEntry.hrStorageUsed.",
array_element(
oid_column("iso.org.dod.internet.mgmt.mib-2.host.hrStorage.hrStorageTable.hrStorageEntry.hrStorageIndex", 600),
array_find(
oid_column("iso.org.dod.internet.mgmt.mib-2.host.hrStorage.hrStorageTable.hrStorageEntry.hrStorageType", 600),
"iso.org.dod.internet.mgmt.mib-2.host.hrStorage.hrStorageTypes.hrStorageFixedDisk"
))))

* 100 /

oid(concatenate("iso.org.dod.internet.mgmt.mib-2.host.hrStorage.hrStorageTable.hrStorageEntry.hrStorageSize.",
array_element(
oid_column("iso.org.dod.internet.mgmt.mib-2.host.hrStorage.hrStorageTable.hrStorageEntry.hrStorageIndex", 600),
array_find(
oid_column("iso.org.dod.internet.mgmt.mib-2.host.hrStorage.hrStorageTable.hrStorageEntry.hrStorageType", 600),
"iso.org.dod.internet.mgmt.mib-2.host.hrStorage.hrStorageTypes.hrStorageFixedDisk"
))))


then it would look like: (you are missing parens in yours above)


(round(( (oid(concatenate("iso.org.dod.internet.mgmt.mib-2.host.hrStorage.hrStorageTable.hrStorageEntry.hrStorageUsed.",
array_element(
oid_column("iso.org.dod.internet.mgmt.mib-2.host.hrStorage.hrStorageTable.hrStorageEntry.hrStorageIndex", 600),
array_find(
oid_column("iso.org.dod.internet.mgmt.mib-2.host.hrStorage.hrStorageTable.hrStorageEntry.hrStorageType", 600),
"iso.org.dod.internet.mgmt.mib-2.host.hrStorage.hrStorageTypes.hrStorageFixedDisk"
))))

* 100 /

oid(concatenate("iso.org.dod.internet.mgmt.mib-2.host.hrStorage.hrStorageTable.hrStorageEntry.hrStorageSize.",
array_element(
oid_column("iso.org.dod.internet.mgmt.mib-2.host.hrStorage.hrStorageTable.hrStorageEntry.hrStorageIndex", 600),
array_find(
oid_column("iso.org.dod.internet.mgmt.mib-2.host.hrStorage.hrStorageTable.hrStorageEntry.hrStorageType", 600),
"iso.org.dod.internet.mgmt.mib-2.host.hrStorage.hrStorageTypes.hrStorageFixedDisk"
)))) )*100))/100
 
User avatar
Belyivulk
Member Candidate
Member Candidate
Topic Author
Posts: 285
Joined: Mon Mar 06, 2006 10:53 pm
Location: Whangarei, New Zealand
Contact:

Wed Apr 25, 2007 8:28 am

that doesnt work. it just comes ip with device_performance
 
firebat
Member
Member
Posts: 390
Joined: Mon Apr 11, 2005 8:38 am

Wed Apr 25, 2007 8:54 am

Does it show an error in the error column for the function?
 
firebat
Member
Member
Posts: 390
Joined: Mon Apr 11, 2005 8:38 am

Thu Apr 26, 2007 9:55 am

This code works for me:


(round((

oid(concatenate("iso.org.dod.internet.mgmt.mib-2.host.hrStorage.hrStorageTable.hrStorageEntry.hrStorageUsed.",
array_element(
oid_column("iso.org.dod.internet.mgmt.mib-2.host.hrStorage.hrStorageTable.hrStorageEntry.hrStorageIndex", 600),
array_find(
oid_column("iso.org.dod.internet.mgmt.mib-2.host.hrStorage.hrStorageTable.hrStorageEntry.hrStorageType", 600),
"iso.org.dod.internet.mgmt.mib-2.host.hrStorage.hrStorageTypes.hrStorageFixedDisk"
))))

* 100 /

oid(concatenate("iso.org.dod.internet.mgmt.mib-2.host.hrStorage.hrStorageTable.hrStorageEntry.hrStorageSize.",
array_element(
oid_column("iso.org.dod.internet.mgmt.mib-2.host.hrStorage.hrStorageTable.hrStorageEntry.hrStorageIndex", 600),
array_find(
oid_column("iso.org.dod.internet.mgmt.mib-2.host.hrStorage.hrStorageTable.hrStorageEntry.hrStorageType", 600),
"iso.org.dod.internet.mgmt.mib-2.host.hrStorage.hrStorageTypes.hrStorageFixedDisk"
))))
)*100)/100)
 
User avatar
Belyivulk
Member Candidate
Member Candidate
Topic Author
Posts: 285
Joined: Mon Mar 06, 2006 10:53 pm
Location: Whangarei, New Zealand
Contact:

Thu Apr 26, 2007 10:27 am

That worked a treat, thanks alot! :)

Who is online

Users browsing this forum: No registered users and 13 guests