Kaseya Community

Monitor AlarmID passing to a Script

  • Ok .. so how do I do this ... seems simple in that I have a monitor set that calls a script that uses the automatically declared script variable #vMonitorAlarmService.MonitorAlarmID#

    But Everytime the monitor set triggers and calls the script I keep gettting the same AlarmID from the script.

    What I need is the current AlarmID for the current Alarm that called the script to be available as a var within the script.


    Legacy Forum Name: Monitor AlarmID passing to a Script,
    Legacy Posted By Username: haakerp
  • Come on guys .. it can't be that hard ....

    From a Monitor Alarm , how to pass the correct MonitorAlarmID to the script called from the Monitorset

    I've made an initial attempt at getting it to work by firstly using the Get SQLView variable for vMonitorAlarmService/MonitorAlarmID , and then a second attempt using the automatically declared script variables of #vMonitorAlarmService.MonitorAlarmID# instead.

    But each time the Monitor Alarm called the script it kept returning the same MonitorAlarmID. i.e. if the 5 alarms where generated the AlarmID from the 1st event was passed to all of the script instead of each unique AlarmID.

    So next I created my own SQLView which groups Machine_GroupID and max(AlarmID) so I only get the current Highest alarmID for each machine and changed my script to use this SQLview for the Get Variable

    BUT now if multiple alarms come in for the same machine at the same time it seems Kaseya can't keep up and again passes the wrong AlarmID to the script.

    IT works perfectly if the alarms are received with a reasonable time gap between each one ,, just not if a bunch come in all at the same time.

    So ... Someone must have a solution to this.

    All I want is for Kaseya to accurately pass the correct AlarmID to the script from the Monitorset creating the alarm.

    Legacy Forum Name: Monitor Sets,
    Legacy Posted By Username: haakerp