Mick_Hughes

Simple Alarm Trigger Script

Discussion created by Mick_Hughes on Mar 8, 2019
Latest reply on Mar 8, 2019 by Garin

Bit f help required with a very simple trigger script.  I want to trigger a new alarm if I don't receive 3 alarms with the same text .......... i.e new arm if only 2 or more than 3

 

Got this so far:

 

 

print("testing script")

local hostname = "TestHostname"

local al=alarm.list("hostname",hostname)

if al ~= nill then

local count=0

for i=1,#al do
if (string.find (al[i].message,"XXXXXXX - Standby Response = in standby")) then
count = count + 1
else
--printf("%02d %s %s %s %s",i,al[i].nimid,al[i].hostname,al[i].severity,al[i].message)
end
end

if count ~= 3 then
--print("multple matches have been found")
--print (count)
nimbus.alarm(4,"Alert Text","*********","30.2.111",hostname)
end

Outcomes