SPM Test alarm was not forwarded as SNMP trap by AlarmNotifier scripts

Document ID : KB000051099
Last Modified Date : 14/02/2018
Show Technical Document Details

Description:

When SANM passed SPM Test Alarm to AlarmNotifier, the value of IP Address argument will be a null value because alarm asserted RTM_Test or RTM_TestHost model does not have Network Address attribute. In this case, when AlarmNotifier scripts had been modified to use /usr/sfw/bin/snmptrap utility to send traps, the SNMP trap may not be correctly sent out and Trap receiver will not process the SNMP trap. To avoid this problem we can pass RTM_Test or RTM_TestHost model's Test_Host_Address attribute value to AlarmNotifier to replace the IP Address value.

Solution:

To avoid this problem

  1. Find the attribute ID of Test_Host_Address attribute on RTM_Test and RTM_TestHost model using CLI.

    This example shows that attribute ID of Test_Host_Address is 0x45600f1 and 0x45600f0 respectively.

    Figure 1

  2. Pass those attribute values to AlarmNotifier scripts.

    As an example, here we use EXTRA_ATTRS_AS_ENVVARS parameter on .alarmrc.

    You may want to use EXTRA_ATTRS_AS_ARGS parameter instead.

    For more information, see AlarmNotifier User Guide(1503) in the section "Passing SPECTRUM Attributes to Scripts."
    EXTRA_ATTRS_AS_ENVVARS=0x45600f1,0x45600f0

  3. Modify AlarmNotifier scripts so that when alarm asserted model type is RTM_Test or RTM_TestHost

    ($MTYPE = "RTM_Test" or "RTM_TestHost") /usr/sfw/bin/snmptrap uses Test_Host_Address attribute value to send trap.

    This example shows a fraction of the required modification in AlarmNotifier script.
    if [ "$IPADDRESS" != " " ]then   # Send SNMP trap normally   # <Destination IP> needs to be replaced with actual destination Trap Receiver's IP Address   /usr/sfw/bin/snmptrap -v 1 -c public <Destination IP> 1.3 $IPADDRESS 6 $SEVERITY 0 1.3 s   "$SEV $MNAME $IPADDRESS $MTYPE $CAUSE $NEWPCAUSE MSG $EVENTMSG"elif [ $MTYPE = "RTM_Test" ]   then   # Send SNMP trap for SPM Test alarm (RTM_Test model)   # <Destination IP> needs to be replaced with actual destination Trap Receiver's IP Address   /usr/sfw/bin/snmptrap -v 1 -c public <Destination IP> 1.3 $SANM_0x45600f1 6 3 0 1.3 s   "$SEV $MNAME $SANM_0x45600f1 $MTYPE $CAUSE $NEWPCAUSE MSG $EVENTMSG"elif [ $MTYPE = "RTM_TestHost" ]   then   # Send SNMP trap for SPM Test alarm (RTM_TestHost model)   # <Destination IP> needs to be replaced with actual destination Trap Receiver's IP Address   /usr/sfw/bin/snmptrap -v 1 -c public <Destination IP> 1.3 $SANM_0x45600f0 6 3 0 1.3 s   "$SEV $MNAME $SANM_0x45600f0 $MTYPE $CAUSE $NEWPCAUSE MSG $EVENTMSG"fi
  4. Restart AlarmNotifier.