Page 1 of 1

How do I convert megabytes to gigabytes in MRTG?

Posted: Sat Apr 05, 2014 11:47 am
by jbruyet
Hey all, I'm just getting started with monitoring hardware resources with MRTG and I've hit a snag with disk space monitoring. I'm monitoring the hard disk space on an HP ProLiant DL360 server and I cant' find an OID for percent disk space used. I tried calculating the percentage used like this:

Code: Select all

[DSKDictum2]:.1.3.6.1.2.1.25.2.3.1.6.1*100/.1.3.6.1.2.1.25.2.3.1.5.1&1.3.6.1.2.1.25.2.3.1.6.1*100/.1.3.6.1.2.1.25.2.3.1.5.1:[email protected]
but that gave me an ugly looking error:

Code: Select all

root@FreeNag:/usr/home/jobee/Config # /usr/local/bin/mrtg /usr/home/jobee/Config/mrtg_192.168.2.29.cfg
2014-04-05 08:45:50: ERROR: Target[dskdictum2][_IN_] '.1.3.6.1.2.1.25.2.3.1.6.1*100/.1.3.6.1.2.1.25.2.3.1.5.1&1.3.6.1.2.1.25.2.3.1.6.1*100/.1.3.6.1.2.1.25.2.3.1.5. $target->[2]{$mode} ' (warn): Argument "\0^A^C^F^A^B^A^Y^B^C^A^E^A" isn't numeric in division (/) at (eval 25) line 1.
2014-04-05 08:45:50: ERROR: Target[dskdictum2][_OUT_] '.1.3.6.1.2.1.25.2.3.1.6.1*100/.1.3.6.1.2.1.25.2.3.1.5.1&1.3.6.1.2.1.25.2.3.1.6.1*100/.1.3.6.1.2.1.25.2.3.1.5. $target->[2]{$mode} ' (warn): Argument "\0^A^C^F^A^B^A^Y^B^C^A^E^A" isn't numeric in division (/) at (eval 26) line 1.
Use of uninitialized value $inlast in pattern match (m//) at /usr/local/bin/mrtg line 1044.
Use of uninitialized value $outlast in pattern match (m//) at /usr/local/bin/mrtg line 1047.
root@FreeNag:/usr/home/jobee/Config #
At this time I'm using the storage size OID as my MaxBytes value and using my storage used OID for my graphed value. The only problem with doing it this way is HP's OIDs for storage need to be multiplied by the 4096 value for the allocation units to be accurate. As it is now, my percentage is accurate but my storage values are off:

Code: Select all

 	
		Max 			Average			Current
C Drive		146.5 MBytes (100.0%)	64.0 MBytes (43.7%)	58.1 MBytes (39.7%) 
The C: drive on this server is actually 600 gigabytes. SO, all that to ask if there's a way to calculate a percentage using OIDs so that my displayed values will be correct?

Thanks,

Joe B

Re: How do I convert megabytes to gigabytes in MRTG?

Posted: Sat Apr 05, 2014 11:51 am
by jbruyet
I just saw that I'm going to have the same problem with monitoring memory.

Thanks,

Joe B

Re: How do I convert megabytes to gigabytes in MRTG?

Posted: Mon Apr 07, 2014 11:42 am
by sreinhardt
Hi Jbruyet, not to push you away from requesting help, but is there a particular reason this was not asked via mrtg support resources? I feel like they would be able to get you moving a little faster, since this does not seem to be a specific nagios question.

Re: How do I convert megabytes to gigabytes in MRTG?

Posted: Tue Apr 08, 2014 4:51 pm
by jbruyet
I understand. I was hoping to get an answer here because the MRTG support options are less user-friendly.

Thanks,

Joe B