...
- The expression must be a valid perl statement and return exactly one value.
- The tokens
$r
, andCVAR0
toCVAR9
are interpreted by NMIS; everything else is perl. - Defining and using local variables with
my
is ok, but don't attempt to change any global NMIS variables. "CVAR1=some_snmp_var
;" defines what SNMP object CVAR1 is supposed to hold. The parser understandsCVAR0
toCVAR9
for a total of 10 captures.- You can use functions that were defined elsewhere in NMIS in your
calculate
expression.
You will likely have to include the full module namespace in the function call, e.g.func::beautify_physaddress(...).
Only functions without side-effects should be used. - "
return $r/$CVAR1;
" accesses the value ofCVAR1
in an expression. The variable "$r
" represents the SNMP variable that thecalculate
expression is attached to.
...