Using a script to clear old alarms results in undesired behavior. The user gets an alert that says “The number of alarms stored in the Foglight database has exceeded 10000.0. There are 8660.0 alarms that have been cleared for over a day. Please consider deleting these alarms." Usually, the user runs the below script:
long now = System.currentTimeMillis() Calendar threshold = Calendar.getInstance(); threshold .add(Calendar.DATE, -3) server.get("AlarmService").purgeAlarms(new Date(0), threshold.getTime()); "done in "+(System.currentTimeMillis()-now)/1000+"s"
The user has a problem with this script is that it clears old alarms that are still valid, which causes them to refire.
Is there a script that deletes old cleared alarms but leaves still valid alarms?
You need to be signed in and under a current maintenance contract to view premium knowledge articles.