How can we change the text sent when an SNMP trap is cleared? We want to send the text Cleared to let our SNMP system know that the trap has been cleared.
By default when a condition like one of the following is used in an event-driven rule, the message text sent by an SNMP action under the rule is the same when the trap is originally triggered and when it is cleared.
Condition using rule name:
_________________________________________________________
@event_foglight_rule_name == CPU_Utilization_Test_Linux;
_________________________________________________________
Condition using rule ID:
________________________________________________________
@event_foglight_rule_id == 542c111ff5feabe3803bccb722386cae;
_________________________________________________________
You can change the text sent when the SNMP trap is cleared by changing the condition of the event-driven rule.
For example, when using the rule name in the condition the following expression can be used to send the message Cleared:
_________________________________________________________
if ((@event_foglight_rule_name == CPU_Utilization_Test_Linux) && (@event.getInt(change/value) == 1)) {
@event.setString(message,Cleared);
}
@event_foglight_rule_name == CPU_Utilization_Test_Linux;
_________________________________________________________
For example, when using the rule ID in the condition the following expression can be used to send the message Cleared:
_________________________________________________________
if ((@event_foglight_rule_id == 542c111ff5feabe3803bccb722386cae) && (@event.getInt(change/value) == 1)) {
@event.setString(message,Cleared);
}
@event_foglight_rule_id == 542c111ff5feabe3803bccb722386cae;
_________________________________________________________
The SNMP trap type is different depending on the severity level of the event that triggered it. The trap type is 0 for normal severity events, 2 for warning severity events, 3 for critical severity events, and 4 for fatal severity events. The trap type of 0 may be something you can use to indicate to the SNMP system that the trap has been cleared.
Typically the rule name is used in the condition of an event-driven rule. Sometimes the rule ID is used because there is an issue (PR76701) that causes a problem with using the rule name of certain simple rules (EventLog, LogFilter, Ora_Alert_Log). Please see solution 46694 for more information on this issue.
© 2024 Quest Software Inc. ALL RIGHTS RESERVED. Terms of Use Privacy Cookie Preference Center