create a new script in the nas script folder
Copy in the contents below and save
--
-- Name:UpdateUser2
-- Purpose: Update user2 feild
--
-- Author:
-- Change log:
--
--
-- This script is designed to only run as a pre-processing script
-- NMS Probe Name matches "fetchsg"
--
print("Start of UpdateUser2a")
--load message and robot into local variable.
local lomessage = event.message
local lorobot = event.robot
--list of robot names that could have alarms to supress
-- THESE VALUES ARE CASE SENITIVE! Check the original alarms
local robotnames = {"CHXLTEST",
"LHRCPYLV",
"howeu01-e7975DBServer",
"howeu01-s4801",
"SecondaryUIM",
"howeu01-f8510",
"ROBOT_7",
"ROBOT_8"}
-- print("Robot name: " .. robotnames[1])
--list of profile names that could have alarms to supress
-- THESE VALUES ARE CASE SENITIVE! Check the original alarms
local profilenames = {"SSAMUTHR",
"X043674 ",
"minute",
"Average",
"inactive",
"PROFILE_6",
"PROFILE_7",
"PROFILE_8"}
--print("Profile name: " .. profilenames[1])
-- Function to check if Name robot name in message is part of list
local function isRobotName(RobotName)
print("Start of isRobotName:" .. event.robot)
for index = 1, #robotnames do
if robotnames[index] == RobotName then
print ("Robot Name Matched to list:" .. event.robot)
return true
end
end
end
-- Function to check if Name profile name in message is part of list
local function isProfileName(EventMessage)
print("Start of isProfileName:" .. event.message)
for index = 1, #profilenames do
if string.match(EventMessage,profilenames[index]) then
print ("Profile Name Found in message:" .. event.message)
return true
end
end
end
print("Functions done starting check:")
--first IF statement checks to see if the Robot was matched
if isRobotName(event.robot)then
-- This checks if the Profile name was matched
if isProfileName(event.message) then
print ("Alarm should be suppresed Udpating user_tag2:")
if event.user_tag2 ~= nil then
print ("original user_tag2:" .. event.user_tag2)
end
-- change text below as needed
event.user_tag2 = "NOTICKET"
end
end
if event.user_tag2 ~= nil then
print ("new user_tag2:" .. event.user_tag2)
end
return event
Setup a pre-processing rule to math the incoming alarm you want to review
update the robot list with the names of the robots that should be checked for and matched on.
update the profile name with the text you want to match in the alarm.
When both of these condition are met the user_tag2 will be updated with the text