Interesting request!
Currently, it is not possible to define an event handler for all events at one level or above, but that sounds like it would be the ideal way to address this. Currently, I would find myself either using a mailing list or user with a "send alarm emails" setting of "Urgent" and either having that be enough (you can send SMS to many carriers over email, but you would not control the message text) or having a script check if new alarms have occurred in the last X minutes. You could also add an event handler to every event type, that's an option.
So far as the script goes, add the output point into the context, we'll run it on 0 0/5 * * * ? (every five minutes) and have something like....
var activeEvents = com.serotonin.m2m2.Common.eventManager.getAllActive(); var maxLevel = 0; for( var k = 0; k < activeEvents.length; k+=1 ) { if( activeEvents[k].activeTimestamp < checkedUnto.time ) continue; if( activeEvents[k].alarmLevel > maxLevel ) maxLevel = activeEvents[k].alarmLevel; } if( maxLevel >= com.serotonin.m2m2.rt.event.AlarmLevels.URGENT ) output.set(1); else output.set(0); checkedUnto.set(!checkedUnto.value); //Ping-pong a context binary point to track timeWhile this has the disadvantage of perhaps taking five minutes to alert of an alarm (you could speed up the cron patter though), it will have the advantage of also communicating the "server offline" state through failing to send an 'all is good' message on that five minute interval.
If you want to go down the add-to-every event type route, I can help with the script you may need there. I think we probably will add the ability to define an event handler for all events at or above levels.