New Question
 
 
PRTG Network Monitor

Intuitive to Use.
Easy to manage.

200.000 administrators have chosen PRTG to monitor their network. Find out how you can reduce cost, increase QoS and ease planning, as well.

Free PRTG
Download >>

 

What is this?

This knowledgebase contains questions and answers about PRTG Network Monitor and network monitoring in general. You are invited to get involved by asking and answering questions!

Learn more

 

Top Tags


View all Tags


Custom Notification doesn't run PS script

Votes:

0

Your Vote:

Up

Down

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?

custom-notification execute-program powershell

Created on Apr 15, 2016 8:33:41 AM by  TDV (60) 1 1



Best Answer

Accepted Answer

Votes:

1

Your Vote:

Up

Down

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!

Created on Jun 1, 2016 8:11:06 AM by  TDV (60) 1 1

Last change on Jun 6, 2016 5:56:44 AM by  Luciano Lingnau [Paessler Support]



4 Replies

Votes:

0

Your Vote:

Up

Down

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,

Created on Apr 18, 2016 10:34:59 AM by  Luciano Lingnau [Paessler Support]

Last change on Jul 11, 2016 9:04:24 AM by  Luciano Lingnau [Paessler Support]



Votes:

0

Your Vote:

Up

Down

Hi

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

Or this settings don't work?

Created on Apr 18, 2016 12:57:24 PM by  TDV (60) 1 1



Votes:

0

Your Vote:

Up

Down

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,

Created on Apr 19, 2016 8:03:03 AM by  Luciano Lingnau [Paessler Support]



Accepted Answer

Votes:

1

Your Vote:

Up

Down

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!

Created on Jun 1, 2016 8:11:06 AM by  TDV (60) 1 1

Last change on Jun 6, 2016 5:56:44 AM by  Luciano Lingnau [Paessler Support]



Please log in or register to enter your reply.


Disclaimer: The information in the Paessler Knowledge Base comes without warranty of any kind. Use at your own risk. Before applying any instructions please exercise proper system administrator housekeeping. You must make sure that a proper backup of all your data is available.