Introduction
This sensor allows you to monitor the software version of your ProCurve switches and shows the model information in the sensor message. Version is divided into Major, Minor, and Patchlevel. Feel free to set limits accordingly to find old versions. Recommended sensor interval is 24h.
Please have a look at our guide for installing PowerShell based sensors for installation details.
Requirements
Needs snmpget.exe within the EXEXML directory, which can be obtained via
https://www.snmpsoft.com/cmd-tools/snmp-get/
Parameters
Parameter | Type | Description |
---|---|---|
TargetHost | String | The host address of the target appliance (can be set to %host) |
Port | Integer | The used SNMP port, defaulting to 161 |
Community | String | The SNMP community, defaulting to public |
Oids | String[] | The OIDs for the software version and the system info (model name, etc.) |
Version History
Date | Version | Notes |
---|---|---|
November 30rd, 2016 | 1.0 | Initial Release |
Script
# ___ ___ _____ ___ #| _ \ _ \_ _/ __| #| _/ / | || (_ | #|_| |_|_\ |_| \___| # NETWORK MONITOR #------------------- # Description: This sensor will show the software version (major, minor, patch) and model information # Parameters: # -TargetHost: The host address of the target appliance. Using %host within PRTG will work. # -Port The used SNMP port, defaulting to 161 # -Community The SNMP community # -Oids The OIDs for the software version and the system info (model name, etc.) # # Requirements # ------------------ # - needs snmpget.exe within the EXEXML directory (can be obtained via https://www.snmpsoft.com/cmd-tools/snmp-get/) # # Version History # ------------------ # Version Date Notes # 1.0 11/30/2016 Initial Release # # ------------------ # (c) 2015 Stephan Linke | Paessler AG param( [string]$TargetHost = "localhost", [int]$Port = 161, [string]$Community = "public", [string[]]$Oids = @("1.3.6.1.2.1.47.1.1.1.1.9",".1.3.6.1.2.1.47.1.1.1.1.2.1") ) $Result = @" <?xml version="1.0" encoding="UTF-8" ?> <prtg> <result> <channel>Major Version</channel> <value>{0}</value> </result> <result> <channel>Minor Version</channel> <value>{1}</value> </result> <result> <channel>Patch Level</channel> <value>{2}</value> </result> <text>{3}</text> </prtg> "@ function getOid([string]$Oid){ $pinfo = New-Object System.Diagnostics.ProcessStartInfo $pinfo.FileName = "C:\Program Files (x86)\PRTG Network Monitor\Custom Sensors\EXEXML\snmpget.exe" $pinfo.RedirectStandardError = $true $pinfo.RedirectStandardOutput = $true $pinfo.UseShellExecute = $false $pinfo.Arguments = [string]::Format("-r:{0} -p:{1} -t:10 -c:{2} -o:{3} -q", $TargetHost, $Port,$Community, $Oid); $p = New-Object System.Diagnostics.Process $p.StartInfo = $pinfo $p.Start() | Out-Null #Do Other Stuff Here.... $p.WaitForExit() return $p.StandardOutput.ReadToEnd(); } $Version = (getOid -oid $Oids[0]).Split("."); $SysInfo = (getOid -oid $Oids[1]); Write-Host ([string]::Format($result, $Version[0], $Version[1], $Version[2], $SysInfo));
Notes
The script is provided as is and may or may not work with your installation. If you need any further customizations for your environment, feel free to implement them. If you encounter any bugs, feel free to share them :)
Add comment