I'm looking to have PRTG log a ticket on a Kayako system when a sensor goes down. There are multiple sites being tracked by PRTG and I'm aiming to get it to log a ticket as the appropriate site. (I have access to both ends of this system so will investigating options from both directions)

We've other systems doing this where we've been able to spoof the from address or specify a reply-to address so the email will log as specific user account, but I can't see this as an option for PRTG.

Is this possible or am I barking up the wrong tree?


Article Comments

Maybe this script would be a viable option? You'll have to add the reply address to the mail object of course :)


Apr, 2016 - Permalink

That looks promising, thank you!

Looks as though I'll be able to use the comment field to assign an email address to each group or sensor and pass that along.


Apr, 2016 - Permalink

Note that the comments field has Comments: prefixed to it, you'll have to strip that first :)

 $email.To.Add($mailTo.replace("Comments :",""))

Apr, 2016 - Permalink

It's actually the from or reply-to address I want to set using the comment, but your example got me 99% of the way there - thank you!

With the linked script, the body was always "0" - changing the following line seems to have fixed it

$email.Body = [string]::Format("{0}",$body);

(added quotes around {0})

I'm still just testing from PowerShell but it's looking very promising


Apr, 2016 - Permalink

Hi Greg,

Thanks for the headsup, I fixed the code in the other thread :) Glad to hear that we got you covered here. Let me know if you run into any PowerShell trouble :)


Apr, 2016 - Permalink

Ok, script is working when triggered as a test, but not from a real sensor

Will work from a real sensor if I strip out all placeholders and manually type the parameters

Any suggestions? Are their certain placeholders I should/shouldn't use?

I'm eventually hoping to be able to use something similar to the following: '%device - PRTG Alert' '%name has been flagged by PRTG' %commentsdevice

(There are less parameters as I manually specified the SMTP server and destination in the script - now just "Subject, Body, From")


Apr, 2016 - Permalink

Can you put %commentsdevice in single quotes as the rest of the params? Just to make sure, because there are whitespaces in this placeholder.


Apr, 2016 - Permalink

I was testing with %device for all fields and would have sworn I tried single quotes - guess I didn't.

That works fine for '%device' and '%name' (with and without accompanying text) '%commentsdevice' works in the body, but has line breaks and slightly different text to what we were replacing

{{{Device Comments

address@domain.net}}}

I've updated the .replace part of script and run it through .Trim() to remove the line breaks (I'm sure there's a much better way of doing that) $from = $from.replace("Device Comments","") $from = $from.Trim() ...and it seems to be working

Thank you very much for your help and patience.


Apr, 2016 - Permalink

Nice that it works in the end :) You should be able to do it in one line iirc:

$from = $from.replace("Device Comments","").Trim();


Apr, 2016 - Permalink