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?


Article Comments

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.


Sep, 2013 - Permalink

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.


Sep, 2013 - Permalink

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.


Sep, 2013 - Permalink

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.


Sep, 2013 - Permalink