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's gravatar image

RichardWork
133
accept rate: 0%


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

link

answered 20 Jun '18, 11:44

Doug's gravatar image

Doug ♦♦
10.2k122138
accept rate: 21%

Hi Richard

Can you post the script that is checking the Custom Properties so we can take a look?

link

answered 12 Jun '18, 19:48

Doug's gravatar image

Doug ♦♦
10.2k122138
accept rate: 21%

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
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×2
×1
×1
×1

Asked: 11 Jun '18, 12:22

Seen: 2,287 times

Last updated: 20 Jun '18, 11:44

Related questions