Hello,

i have a problem with the notification. I set it to execute this scriptand set the right parameters.

The scripts works if it is executed in the powershell of de server containing the same parameters as the PRTG server. The Notification protocol shows "sending EXE: OK" after the trigger pulls, but if i put in the subject or in the body variables like %message or %name it always shows up errors like:

Fehler beim Versenden von "EXE": Fehler1. Code: : The term 'Code:' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again. At line:1 char:161 + ... ierter[...] (Sensor/Source/ID: 5074/5072/1)

in this example the error message has a "Code:" and it doesn't recognize it as a string. What is set wrong?


Article Comments

What do the parameters look like exactly?


Feb, 2016 - Permalink

the Notofications functions with this parameters: to@mail.com "Device" "Errormessage" sntpserver from@mail.com

but it doesn´t work with this one: to@mail.com "%device" ""%status" sntpserver from@mail.com

the tests show that it doesn´t matter if the variables are positioned in the quotation or not.


Feb, 2016 - Permalink

There's an extra quote there, try this one:
to@mail.com "%device" "%status" smtpserver from@mail.com


Feb, 2016 - Permalink

sorry it was my fault. The extra quote was put in by me when i wrote the example with the variables. This quote wasn´t there on our tests. I just verified the parameters these are: to@mail.com "%device" "%status" smtpserver from@mail.com

Just like you said.


Feb, 2016 - Permalink

a new update to this post: it works only when the variable contains only one string like "device.domain.local" but it wouldn´t work if it contains any space between the words (ex. device domain local). It seems like the quotes in the parameters are totally ignored.


Feb, 2016 - Permalink

Ah - can you try using single quotes instead of double quotes? And double double quotes, e.g. ""%device""" - does it work then?


Feb, 2016 - Permalink

it works only with apostrophes


Sep, 2016 - Permalink

Well, that took quite some time ;) Please open up a support ticket, we can solve it better that way.

Thanks!


Sep, 2016 - Permalink