Private Function MonitorMAILSERVER() Dim connInfoMAILSERVER As New Renci.SshNet.PasswordConnectionInfo("MAILSERVER", "username", "password") Dim sshClientMAILSERVER As New Renci.SshNet.SshClient(connInfoMAILSERVER) Dim queueMAILSERVER As Renci.SshNet.SshCommand Using sshClientMAILSERVER sshClientMAILSERVER.Connect() queueMAILSERVER = sshClientMAILSERVER.RunCommand("/usr/sbin/postqueue -p | tail -n1 | awk '{print $5}'") txtMAILSERVER.Text = queueMAILSERVER.Result sshClientMAILSERVER.Disconnect() End Using If queueMAILSERVER.Result >= 20 Then imgMAILSERVER.Image = Mail_Queue_Monitor.My.Resources.red Else imgMAILSERVER.Image = Mail_Queue_Monitor.My.Resources.green End If End Function
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)