I am looking for a way to pause and restart PRTG sensors during system patching or other maintenance, as part of automated script. I could not find any related reference, if it is possible.
Thanks in advance. DJ
Article Comments
PTF.PRObject
This is now possible with new command line tool PRObject.exe
This command line tool can pause, resume or "checknow" any sensor, device, group, probe, notification,... of your PRTG installation.
Parameters:
-u= The url of your PRTG installation. -un= PRTG Username. -pw= PRTG Password or PassHash *. -id= The ObjectID you want to pause, resume, or check now. -a= The action to perform (p for pause, r for resume, c for checknow). -s Optional switch to suppress the textual output.
Example to pause object 1001
PRObject -u=yourPRTGServer -un=myuser -pw=mypassword -id=1001 -a=p
If an error occurs error level 1 is returned.
The tool can be downloaded here.
Jun, 2012 - Permalink
Hi
I'd like to use this utility to pause monitoring during scheduled reboots of servers.
Can you pause a sensor for a period of time (eg 5 minutes) rather than pause indefinitely? (This will save having to run the script again when the server starts to resume monitoring.)
Also how do you determine the ObjectID? (I've been viewing the xml page and extracting the ObjectID from there. Is there an easier way?)
Thanks Jon
Nov, 2012 - Permalink
The download URL seems to be broken.
But now to be found @ http://prtgtoolsfamily.com/downloads/download/ef3c31fb-1f7f-40bf-b726-ac1cbf73d59f.
If also broken, try: https://www.google.nl/search?q=prtg+probject.exe+download&gws_rd=ssl ... :-)
May, 2015 - Permalink
Has anyone this running against a PRTG server reachable using https only?
I get the error "The request was aborted: Could not create SSL/TLS secure channel." when running PRObject.exe
Dec, 2015 - Permalink
Hi 2CollegeICT,
The error "Could not create SSL/TLS secure channel" unusually indicates a wrong username/password combination.
Please copy the URL after the -u= parameter in you internet browser and make sure it connects to your PRTG server. Next type the username and password as you supplied with the -un= and -pw= parameters, does this open your PRG interface?
Dec, 2015 - Permalink
hmm, typo.
The error "Could not create SSL/TLS secure channel" usually indicates a wrong username/password combination.
Dec, 2015 - Permalink
Thanks for the quick reply.
The -u URL gets me to the login interface. But I received a PassHash instead of PassWord from our PRTG admin. That combination is not accepted in the login interface.
However, that combination I got I could verify with <<url as in -u>>/api.htm?username=<<UserNameas as in -un>>&passhash=<<PassHash as in -pw>>
Have I used the -pw options incorrectly? How to use PassHash in stead of PassWord with -pw?
Dec, 2015 - Permalink
Hi 2CollegeICT,
Ok, I understand the confusion. The native PRTG PassHash cannot be used with the sensor. Only passhashes created with the passhash tool are supported.
The tool can be downloaded here
Dec, 2015 - Permalink
Ah, thanks! Got it working now! (Would have voted for your answer, but my reputation doesn't allow it (yet))
Dec, 2015 - Permalink
Something like the follows works for me.
/api/pauseobjectfor.htm?id=8645&duration=30&pausemsg=auto_paused_for_server_maint&username=prtgadmin&passhash=1112233445
I am about to add this so i can automatically pause servers before automatically rebooting after applying windows updates.
Feb, 2016 - Permalink
I have update my Powershell PRTG Admin module to handle pausing of devices. You can now:
- Pause a device/sensor, for a given timeframe, with a message
- Pause This Device (looks at the servers IP/hostname, finds it in PRTG, then pauses with timeframe and message)
- Resume This Device
The last 2 are great and pausing before windows updates.
I have written up all the details here: https://thedomainiown.wordpress.com/prtg-related/pause-a-sensor/
Mar, 2016 - Permalink
Hi,
I'm afraid it is not possible to pause sensors from the command line. PRTG only has an HTTP API so you can pause sensors via HTTP request. For details on the API, please see this manual section.
For example, in combination with cURL, you could trigger PRTG's HTTP API calls from command line.
Best regards
Jun, 2012 - Permalink