> >
> >On server have a script that calls another script on your
> home machine
> >via LWP. If it gets reply back display "I'm up and running" image If 
> >not reply then display "I'm asleep now" image.
> >
> >HTH
> >
> >Dmuey
> 
> 
> Sorry, I don't like those 'two-scripts' solutions,
> i'd rather prefer something like 'ping' but i don't

But that still involves twp programs, your script and ping

> really know how to do that. I will try around with
> your suggestion but it's not really what i want.

Ok, then ping it and if you get result display picture.

my $ping = qx(ping -c 2 $host); # use $ping to figure out if it's on or not

Although I don't know why the "two script" method would be a problem:

On your home machine have , say , alive.cgi:

#!/usr/bin/perl
print "Content-type: text/plain\n\nHello";

On the server: online.cgi

#!/usr/bin/perl -w

use strict;
use File::Slurp;
use LWP::Simple;

print "Content-type: image/gif\n\n";
if(is_success(get("http://somename.no-ip.com/alive.cgi";))) { 
        print read_file("/path/to/on.gif"); 
}
else { print read_file("/path/to/off.gif"); }


Now on in the html page have this:

<img src="online.cgi" ALT="My Home Server Status"/>

The reason this may be more effective is:

1) pinging may be disabled by your isp or something else or may be disabled 
without you knowing it in the future even if it works ok now. So it may or 
may not tell the truth as to whether your home server can be reached. 

2) I'd almost put money down that pinging your server will take more time than 
Calling the alive.cgi script above.

3) If your home machine is winders and that is why you don't want two scripts the 
install active state perl and change it to alive.pl

4) It's all in one place so it's easy to manage.

Whatever, it's up to you. 

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to