1

I have created a Powershell script that emulates a telnet connection to an SMTP Server, the purpose of this is to check our SMTP gateway server to see if there is issue with sending mail. The script works the way I want it to and I have a good guild about using Powershell scripts in SCOM using the authoring console, what I am stuck on is how to trap the fact that when I send the helo command down and it takes longer that 10 seconds to respond and send an alert.

Any help with this would be greatly appreciated

If anyone knows of a better way of doing this then please let me know as I tend to think that how I have approached this is a bit convoluted. But I am pretty new to SCOM and still getting a feel for how things work.

Sim
  • 1,858
  • 2
  • 17
  • 17
enterzero
  • 453
  • 6
  • 15
  • doesn't scom have a builtin management pack for smtp? – tony roth Apr 01 '11 at 04:55
  • It has one for Exchange but we use a different SMTP server as our Gateway. And I have not found a management pack for it, granted I have not look for a general SMTP one that does what I want. We are just doing basic port check using a TCP management pack to make sure we can make connections but it does not do what I am after. – enterzero Apr 01 '11 at 05:10
  • do you really see helo responses taking more then a sec or two? – tony roth Apr 03 '11 at 00:26
  • I have seen it now and again if the SMTP in processing a lot of messages for transport. We are running this on Windows use an SMTP server that I only heard about recently. – enterzero Apr 03 '11 at 23:10
  • hmm have you seen a nagios based smtp monitor that would do the job? If so I'd just copy what it does. – tony roth Apr 04 '11 at 02:47
  • No I have not but I will have a look and see if it will suit my needs. Thanks – enterzero Apr 05 '11 at 01:55

1 Answers1

1

Taking longer then 10 seconds to respond actually gives you more to monitor and that could actually be good. I would avoid wrapping telnet directly if you can avoid it as it can be done nicer in powershell.

Have a look at these two. I am sure you could put them both together so that when you make the call you timeout after your max acceptable time and return this as a performance or availability warning/critical in a monitor.

http://powershell.com/cs/media/p/357.aspx

https://stackoverflow.com/questions/4650913/how-to-timeout-powershell-function-call

Also remember you also have the <TimeoutSeconds>...</TimeoutSeconds> property of PowerShell probes that you can use too. If you want to use that then you should set it to the max acceptable time and then follow it with a ConditionDetection module in your datasource to catch no data and flag this as an issue.

Hope that helps.

Bernie White
  • 1,024
  • 7
  • 17