Common functions
The common functions supported in collection formulas.
delta-
- Purpose
-
Returns the difference between the current value of binding x and its previous value. If
delta()of a MIB object with counter syntax is negative, it is not considered a problem. - Syntax
-
delta (x)x The value whose delta value you want to find. - Example
-
Which is equal to:positive(delta(CISCO_ENHANCED_MEMPOOL_MIB.cempMemPoolFreeHit))positive(currentValue(CISCO_ENHANCED_MEMPOOL_MIB.cempMemPoolFreeHit) – previousValue(CISCO_ENHANCED_MEMPOOL_MIB.cempMemPoolFreeHit))
value-
- Purpose
-
Returns the value of a binding x. The
valuefunction is same as thecurrentValuefunction. - Syntax
-
value (x)x The binding whose value you want to find. - Examples
-
-
value(CISCO_ENVMON_MIB.ciscoEnvMonSupplyState)
-
values-
- Purpose
- Returns an array of values of a binding x that is stored in current state.
- Syntax
-
values(x)x The binding whose values from its stored current state that you want to find. - Example
-
positive(values(CISCO_ENHANCED_MEMPOOL_MIB.cempMemPoolFreeHit)[0])
duration-
- Purpose
- Returns the difference of the current value collection time and the previous value collection time of a binding x.
- Syntax
-
duration (x, ['seconds'])x The binding whose value you want to find. seconds Optional argument that indicates the unit of time. By default, it returns the value in milliseconds. If you want the function to return seconds, an argument 'second'must be added to the formula. It can be given as any of the following formats in single quotation marks:- 's'
- 'sec'
- 'secs'
- 'second'
- 'seconds'
- Example
-
Which is equal to:positive(delta(IF_MIB.ifHCOutUcastPkts)/ duration(IF_MIB.ifHCOutUcastPkts))positive( currentTime(IF_MIB.ifHCOutUcastPkts) – previousTime(IF_MIB.ifHCOutUcastPkts))
time-
- Purpose
- Returns the collection time of the current value of a binding x. The
timefunction is same as thecurrentTimefunction. - Syntax
-
time (x, ['seconds'])x The binding whose value you want to find. seconds Optional argument that indicates the unit of time. By default, it returns the value in milliseconds. If you want the function to return seconds, an argument 'second'must be added to the formula. It can be given as any of the following formats in single quotation marks:- 's'
- 'sec'
- 'secs'
- 'second'
- 'seconds'
- Example
-
positive(time(CISCO_ENHANCED_MEMPOOL_MIB.cempMemPoolFreeHit))
times-
- Purpose
- Returns an array of collection times of all the values of a binding x that is stored in the current state.
- Syntax
-
times(x, ['seconds'])x The binding whose value you want to find. seconds Optional argument that indicates the unit of time. By default, it returns the value in milliseconds. If you want the function to return seconds, an argument 'second'must be added to the formula. It can be given as any of the following formats in single quotation marks:- 's'
- 'sec'
- 'secs'
- 'second'
- 'seconds'
- Example
-
positive(times(CISCO_ENHANCED_MEMPOOL_MIB.cempMemPoolFreeHit)[0])
currentTime-
- Purpose
- Returns the collection time of the current value of a binding x.
- Syntax
-
currentTime (x, ['seconds'])x The binding whose value you want to find. seconds Optional argument that indicates the unit of time. By default, it returns the value in milliseconds. If you want the function to return seconds, an argument 'second'must be added to the formula. It can be given as any of the following formats in single quotation marks:- 's'
- 'sec'
- 'secs'
- 'second'
- 'seconds'
- Example
-
positive(currentTime(CISCO_ENHANCED_MEMPOOL_MIB.cempMemPoolFreeHit))
previousTime-
- Purpose
- Returns the collection time of the previous value of a binding.
- Syntax
-
previousTime (x, ['seconds'])x The binding whose value you want to find. seconds Optional argument that indicates the unit of time. By default, it returns the value in milliseconds. If you want the function to return seconds, an argument 'second'must be added to the formula. It can be given as any of the following formats in single quotation marks:- 's'
- 'sec'
- 'secs'
- 'second'
- 'seconds'
- Example
-
previousTime(CISCO_ENHANCED_MEMPOOL_MIB.cempMemPoolFreeHit)
rate-
- Purpose
- Returns the rate of change between the current value and previous value of a binding.
- Syntax
-
rate (x, ['seconds'])x The binding whose value you want to find. seconds Optional argument that indicates the unit of time. By default, it returns the value in milliseconds. If you want the function to return seconds, an argument 'second'must be added to the formula. It can be given as any of the following formats in single quotation marks:- 's'
- 'sec'
- 'secs'
- 'second'
- 'seconds'
- Example
Which is equal to:positive(rate(IF_MIB.ifHCOutUcastPkts, 'second'))positive(delta(IF_MIB.ifHCOutUcastPkts)/duration(IF_MIB.ifHCOutUcastPkts, 'second'))
currentValue-
- Purpose
- Returns the value of a binding x.
- Syntax
-
currentValue (x)x The value whose currentValuevalue you want to find. - Example
-
currentValue(CISCO_ENHANCED_MEMPOOL_MIB.cempMemPoolFreeHit)
previousValue-
- Purpose
- Returns the previous value of a binding.
- Syntax
-
previousValue (x)x The value whose previousValuevalue you want to find. - Example
-
previousValue(CISCO_ENHANCED_MEMPOOL_MIB.cempMemPoolFreeHit)
positive-
- Purpose
- Returns the value of the expression as follows:
- If the value of the binding is positive, it returns the value.
- If the value of the binding is negative, it returns null. You can provide a default value to be
returned. For example,
positive(-1, 10), it returns 10. - When you write a custom formula that uses
positivefunction, enclose the function within the expression so it returns anullvalue instead of zero. For example:
returnspositive(value(RFC1213_MIB.ifOutOctets) * 8000)nullas intended Whereas:
returns zero, which is incorrect.positive(value(RFC1213_MIB.ifOutOctets)) * 8000
- Syntax
-
posistive (x, [default_value])xThe binding whose value is returned. If the binding is positive, then the value is returned. If it is negative, then null is returned. If the binding is a negative value, provide a default value. Then, the default value is returned. [default_value]An optional argument. Value that must be returned for a negative result from the expression. - Example
-
positive(rate(IF_MIB.ifHCOutOctets, 'second')*8 / value(IF_MIB.ifHighSpeed)/10000)