I am currently having an application where SNMP ALARMS are raised when my program is not able to reach an external API. I clear the alarm when ever i am successfully getting a response back from the API .
Below is the code for the same .
// Call Webservice to check the external API is up or not
logger.debug("Sending trap data Clear Alarm {}" , trapData);
AlarmTrap.INTERFACE_SMSC_STATUS.clear(trapData);
}
catch(CustomException e)
{
AlarmTrap.INTERFACE_SMSC_STATUS.raise(trapData);
logger.error("Error " + e);
throw e;
}
As you can see for every successful response i am clearing the alarm . Though there is no impact on the current execution as SNMP server discard same kind of alarms . I want to know if it is good practice or not . And whether SNMP protocol itself handles duplicate alarms and are not sent across to network .