5 Helpful Scripts For PRTG You Should Know
Originally published on October 26, 2018 by Sascha Neumeier
Last updated on August 31, 2021 • 7 minute read
PRTG Network Monitor provides you with a lot of different sensors to monitor your IT environment out-of-the-box. But just like in real life, the awesome parties are going down backstage. For sysadmins, this means that as soon as you start to automate things via scripts, you can do the real fancy-pancy things.
Are You Already Browsing Our PRTG Sensor Hub?
If you are familiar with terms like Gitlab and PowerShell, I strongly recommend you look at our PRTG Sensor Hub. There you will find a moderated collection of selected scripts for PRTG. The spectrum ranges from beginners (downloading scripts, embedding, running) to sophisticated extensions that require advanced programming skills. There is something for all of you! In case you don’t know what I am talking about, I recommend this article: Do you already know the PRTG Sensor Hub?
Today I want to look at five selected scripts with you.
#1 Using PRTG as a CMDB
Do you have dedicated software in your company that provides you with a CMDB (Configuration Management Database)? If no, the attached script will help you to process the system information collected by PRTG. As a result, you have extensive Excel pivot tables available, which can be used for different use cases like:
- Find devices that have a specific service running
- Get a list of device names and serial numbers
- Find windows servers that have a specific application installed (or not installed)
- Inventory number of Windows licenses needed
You can find all information about the script including the download at gitlab.com.
#2 Pausing PRTG Devices from the Windows Server Desktop
Extensive IT environments are often managed by several administrators. Not all admins necessarily have full access to PRTG. The script PRTG-DesktopPauseButton creates icons on the desktop of Windows devices. All sensors set up in PRTG for the specific device can be conveniently paused or restarted by double-clicking on the icon. This eliminates the need to put the corresponding devices into maintenance mode via the PRTG software, and allows area administrators to work flexibly. The script as well as further information is available for download at gitlab.com.
iPlease note: This script leaves the PassHash in a link on the local machine.
If you use this script, be aware of this fact and protect your local machine against unauthorized access.
#3 Monitor Your Microsoft Office 365 Tenant Service Status
Microsoft's Office 365 product family is a collection of different services hosted on numerous servers. To determine the status of individual Office 365 applications, Marc uploaded a PowerShell script to GitHub and described the configuration in detail in his blog. You can download the script from GitHub. The installation and configuration information is in German, so you might have to translate the text into your language through your browser.
#4 Manage PRTG with Powershell
Have you ever wished to be able to use PRTG directly via PowerShell? Well, we already asked you about a PRTG CLI at the beginning of the year - the survey showed that some of you would like to use PRTG with text commands - but currently we don't offer an out-of-the-box solution. The powerful C#/PowerShell library called PrtgAPI can help.
PrtgAPI implements a collection of types, methods and cmdlets that help create and execute the API requests required to interface with PRTG. Upon executing a request, PrtgAPI will deserialize the result into an object (Sensor, Device, Probe, etc) containing type safe properties appropriate for the given data type. You will find further information including the download on GitHub.
#5 Active Directory User Lockout Script
Indeed, there is also a script to monitor user accounts within Active Directory using PRTG. Utilizing a PowerShell Custom Sensor, combined with this script by Florian Rossmark, you can query data about disabled, expired or locked-out users directly from Active Directory and display it in PRTG. For such queries, an AD user with read privileges is sufficient. You will be amazed at how much data your Active Directory reveals even without admin rights. All details including the complete PowerShell script can also be found in the blog it-admins.com.
iPlease note: We have carefully checked and selected these scripts, but as they are not part of PRTG they are not officially supported by PRTG Tech Support.
Do you have a PRTG related script you want to contribute? Perfect! Just make it available on Github and share it with us using the “Submit Your Script” button in our PRTG Sensor Hub. We are excited to receive your feedback!