I don't mind sharing. Just too bad I cannot remember what installation I actually put that on to get the exact code
But, few minutes on notepad, something like this should work out as a starting point. Should be pretty straight forward to add in additional service checks.
$target1 = "<primary IP address>"
$target2 = "<secondary IP address>"
$targetapp1 = (get-service -ComputerName $target1 -name 'MSSQLSERVER').Status;
$targetapp2 = (get-service -ComputerName $target2 -name 'MSSQLSERVER').Status;
if ($targetapp1 -eq 'Running')
{write "Statistic.appstatus: 0";
write "Message.appstatus: $targetapp1";}
elseif ($targetapp2 -eq 'Running')
{write "Statistic.appstatus: 1";
write "Message.appstatus: $targetapp2";}
else
{write "Statistic.appstatus: 2";
write "Message.appstatus: $targetapp1";}
exit (0);