How do I convert megabytes to gigabytes in MRTG?

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
jbruyet
Posts: 235
Joined: Wed Dec 28, 2011 12:14 pm

How do I convert megabytes to gigabytes in MRTG?

Post 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:public@192.168.2.29
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
jbruyet
Posts: 235
Joined: Wed Dec 28, 2011 12:14 pm

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

Post by jbruyet »

I just saw that I'm going to have the same problem with monitoring memory.

Thanks,

Joe B
sreinhardt
-fno-stack-protector
Posts: 4366
Joined: Mon Nov 19, 2012 12:10 pm

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

Post 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.
Nagios-Plugins maintainer exclusively, unless you have other C language bugs with open-source nagios projects, then I am happy to help! Please pm or use other communication to alert me to issues as I no longer track the forum.
jbruyet
Posts: 235
Joined: Wed Dec 28, 2011 12:14 pm

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

Post by jbruyet »

I understand. I was hoping to get an answer here because the MRTG support options are less user-friendly.

Thanks,

Joe B
Locked