What is this?

This knowledgebase contains questions and answers about PRTG Network Monitor and network monitoring in general.

Learn more

PRTG Network Monitor

Intuitive to Use. Easy to manage.
More than 500,000 users rely on Paessler PRTG every day. Find out how you can reduce cost, increase QoS and ease planning, as well.

Free Download

Top Tags


View all Tags

Alert when the status of a Windows Failover Cluster node is not 'Up'

Votes:

0

We are using Windows Failover Clusters and would like a sensor to alert when a node is not 'Up' (eg: Paused or Down).

We've previously had a Custom EXEXML sensor working for this, using a custom lookup (state 1 is OK), but it no longer works...

param (
    [string]$server
    )
$s = New-PSSession $server
Invoke-Command -Session $s -Scriptblock {
$nodes = Get-ClusterNode
Write-Output '<prtg>'
foreach ($node in $nodes){
Write-Output '<result>'
Write-Output '<channel>' + $node.Name + '</channel>'
Write-Output '<value>' + (&{If($node.State -ceq 'Up') {1} else {0}}) + '</value>'
Write-Output '</result>'
}
Write-Output '</prtg>'
}
Remove-PSSession $s

Any suggestions?

custom-sensor exexml powershell ps windows-failover-cluster

Created on May 3, 2023 11:01:56 PM



3 Replies

Votes:

0

Hi Josh,

Thank you for the post, if you execute the ps1 on the probe what is the current output?

Do you see an error in the overview and logs page of the sensor?

Regards, Oscar

Created on May 4, 2023 1:51:12 PM by  Oscar Chavarria [Paessler Technical Support]



Votes:

0

Thanks for the response Oscar. The response in PS is; <prtg> <result> <channel> + ServerNode1 + </channel> <value> + 1 + </value> </result> <result> <channel> + ServerNode2 + </channel> <value> + 1 + </value> </result> </prtg>

It seems to be returning the node names (ServerNode1 & 2) & a status (1) in the output, however, it's also putting a '+' before and after each result...

UPDATE: I went through the script and saw the reason it wasn't working... Removed the '+' in the script and hey presto, it works. Funny how you can look at something for so long and completely miss what is right in front of your face :)

Created on May 8, 2023 2:57:33 AM



Votes:

0

Hi Josh,

Great catch, thanks for letting us know.

Regards, Oscar

Created on May 8, 2023 2:16:49 PM by  Oscar Chavarria [Paessler Technical Support]




Disclaimer: The information in the Paessler Knowledge Base comes without warranty of any kind. Use at your own risk. Before applying any instructions please exercise proper system administrator housekeeping. You must make sure that a proper backup of all your data is available.