![]() If connection fails, immediately try next host. Open (LOG, "> $parm ~1-4 minutes.īackground with (fork|Proc::Daemon|?) so can kill xterm after launch ing. I don't see that mine's better - is just tweaked to suit my own porpoises.īrowser => 'Mozilla/5.0 (X11 U Linux 2.2.17 i586 en-US m18)', Per zeno's request, here's my butchering of his cool code. ![]() (code) Re: Internet Connection Uptime Logger (mucked over) ![]() I've changed the perlfunc:open code to your suggestion. There's no reason for me to use the three argument syntax, and it causes it to be incompatible with previous versions. Re: Re: Internet Connection Uptime Logger Too many arguments for open at lines (open OUT) near "$log or" Or you could use this goody to nail up a dial connection - some ISPs don't hold a line up for ICMP but will, of course, for HTTP.īTW, I changed the open OUT,">",$log lines like so: open (OUT, ">$log") to get rid of this error: It also eliminates false negatives if the website you pick doesn't respond to ICMP. ![]() One reason for fetching page headers instead of using ping is if you can't run the script from a host in your DMZ, and your firewall blocks ICMP. Re: Internet Connection Uptime Logger (ICMP or HTTP) Print OUT (localtime).($state ? ": up\n" : ": down\n") Open OUT,">",$log or die "can't open $log: $!" Print OUT (localtime).($old_state ? ": up\n" : ": down\n") #this way of setting AUTOFLUSH on the log I got #version >$log") or die "can't open $log: $!" Print "testing $site every $interval seconds.\n" Print "Creating Internet Uptime Log at $log " Interval - interval in seconds between checks Name_of_logfile - text file to use as log file
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |