In some MIBs the time elapsed since an event is maintained, such as the time since the last reboot. In some cases it is desirable that the time stamp of the event is shown, rather than the time lapse. The attached patch enables the use of the function 'time' in a MATH transform.
In the example below the date and time of the last time-out of protocol LACP on an interface of a Juniper switch is computed. A zero value of jnxLacpTimeout means that no time-out is recorded (since the last (re)boot of the switch).
----- oids ----- jnxLacpIfName : .1.3.6.1.4.1.2636.3.53.1.1.4.1.1.1 : branch jnxLacpParent : .1.3.6.1.4.1.2636.3.53.1.1.4.1.1.3 : branch jnxLacpTimeout : .1.3.6.1.4.1.2636.3.53.1.1.4.1.1.4 : branch ----- transforms ----- jlEventUTS : MATH : time - {jnxLacpTimeout} : 0 jlEventDT : DATE : {jlEventUTS} jlEvent : SWITCH : {jnxLacpTimeout} 0 = Never, >0 = {jlEventDT}
NOTE: The patch included in bug #15 is required. Without it, the first transform will result in a perl run-time error.