ping computer in another domain

November 24, 2011 at 05:41:15
Specs: Windows 7
i need to know when a computer shutdown. Is a windows xp. Is in another domain. I cant use VPN.

somebody knows a software that alert me (example: by email)?

or any other idea?


See More: ping computer in another domain

Report •


#1
November 24, 2011 at 07:24:22
If you have a linux or UNIX box running in that network, I can give you a script you could run on that linux/UNIX box that will test for connectivity and email you if it goes down.

I suspect a good DOS batchfile writer could do the same thing for you but I'm not a good DOS batchfiler so I can't.

It matters not how straight the gate,
How charged with punishments the scroll,
I am the master of my fate;
I am the captain of my soul.

***William Henley***


Report •

#2
November 24, 2011 at 09:13:47
ok, give it to me!! i will install a linux

thanks!!!


Report •

#3
November 24, 2011 at 12:09:05
Ok, here it is:

******Begin Script******

# Filename: checkip
# Purpose:  continuously tests a network connection as per crontab settings
# crontab is set as follows:
# 0-59/1      6-18    *       *       1-5     $HOME/bin/checkip
# Script tests every 1 minute, from 6 am to 6 pm, Monday through Friday
# As per example cronjob above

D=$(date)

#set IP below - replace x's with actual IP address
IP=xxx.xxx.xxx.xxx

# Test if IP responds to ping.  Be patient; knock three times.
#
if ping -q -c 1 -w 2 $IP > /dev/null \
    || ( sleep 3 ; ping -q -c 1 -w 2 $IP > /dev/null ) \
      || ( sleep 3 ; ping -q -c 1 -w 2 $IP > /dev/null ) ; then

    echo "Test for - $D - replied properly" >> $HOME/logs/checkip_log

else

    # If the ip doesn't respond notify me
    #
    for STAFF in youremail@address.com ; do
        echo "$IP is not responding" | mail -s "IP is not responding" $STAFF
    done

    # send date/time info to logfile with results of ping test
    #
    echo "Test for - $D - DID NOT reply properly" >> $HOME/logs/checkip_log

fi

exit 0

******End Script******


NOTES:

You'll have to put in the appropriate IP address and in the following line of code:

for STAFF in youremail@address.com do

change "youremail@address.com" to your actual email address.

Also, it will write a logfile. If you want it to go elsewhere, change the path.

You can adjust the cronjob to suit the time period you want the script running. In the cronjob example above is the path I have the script in. You can of course set that to wherever you want the script to run.

Don't forget to change that to an executable script and have it in a pathed directory.

I'd love to claim authorship of this little elegant script but alas, I suck totally at programming. This was created by a friend and coworker who's been working with UNIX for around 25 years.

I've adapted, and reused the core of this script (the "knock 3 times" ping) for multiple different scripts that all basically perform the same function. Which is to say, test that some network capable device (ie: printer, WAP, server, etc) is still connected and working.. If your cell provider supports it, you can even set it to send a text message alert to your cell phone by adding one line below the line that sends the email.

It matters not how straight the gate,
How charged with punishments the scroll,
I am the master of my fate;
I am the captain of my soul.

***William Henley***


Report •

Related Solutions

#4
November 24, 2011 at 12:44:20
thanks!!!

i will check it!


Report •

#5
November 25, 2011 at 08:20:43
hello!! my client tell me that it doesnt have any linux :(

Report •

#6
November 30, 2011 at 09:41:39
Also you can use gfi languard software to monitor .It is very useful . solarwinds also is good to monitor , but u should just enable the snmp on the client also

Report •


Ask Question