Sometimes it’s helpful to automatically run a script if a certain alert happens. For example, delete log or temp files when a storage drive fills up.  Basically, it’s a DataSource that uses a PowerShell script. The script uses the LogicMonitor API to detect if a specified DataPoint on the Device/Resource  is alerting right now. If yes, then it runs the commands to delete some specified files/folders (or whatever commands you specify). If this action doesn’t work, an alert rule will continue to stage 2 which will send an alert to the usual people.




  1. Download and import this DataSource
  2. If you haven’t already, create an API user with tokens and set properties for ID, key, and company on a group or base of the ‘tree’. The DataSource needs this.
  3. Apply this new DataSource by setting a property on desired devices or group(s). I recommend using a property name that’s the same as the DataSource name i.e. “_Delete_files_if_alert”
  4. Create a ‘utility group’ for the sake of organization and more importantly to specify a special alert rule (as shown in video). I suggest you create an alert rule where stage 1 is nobody (or NoEscalation) and 4 minutes later Stage 2 etc goes to the usual people.
  5. Test by triggering an alert (you can create a big file or simply lower the threshold on an instance).


Tech support is not provided by LogicMonitor tech support but I will try to help as time permits.