<div dir="ltr">Guys<div><br></div><div>I thought some of you might find this useful.  It's an implementation of the "xymon" client program written in 6 lines of Powershell,  It lacks the ability to wait for data returned by the Xymon server, but it's fine for sending status and data messages.</div>

<div><br></div><div><div>param($xymsrv=$(throw "ERROR: Specify xymon server and message lines"))</div><div>$socket=(new-object System.Net.Sockets.TcpClient($xymsrv,1984))</div><div>$writer=new-object System.IO.StreamWriter $socket.GetStream()</div>

<div>if ($args[0] -eq "@") { foreach ($line in Get-Content $args[1]) {$writer.Write($line+"`n")} }</div><div>else { foreach ($line in $args) {$writer.Write($line+"`n")} }</div><div>$writer.close()</div>

</div><div><br></div><div>You could run it like this:</div><div><br></div><div><div>C:\>powershell -file xymon-powershell.ps1 %XYMSRV% "status %COMPUTERNAME%.mytest green %DATE% %TIME%" "The status of 'mytest' is 'satisfactory' at %DATE% %TIME%" "" "here's the last line"</div>

</div><div><br></div><div>or if you have the status/data message in a file:</div><div><br></div><div>C:\>powershell -file xymon-powershell.ps1 %XYMSRV% @ statusfile.txt<br></div><div><br></div><div><br></div><div>Cheers</div>

<div>Jeremy</div><div><br></div></div>