Ping Servers in DMZ

Let's say in a situation you need to check the connectivity of few servers in DMZ from your management server.

Scenario: You have 20 Servers running in your DMZ network. You need to check connectivity of these servers everyday or once a week to make sure they are up and running. The manual process would be:

1. From your working computer you log on to your Management Server from which you can ping these servers. You use RDP to connect to Management server.


2. Ping each_server and get response from Management Box.

To avoid manual process you can use PSEXEC from
http://www.sysinternals.com/ to do so.

This is how you do it:

You know these servers are in DMZ and can be pinged only from Management Server. You use a simple script to do so:

For one server you can use the following:

PSEXEC
\\management_server ping server_in_dmz > c:\PingResponse\Response.txt

For more than one server you use the following:

1. A server.txt file to put all the servers in it.
2. A CMD or BAT file to ping all the servers and store their result in %server_name%.txt file.

***Start***

@echo off
Check Servers Ping Response in DMZ network.

set srvlist=servers.txt
rem -----------------------------------

cls
echo.if not exist "%srvlist% (
echo Can't find Server List file: %srvlist%
pause>nul
goto:EOF
)

echo Processing all Servers..........
echo.
for /f "tokens=* delims=AU" %%m in (%srvlist%) do call:checknow "%%m"

goto:EOF

:checknow

set srvname=%~1set srvname=%srvname: =%
psexec.exe \\management_server ping -w 1000 %srvname% > C:\PingResponse\%srvname%.txt

goto:EOF

:eof

***End***

Published Sun, Jan 28 2007 21:47 by Nirmal
Filed under:

Comments

# storage area networks

When designing ones data center cabling infrastructure there are several drivers that factor into the decisionmaking process including standards.

Wednesday, January 07, 2009 4:16 AM by storage area networks

# Everything About The Best Laptops

I personally believe that no best laptop can be universally recognized by all users as long as there are so many manufacturers that produce computers...

Wednesday, January 07, 2009 5:31 PM by Everything About The Best Laptops

# national credit fixers

I enjoyed this post - thank you for sharing it with everyone!

Saturday, August 29, 2009 12:17 AM by national credit fixers

Leave a Comment

(required) 
(required) 
(optional)
(required) 
If you can't read this number refresh your screen
Enter the numbers above: