Using a script to clear old alarms results in an 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.".
The script is calling a purgeAlarms(Date start, Date end)
function to clear all alarms based on the specified time frame and it clears old alarms that are still valid, which causes them to refire.
Is there a script that deletes old cleared alarms but leaves alarms that are still valid or current?
The following script can be used to purge all cleared alarms in the Foglight Management Server (FMS) from Administration | Tooling | Script Console | click Add | copy the script within "Enter Script Text:"
long now = System.currentTimeMillis()
Calendar threshold = Calendar.getInstance();
end_time = threshold.getTime()
start_time = new Date(0)
alarmService = server.get("AlarmService")
alarmService.purgeClearedAlarms(start_time, end_time) // it will delete all the cleared alarms
"done in "+(System.currentTimeMillis()-now)/1000+"s"
Note: To review the alarm count before and after running the script refer to Total Alarms counter (acknowledged, cleared, current, historical) and Purge (4295903).
© 2025 Quest Software Inc. ALL RIGHTS RESERVED. Termini di utilizzo Privacy Cookie Preference Center