All of the servers that we monitor have been placed into a single group, and the e-mail alerts have been set to send to an internal e-mail address. However, one of our clients would like to receive their alerts. I created a separate group for their servers, then set custom properties for both groups. Both groups have the CustomProp "clientemail." I set different values for each, then wrote a script that should check the properties for those values, and select a txt file from which to pull the e-mails accordingly. However, as far as I can tell, it isn't checking the custom property at all and seems to be defaulting to the same text file regardless of which group the alert is coming from. Can anyone assist? asked 11 Jun '18, 12:22 RichardWork |
For those that come along later, this ends up being an issue during testing. When the script is tested no failing monitor is attached (as would be the case in normal usage when a monitor fires an action). The monitor is where the action script would pull the Custom Property from, so with no monitor, the Custom Property value was always coming back blank. Actually, that's not quite correct. If there is no monitor, the script will try to read the Custom Property from the top Servers/Devices group. So any property that might have been set there would be returned. Doug Power Admin Support answered 20 Jun '18, 11:44 Doug ♦♦ |
Hi Richard Can you post the script that is checking the Custom Properties so we can take a look? answered 12 Jun '18, 19:48 Doug ♦♦ Below is the current script I'm trying. Dim strMail strMail = CustomProp("CLIENTEMAIL") Set oFSO = CreateObject("Scripting.FileSystemObject") Dim compRes Set compRes = response.write(StrComp("default", strMail) If strMail = "default" THEN Set oFile = oFSO.OpenTextFile("C:UsersBreaker Monitordefault.txt",1) EmailList = oFile.ReadAll ELSE Set oFile = oFSO.OpenTextFile("C:UsersBreaker Monitorclients.txt", 1) EmailList = oFile.ReadAll End If I also tried directly placing CustomProp("CLIENTEMAIL") directly in as opposed to assigning the string to strMail. Any help is appreciated.
(13 Jun '18, 09:00)
RichardWork
I apologize, that was a different version. This is what I have currently. Dim strMail strMail = CustomProp("CLIENTEMAIL") Set oFSO = CreateObject("Scripting.FileSystemObject") If IsEmpty(strMail) OR IsNull(strMail) THEN Set oFile = oFSO.OpenTextFile("C:UsersBreaker Monitordefault.txt",1) EmailList = oFile.ReadAll ELSE Set oFile = oFSO.OpenTextFile("C:UsersBreaker Monitorclients.txt", 1) EmailList = oFile.ReadAll End If
(13 Jun '18, 16:13)
RichardWork
|