Hi

I created custom notification that should run powershell script and script writes some information to file on disk. This notification works when I click "Test" (in Account Settings - Notifications) - it creates file on disk. But it doesn't work when I set up notification for sensor - it doesnt create file on disk when sensor in down state. In sensor log I see messages: "State Trigger activated" "State Trigger sending EXE"

I set up notification run under windows account that have admin rights on PRTG core server.

Also the same ps script works fine when I use it in EXEsensor. (That notification and EXEsensor pass placeholders (%device and %sensor) to script.)

How can I find out cause of the problem? Is there some log files in PRTG?


Article Comments

Hello,
we appreciate your contact.

Notifications are "run" by the "PRTG Core Server Service", please try running this service with a different account(A local or domain admin account) instead of LOCAL SYSTEM ACCOUNT. Once you run the service as a "real" user, you may also omit the credentials configured under the notification (leave it blank).

You should also double check that you're using quotes (preferably single-quotes) to every parameter(Placeholder) sent to the script, allowing the script to correctly read the parameters even if they contain spaces (e.g. '%device' will result in 'My Device Name'). Please note that if you have devices which contain quotes in the name (e.g. "Customer's Network" this may cause issues).

As for troubleshooting, you should definitively give with Microsoft's Process Monitor a try, just set your filter in a way that it monitors the activity of your script, powershell and the Core Server, it will allow you to review the EXACT command-line that PRTG is passing to the script.

Best regards,


Apr, 2016 - Permalink

Hi

But I set up notification to run under windows account obviously (in notification settings): settings

Or this settings don't work?


Apr, 2016 - Permalink

Hello TDV, thank you for your reply.

Yes, that setting should work in most cases, but depending on the script or how the (Windows) environment was set-up it may not work, in that case remove the credentials from there and configure the "PRTG Core Server Service" to run with the desired account.

Best Regards,


Apr, 2016 - Permalink

Hi It turned out that problem was not in user account but in double quotes in Parameter field: %device "%sensor" I changed them on single quotes: %device '%sensor' and now its works!


Jun, 2016 - Permalink