7.2.3 Non-SNMP expression syntaxA Perl expression can be specified with the following special variables (without the $ symbol!): Both for periodic and irregular measurement types: · OUT: The measured value becomes the value of the OUT variable. During evaluation, the program automatically adds a “return OUT;” line to the expression, but naturally it is also possible to use this in the evaluation · NO_LINEAR_OUT: It has the same role as OUT. The difference lies in the processing of the returned value: when using OUT, the application also performs a linear stretch on the received value like in the case of the interface measurement. Therefore, if the received value is X and the previous value was Y, then the stored value becomes (X-Y)*INTERVAL/(INTERVAL+DIFFTIME)+Y. If NO_LINEAR_OUT occurs in the expression, then no such processing is done · FLOAT_OUT: It is similar to the NO_LINEAR_OUT, except that by using this the measurement can have a float value not just an integer value · NEGATIVE_OUT: The same as the OUT, except it can also have negative values. It can only be used if the value of the Counter parameter is No · NEGATIVE_NO_LINEAR_OUT: The same as the NO_LINEAR_OUT, except it can also have negative values. It can only be used if the value of the Counter parameter is No · NEGATIVE_FLOAT_OUT: The same as the FLOAT_OUT, except it can also have negative values. It can only be used if the value of the Counter parameter is No · UPTIME: The returned Uptime value by the equipment if the measurement module cannot return it · TIME: The actual measurement time in Unix time format · #VARIABLE#: The program measures the VARIABLE given in the above digit format (e.g. ORA_SESSIONS or ORA_TBL_USED.1) · #VARIABLE.PRE#: The previous value of the VARIABLE given in the above digit format · #VARIABLE.PORT#: The program measures the value of VARIABLE.port. This value can be used for tables, the port can be an arbitrary identifier (not only a number) · #VARIABLE.PORT.PRE#: The previous value of the measurement · PREVINVAL: The value of the first measurement formula in the previous data collection cycle. If that measurement was not successful then if the measurement cannot have negative values then its value will be -1, otherwise undef · PREVOUTVAL: Similar to the PREVINVAL, except for the second measurement formula · PREVVAL: If used in the first formula then it is the same as PREVINVAL, otherwise PREVOUTVAL For periodic measurement types: · DIFFTIME: The difference between the actual measurement time and the reference time in seconds. The measured values are stored for whole measurement intervals, so if the actual measurement was made at 7 minute and the interval is 5 minutes, then the value of DIFFTIME is 120 · PREVDIFFTIME: the value of DIFFTIME in the previous cycle · INTERVAL: Value of the measurement interval in seconds For irregular measurement types: · INTERVAL: If there was a previous measurement value then the time it has passed since that, in seconds. Otherwise 0 · EXPECTED_IN_SEC: The “Expect data in” parameter value of the measurement · PREVTIME: If there was a previous measurement value then the value of the TIME parameter for that measurement, otherwise -1 · SET_TIME: This is a result parameter and not an input parameter, i.e. the measurement expression can set its value. If the parameter is not used then the measurement data is stored with the timestamp provided by the data collector (for example current time). If it gets a value then it must be in Unix seconds (same format as the TIME parameter) A VARIABLE variable has a -1 value during the evaluation if the query for it was unsuccessful and expression contains OUT, NO_LINEAR_OUT or FLOAT_OUT. In this case the output variable should have a value of -1 if the measurement should be considered as unsuccessful. Contrarily a VARIABLE variable has an undefined (undef) value during the evaluation if the query for it was unsuccessful and expression contains NEGATIVE_OUT, NEGATIVE_NO_LINEAR_OUT or NEGATIVE_FLOAT_OUT. In this case the output variable should also have an undefined (undef) value if the measurement should be considered as unsuccessful. For active measurement servers the constructed Perl expression can be arbitrary, and it can contain any number of variable definitions. However, in case of a passive server type, only one variable can be used per measurement. Samples:
|