computer online checker?

Problems? Post here...
Post Reply
User avatar
ayu
Staff
Staff
Posts: 8109
Joined: 27 Aug 2005, 16:00
18
Contact:

computer online checker?

Post by ayu »

Ok so a friend asked a question which got me thinking a bit. But I can't seem to find a program that will solve his problem, and coding one in PHP isn't very effective. And I'm not really confident in trying to build one in C++ yet.

Scenario:

30 computers at work, have to tell a central workstation that they are online. Like they send a packet every 5 minutes, and if the server (workstation) doesn't get the packet in that time from a computer, it will see it as offline.

My friend wants this setup at his work so that he can just VPN + VNC to his work from home and see so that all computers are up and running in a single click, without having to do extra work.

Anyone got a effective solution? =)
"The best place to hide a tree, is in a forest"

User avatar
DNR
Digital Mercenary
Digital Mercenary
Posts: 6114
Joined: 24 Feb 2006, 17:00
18
Location: Michigan USA
Contact:

easy E

Post by DNR »

??? there are apps out there to keep alive or monitor online status, via ping. Been around for years.

DNR
-
He gives wisdom to the wise and knowledge to the discerning. He reveals deep and hidden things; he knows what lies in Darkness, and Light dwells with him.

G-Brain
Fame ! Where are the chicks?!
Fame ! Where are the chicks?!
Posts: 467
Joined: 08 Nov 2007, 17:00
16
Location: NL

Post by G-Brain »

Let the central workstation ping the machines from like a bash script that does a sleep(5*60), writing the results to whatever you deem useful.

You can use the return value of the ping program ($? in bash).
It returns 0 (from main() :lol:) when the machine is up, nonzero otherwise.
Last edited by G-Brain on 12 Sep 2008, 09:15, edited 5 times in total.
I <3 MariaLara more than all of you

User avatar
ayu
Staff
Staff
Posts: 8109
Joined: 27 Aug 2005, 16:00
18
Contact:

Re: easy E

Post by ayu »

DNR wrote:??? there are apps out there to keep alive or monitor online status, via ping. Been around for years.

DNR

Well yeah I know it's an option, but telling me that and saying that it has been around for some time doesn't really help me solve my friends issue.

Do you have a suggestion for a good application like that?
"The best place to hide a tree, is in a forest"

G-Brain
Fame ! Where are the chicks?!
Fame ! Where are the chicks?!
Posts: 467
Joined: 08 Nov 2007, 17:00
16
Location: NL

Post by G-Brain »

Code: Select all

hosts[0]="192.168.2.1"
hosts[1]="192.168.2.100"

while [ 1 ]
do
    date
    for host in ${hosts[@]}
    do
        ping -c 1 $host &>/dev/null
        if [ $? -ne 0 ]
        then
            echo "$host is down" 
        else
            echo "$host is up"
        fi
    done
    sleep 300
done
That just checks every member of the hosts array every 5 minutes, writing results to standard output. Should be easy to modify according to your friends' needs.
I <3 MariaLara more than all of you

User avatar
bad_brain
Site Owner
Site Owner
Posts: 11636
Joined: 06 Apr 2005, 16:00
19
Location: In your eye floaters.
Contact:

Post by bad_brain »

hm, if the box from which the monitoring is done runs on Linux Nagios for example (the OS of the monitored box don't matter, can be a MS one too):
http://www.nagios.org/
another one is Pandora, it also runs on MS:
http://sourceforge.net/projects/pandora/

but ooook....both might be a little overkill.... :lol:
check this one:
http://sourceforge.net/projects/multiping/
all it need to run is Java...
:wink:

User avatar
ayu
Staff
Staff
Posts: 8109
Joined: 27 Aug 2005, 16:00
18
Contact:

Post by ayu »

Thanks for the answers guys!

But I found something that suits him ^^

"Quick Ping Monitor"
"The best place to hide a tree, is in a forest"

Post Reply