Is anyone using MATH in devmon templates?? I'm trying to calculate percent memory used for a couple of Windows 2000 servers and I'm getting:
"Error(s) while parsing 'PhysMemUsed' on xxxxxx"
The transforms file contains this:
PhysMemUsed : MATH : {PhysMemSize} - {PhysMemFree}
PhysMemPerc : MATH : ({PhysMemUsed} / {PhysMemSize}) x 100
and the corresponding OIDS are:
PhysMemSize : 1.3.6.1.4.1.232.11.2.13.1.0 : leaf
PhysMemFree : 1.3.6.1.4.1.232.11.2.13.2.0 : leaf
If I report PhysMemFree & PhysMemSize in the report message, I get sensible values. For example, right now they show 471 & 1152, so PhysMemUsed would be 681 and PhysMemPerc would be 59%.
I get the above error message, and PhysMemPerc is displayed as "Parent data missing".
Any clues??
Ralph Mitchell
On 9/24/07, Charles Jones <jonescr at cisco.com> wrote:
Should it be "* 100" instead of "x 100" ?
PhysMemPerc : MATH : ({PhysMemUsed} / {PhysMemSize}) x 100
No, there's a translation that happens in the dm_tests.pm module:
# Convert our math symbols to their perl equivalents
$expr =~ s/x/\*/g; # Multiplication
$expr =~ s/\^/**/g; # Exponentiation
I assume that having asterisks in the string causes problems with other devmon code prior to that point.
Anyway, it's the subract that either doesn't work, or fails to create the PhysMemUsed variable that gets used in the subsequent calculation.
Ralph Mitchell
participants (2)
-
jonescr@cisco.com
-
ralphmitchell@gmail.com