WebNMS Developer Forums
Click on Join Now to Sign Up
I have some questions about the “time” value in ALERT table.
There are 4 “time” columns in ALERT table: MODTIME, CLEARTIME, RAISETIME, CREATETIME. When I raise/clear alarm, the time value are changed, but some of the changes are not as I expected.
To describe how the timestamp was updated, I ran 4 alarms one by one (they share the same alarm entity):
#1, @11/07/2013 06:43:16 AM CST, alarm (severity=critical) was raised for the 1st time;
#2, @11/07/2013 06:49:03 AM CST, this alarm was cleared;
#3, @11/07/2013 06:59:01 AM CST, raised this alarm again;
#4, @11/07/2013 08:11:01 AM CST, cleared it again
Please check the attachment for how the time changed, which contains some snapshot pictures of ALERT table.
The following are how I code
//processing a raise alarm (time=11/07/2013 06:43:16 AM CST)
event.setTime(1383777796000L);
event.setSeverity(1); //This is a CRITICAL alarm
Properties properties = new Properties();
properties.setProperty("cleared", "0",);
event.setProperties(properties);
eventAPI.addEvent(event);
//processing a clear alarm (time=11/07/2013 06:49:03 AM CST)
event.setTime(1383778143000L);
event.setSeverity(1); //it was a CRITICAL alarm, now it will be cleared
Properties properties = new Properties();
properties.setProperty("cleared", "1",);
event.setProperties(properties);
eventAPI.addEvent(event);
My questions are:
1. As shown in the attachment, why CREATETIME is updated as 0 since the #2 alarm;
I understand the CREATETIME represents the timestamp at which the alarm is generated, which should not be a 0 value, refer to:
http://www.webnms.com/webnms/help/developer_guide/fault_management/fault_trouble_tips.html
[ The 'modTime' field in Alert represents the 'last modified' time i.e., the time at which the Alert's state is modified or updated. The 'createTime' field will represent the time at which the Alert got generated. At the time of generation of Alerts, both 'createTime' and 'modTime' will be the same. Once the alert gets updated, the 'modTime' changes accordingly.]
2. As shown in the attachment, why CLEARTIME=0, even when alarm is cleared?
3. As shown in the attachment, why RAISETIME is always an invalid value (null or 0)?
Thanks