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

Executing Shell Script

Votes:

0

This situation warrants several questions. My organization would like to shut down Unix servers when our data center UPS run time falls below a certain level. We would like to try to use PRTG for this. I've thought of a few solutions but all seem to have roadblocks. One avenue I am unsure of. I'm thinking I can use the custom shell script sensor to run a script on the local Unix box. The roadblock I have is telling that custom shell script sensor when to scan. This leads me to my question...

Is there a way to set custom scanning intervals not based on time? In other words, can I tell a sensor to scan when another sensor moves to a down state?

custom-sensor shell unix

Created on Sep 6, 2013 5:49:51 PM



4 Replies

Votes:

0

Another way might be to use something like plink on the Windows system to run the command. Then you can write a .bat script to run the command via plink and then set up a notification to run the batch when the UPS is at that level with channel limits.

If you want to have another sensor scan if the plink option isn't going to work, you could use the API to perform a scannow /api/scannow.htm?id=objectid and set this up in the notification for the HTTP Action.

Created on Sep 7, 2013 11:25:09 AM by  Greg Campion [Paessler Support]



Votes:

0

Greg,

I went the route you suggested with PLINK and it works wonderfully, with one exception... the PRTG notification won't run the script. I have changed the core server service to run under an admin account instead of system and testing it through the notifications page still is not working.

Any ideas?

Thank You.

Created on Sep 9, 2013 2:29:35 PM



Votes:

0

Have you tried specifying the script itself to run with domain admin credentials in the notification itself and not have the service running with an admin account?

Also, I had an issue like this one other time with plink and first the session has to be made with Putty and the certificate accepted then plink can make the connection without issue.

Created on Sep 9, 2013 3:31:22 PM by  Greg Campion [Paessler Support]



Votes:

0

Thank you Greg, turns out it was the certificate. I had to run the script while remoted into the PRTG server with the account I am using to run the script and choose yes on the certificate prompt. Worked fine after that.

Created on Sep 9, 2013 3:33:45 PM




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.