Automating PRTG To Add Devices And More With PowerShell


We use PRTG to monitor a variety of things within our district. It is a good program, but it has been tedious to work with to add and modify devices, groups and sensors manually or using the custom template Auto Discovery in the GUI because Paessler has not officially supported Powershell. Disclaimer 1: I did not write this module, I am just writing about it. In this post I am just going to go over getting the module, what it has in it, and some caveats to using it. In my next post I am going to go over a situation we had that I needed to recreate over 40 devices and sensors in a limited amount of time.

A blog post on the Paessler site from January 2019 has the following disclaimer about the PrtgAPI module for PRTG on the site:

Disclaimer: PrtgAPI is developed by an independent PRTG user. As the solution described in this post is not part of PRTG itself, it is not officially supported by Paessler or PRTG Technical Support.

Reading the post that this came from I am learning the Powershell commands in the PrtgAPI module. You can read more about the module and get it in the PowerShell Gallery.

You can install it through Powershell by using the following command

  • Install-Module -Name PrtgAPI

Once you have the module installed there is one caveat that I found while using it with my normal Powershell profile. That caveat is that you cannot use Exchange or Office365 modules at the same time because when the PrtgAPI was written in 2015 the author did not use an unique verb-noun structure. That means that cmdlets like Get-Group overlap with Exchange cmdlets. What I do is comment out my profile that loads all my other modules when I want to work on PRTG. Not the most elegant solution, but it works.

Here are the commands within the module by using the Get-Command cmdlet. Below is just a small sample.

PS C:\Powershell> get-command -Module PrtgAPI

Command TypeName
AliasAcknowledge-Sensor
AliasAdd-Trigger
AliasNew-Trigger
FunctionNew-Credential
CmdletAdd-Device
CmdletAdd-Group
CmdletAdd-Sensor
CmdletApprove-Probe
CmdletConnect-PrtgServer
CmdletCopy-Object
CmdletDisconnect-PrtgServer
CmdletGet-Device
CmdletGet-Object
CmdletGet-Probe
CmdletGet-PrtgStatus
CmdletGet-PrtgTree
CmdletGet-Sensor

Go ahead and install the module, then give it a quick test drive to see what each cmdlet can do by using Get-Help for some of the cmdlets. In the next post I will go over adding a Group and the adding devices, and sensor. Cya then, and don’t forget to like this post!

Azure in 2021 – John Savill


Here is a great video for Learning Azure in 2021. I also suggest that you subscribe to his YouTube channel. I’ve been watching for some time and the breadth of what is covered is amazing. I believe you will find something that will help you, as I have in studying for my MS certifications.

Enjoy

Shout Out Wednesday


As I have been doing my training and prep for getting my Azure Certifications I have tapped a lot of sources. Today I want to shout out one of those sources. I’m always looking for interesting classes, videos and training. A big thing in my learning process is I like to go into detail , while I also like an good presentation that is personal and easy to listen to.

An example of someone who does both well and is so easy on the listen is John Savill. He has the blog, a YouTube Channel, Twitter, PluralSight (one of my favorite sites), and the list goes on and on. One of the big things I like about John’s work is that while he does Azure, he does other things, and keeps it light. I used a lot of different sources for my AZ-900 prep that were all very in depth and gave me the breadth of knowledge to pass the test, but John’s one hour cram session was the topper that gave me the clear head to get it done. Please stop by and check out his library and sites. You won’t be disappointed.