Skip to content

Instantly share code, notes, and snippets.

Stephan Linke stephanlinke

  • Paessler AG
  • Nuremberg
Block or report user

Report or block stephanlinke

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@stephanlinke
stephanlinke / Module.ps1
Created Mar 28, 2019
Simple Setup with logging.
View Module.ps1
#region modules
$requiredModules = @("<modulname>")
$numbers = @{
2 = "two"
3 = "three"
4 = "four"
5 = "five"
6 = "six"
7 = "seven"
@stephanlinke
stephanlinke / PRTG-CheckCertificate
Created Dec 12, 2018
This will check the certificate of the given host for it's remaining days. Simply add it to PRTG as a EXE/Script (Advanced) Sensor and use -ComputerName <url-to-the-website>
View PRTG-CheckCertificate
param(
$ComputerName = "www.google.de",
[Parameter(ValueFromPipelineByPropertyName=$true)]
[int]$Port = 443
)
begin {
$ProtocolNames = [System.Security.Authentication.SslProtocols] | gm -static -MemberType Property | ?{$_.Name -notin @("Default","None")} | %{$_.Name}
View gist:6b3e9cb001755a9fb4a77c182ebd0f70
#parameters to set in exexml sensor: -target '%host' -instance 'name_of_instance'
param(
[string]$target = '10.0.0.133',
[string]$instance = 'SharePoint - 80'
)
$DataTable = New-Object System.Data.DataTable
@stephanlinke
stephanlinke / PRTG-GetResponseTime.ps1
Created Oct 9, 2018
Retrieve the response time for an incident (between sensor being down and acknowledged)
View PRTG-GetResponseTime.ps1
# This requires prtgapi to be installed:
# Install-Module prtgapi
#
# ignore unsigned TLS certificates
add-type @"
using System.Net;
using System.Security.Cryptography.X509Certificates;
public class TrustAllCertsPolicy : ICertificatePolicy {
public bool CheckValidationResult(
ServicePoint srvPoint, X509Certificate certificate,
@stephanlinke
stephanlinke / PRTG-FixDependencies.ps1
Last active May 13, 2019
Update Master Dependencies throughout PRTG
View PRTG-FixDependencies.ps1
# USE AT YOUR OWN RISK.
# This will reset the dependencies of all ping sensors to be the master object for their parent.
# Your PRTG Server's FQDN, i.e. prtg.acme.com
$PRTGServer = "prtg.acme.com"
# proper message output
Function This-ShowMessage([string]$type,$message){
@stephanlinke
stephanlinke / PRTG-IIS Aplication Pool.ps1
Last active Aug 15, 2018
It will basically do the same/retrieve the same metrics as the IIS App Pool sensor, but using a powershell script to do so. Here's what to do to get the custom sensor running. Installation details can be found at https://kb.paessler.com/en/topic/73440
View PRTG-IIS Aplication Pool.ps1
#parameters to set in exexml sensor: -target '%host' -instance 'name_of_instance'
param(
[string]$target = '10.0.0.133',
[string]$instance = 'SharePoint - 80'
)
$DataTable = New-Object System.Data.DataTable
@stephanlinke
stephanlinke / PRTG-SCVMM-HyperV.ps1
Created Jul 26, 2018
PRTG-HyperV - Monitor SCVMM host servers and virtual machines within PRTG
View PRTG-SCVMM-HyperV.ps1
#requires -version 4.0
# ___ ___ _____ ___
#| _ \ _ \_ _/ __|
#| _/ / | || (_ |
#|_| |_|_\ |_| \___|
# SCVMM & HyperV-VM Sensors
# ================================
# This sensor will monitor HyperV hosts and their virtual machines using SCVMM.
# It also supports metascan (https://kb.paessler.com/en/topic/68109), so you don't have
# to do all the configuration work. Note that this will only work in an upcoming stable release
@stephanlinke
stephanlinke / PRTG-GetAutoDiscoveries.ps1
Created Apr 11, 2018
Finds all configured auto discoveries in PRTG
View PRTG-GetAutoDiscoveries.ps1
[string] $ConfigurationFilePath = ((Get-ItemProperty -Path "hklm:SOFTWARE\Wow6432Node\Paessler\PRTG Network Monitor\Server\Core" -Name "Datapath").DataPath) + "PRTG Configuration.dat"
[xml] $configuration = New-Object -TypeName XML;
$configuration.Load($ConfigurationFilePath)
[System.Collections.ArrayList]$ADEnabledGroups = @();
[System.Collections.ArrayList]$ADEnabledDevices = @();
$Groups = ($configuration.SelectNodes("//group"))
$Devices = ($configuration.SelectNodes("//device"))
@stephanlinke
stephanlinke / PRTG-GetAutomaticServices.ps1
Created Apr 6, 2018
Read Status of automatic services on a given host
View PRTG-GetAutomaticServices.ps1
param(
[string]$computerName="",
[string]$IgnoreList = @("Dell Digital Delivery Service","Skype Updater", "Software Protection","Manager für heruntergeladene Karten"),
[string]$UserName = "",
[string]$Password = ''
)
$IgnoreScript = 'Google Update Service (gupdate)'
$IgnoreCombined = $IgnoreList + $IgnoreScript
@stephanlinke
stephanlinke / PRTG-ResumeNotifications.ps1
Last active Dec 14, 2017
Resume all notifications that are paused
View PRTG-ResumeNotifications.ps1
$prtgserver="";
$protocol="";
$port=80;
$user="";
$passhash="";
$configpath = "C:\ProgramData\Paessler\PRTG Network Monitor\PRTG Configuration.dat";
[xml]$Configuration = (Get-Content $configpath);
$Notifications = $Configuration.SelectNodes("//notification[@id]")
You can’t perform that action at this time.