Menu

#28 Allow function time in a MATH transform

Unstable (example)
open
nobody
time MATH (1)
5
2014-10-22
2014-10-22
Wim Nelis
No

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.

1 Attachments

Discussion


Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.