I'm struggling with this as well.
My problem is that occasionally, the external load balancer will get "confused" and send all traffic to just one backend app server which is exactly what I want to monitor in PRTG.
I have a PS script that does the trick and sends it off as an email, but unfortunately my PS & PRTG scripting skills aren't up to the level where I would be able to get it to provide the port established values in a sensor with channels.
Any advice would be much appreciated!
--------------------------------------------------------------
$servers = "server1", "server2"
$ports = 80, 443, 8080, 8081
foreach ($server in $servers)
{
$status += "Server: $server`n"
foreach ($port in $ports)
{
$count = Invoke-Command -ComputerName $server -ScriptBlock {
param(
[int]$port
)
(Get-NetTCPConnection -State Established -LocalPort $port).Count
} -ArgumentList $port
if (!$count)
{
$count = "None"
}
$status += "Port $port connections count: $count`n"
}
$status += "`n"
}
Add comment