What is this?

This knowledgebase contains questions and answers about PRTG Network Monitor and network monitoring in general.

Learn more

PRTG Network Monitor

Intuitive to Use. Easy to manage.
More than 500,000 users rely on Paessler PRTG every day. Find out how you can reduce cost, increase QoS and ease planning, as well.

Free Download

Top Tags


View all Tags

Execute program using powershell (db : mysql)

Votes:

0

I've tried hundreds of times to try powershell script using execute program.

When the sensor is down washed over, this value is inserted into the db.

This work is well inserted, but parameter values is null....

What I have to do ?

Please help me.....

T.T

Note that the environment variable settings rewrote, and I set parameters in execute program are %device %status %down %sensor (%message)

The powershell script content is

param($message) mysql --host xx.xx.x.xxx --port 3306 xxxxx --user=xxxx --password=xxxx -e "$query"; $query="INSERT INTO em_tran (tran_phone, tran_callback, tran_status, tran_msg, tran_type) VALUES ('010-000-0000', '010-111-0007', '1', '$message', '4');"

What is wrong?

execute-program notifications powershell

Created on Jul 7, 2016 2:31:48 AM



1 Reply

Votes:

0

Try "%device %status %down %sensor (%message)" as parameters, including the quotes. Does that work? Because currently, only one parameter is passed to the script, which is %device.

Created on Jul 8, 2016 11:32:24 AM by  Stephan Linke [Paessler Support]




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.