Fix snmptrap alert bug - #2045
Conversation
|
|
||
| int alertType = snmpTrapInfo.getAlertType() + 1; | ||
| if (alertType > 0) { | ||
| trap.add(new VariableBinding(SnmpConstants.sysUpTime, new OctetString(new Date().toString()))); |
There was a problem hiding this comment.
This doesn't seem what we want. The sysUpTime shouldn't be set to 'now', should it? Without to much diving in I'd say it should be added and retrieved from the SnmpTrapInfo. If I am wrong, please add a comment explaining why 'now' is alright.
There was a problem hiding this comment.
Agree with @DaanHoogland here. sysuptime isn't indeed now(), but for how long the system has been up.
There was a problem hiding this comment.
I will use this expression to replace now
sysUpTimeTicks = ManagementFactory.getRuntimeMXBean().getUptime() / 10;
trap.add(new VariableBinding(SnmpConstants.sysUpTime, new TimeTicks(sysUpTimeTicks)))
|
@WingkaiHo if the trap is always coming from the management server this makes sense. I am not familiar enough with this functionality. |
|
@DaanHoogland cloudstack all alert message use the snmptrap send to third party system, if you set at log4j. And you can use snmptrapd and snmptt to dispose alert. If you not add this field, the snmptrapd and snmptt receive trap no normal. |
ACS CI BVT RunSumarry: Link to logs Folder (search by build_no): https://www.dropbox.com/sh/r2si930m8xxzavs/AAAzNrnoF1fC3auFrvsKo_8-a?dl=0 Failed tests:
Skipped tests: Passed test suits: |
|
LGTM. @WingkaiHo can you add a JIRA ID for this? |
|
how to add patch to jira |
|
@WingkaiHo go to https://issues.apache.org/jira/secure/CreateIssue!default.jspa, create an account if necessary and submit a ticket under CLOUDSTACK project. And share here the JIRA-ID (or ticket ID, something like |
|
@blueorangutan package |
|
@rhtyd a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress. |
|
Packaging result: ✔centos6 ✔centos7 ✔debian. JID-1399 |
|
@blueorangutan test |
|
@rhtyd a Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests |
|
Trillian test result (tid-1804)
|
|
@blueorangutan package |
|
@rhtyd a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress. |
|
Packaging result: ✔centos6 ✔centos7 ✔debian. JID-1499 |
|
Previous test LGTM, the failing tests are unrelated and were known issues. |
Atualização do arquivo `templateConfig.sh` Closes apache#2045 See merge request scclouds/scclouds!944
Fix snmptrap alerts info omit to send the field of SnmpConstants.sysUpTime.
So when standard snmptrapd receive alerts package the field OID will dislocation