Pinging Servers in DMZ

rated by 0 users
This post has 5 Replies | 3 Followers

Top 500 Contributor
Posts 6
PareshMotiwala Posted: 03-05-2012 2:12 PM

do we have anyone who has tested dmz servers and send out an alert if the ping fails?

Top 10 Contributor
Posts 640

Sorry, I'm completely not understanding the PowerShell question that you're trying to ask. Could you try rephrasing?

PowerShell isn't a monitoring/alerting solution - if you're looking for something to periodically ping a server and send an e-mail if the ping fails, I don't think PowerShell is a good solution. It's physically possible, but it's really not ideal.

Top 500 Contributor
Posts 6

sorry, My apologies if I did not do a good job explaining.

I have two servers in DMZ(across the firewall from our domain). Sometimes they can go offline or their Web Service could shut down, we just need to be able to find it before customers do.

I was hoping there was some way in which Powershell can help us do that.

Thank you in advance for any information.

Regards

Paresh Motiwala

Top 10 Contributor
Posts 640

PowerShell isn't a monitoring solution, and isn't a good fit for this. You should look into even a simple IP monitoring tool that can run continuously and send alerts. 

 

Top 10 Contributor
Posts 323
Microsoft MVP
Top Contributor

You have options!

Like Don says, there are better monitoring solutions out there (eg System Centre Operations Manager, etc).

Having said that...  you can use PowerShell and task schedulter to achieve this!

Suppose you have a file of the computer names you want stored in Computer.Txt

Then:

$computers = get-content Computer.txt

foreach ($computer in $computers) {

    $con = test-connection $computer -ea silentlycontinue

    If (!$con) { " connection failed to $computer" ; return}

    $ok = 0; foreach ($c in $con) {if ($c.status -eq 0) {$ok++}

    if  ($ok -lt 4) { "Connection to $computer only succeeded $ok out of 4 times") 

    else { "Connection to $computer is OK"}

}

 

You can obviously extend this a bit to pipe the output someowhere, count how many systems do not respond, etc.


NExt, just use the WIndows task scheduler to run this task say every hour or whatever the right interval is. Avoid running it continously as that can generate a lot of CPU on the monitoring system and the systems being monitored and would generate bandwidth between teh monitoring and monitored systems.

 

HTH

 

Top 50 Contributor
Posts 36

I would recommend HP SIM.

a free monitoring solution from HP.

it works on non hp hardware as well.

 

Page 1 of 1 (6 items) | RSS
Copyright 2012 PowerShell.com. All rights reserved.