> My super simple conversion script is not working as It did in an older
> setup. The script itself is super simple..
> 
>   # my convert routine
>   sub Kb2B {
>          my $value = shift;
>          return ($value * 1024);
>   }
> 
...
> Here is the error I get in mrtg.log
>      -- Can't modify non-lvalue subroutine call at (eval 14) line 1.

This is almost certainly because the $value is non-numeric (an unknown).  Your 
script does not handle that case and ($value*1024) would have this problem.

However, there is a much more efficient way to achieve a simple multiplication 
by 1024!

Instead of
Target[xxxx]: oid&oid:c...@host|Kb2B
why not simply use
Target[xxxx]: oid&oid:c...@host * 1024
(note the spaces around the *)
This will multiply both retrieved values by 1024, taking proper account of 
unknowns.

Steve

_______________________________________________
mrtg mailing list
[email protected]
https://lists.oetiker.ch/cgi-bin/listinfo/mrtg

Reply via email to