Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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.

share|improve this question
    
doesn't scom have a builtin management pack for smtp? –  tony roth Apr 1 '11 at 4: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 1 '11 at 5:10
    
do you really see helo responses taking more then a sec or two? –  tony roth Apr 3 '11 at 0: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 3 '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 4 '11 at 2:47
show 1 more comment

1 Answer

up vote 1 down vote accepted

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

http://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.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.