TranspoMan
2-1-05, 12:47 PM
Here we go again. I resolved my cron problem back on 12/22/04 here in the forums. Link (http://forum.powweb.com/showthread.php?p=257914#post257914) . The fix involved pointing the hostname to 'syslog03.powweb.com', where the cron jobs were running. I must have missed that notification somehow :). Anyway, it's broken again, probably to "load balancing". So here's the code again:
--------------------------------------------------------------------------------------
#!/usr/bin/perl
use Socket;
$hostname='syslog03.powweb.com';
$remote_host='www.transpoman.com';
$sockaddr = 'S n a4 x8';
$proto=getprotobyname('tcp');
($name, $aliases, $type, $len, $thisaddr) = gethostbyname($hostname);
($name, $aliases, $type, $len, $thataddr) = gethostbyname($remote_host);
$this = pack($sockaddr, &AF_INET, 0, $thisaddr);
$that = pack($sockaddr, &AF_INET, 80, $thataddr);
socket(S, &AF_INET, &SOCK_STREAM, $proto)||die "socket: $!";
bind(S,$this)||die "bind: $!";
connect(S,$that)||die "connect: $!";
select(S); $|=1; select(STDOUT);
print S "GET /update_news.php HTTP/1.0\nHost: $remote_host\n\n";
while ($line=<S>) { }
close(S);
exit 0;
--------------------------------------------------------------------------------------
Do I change "$remote_host='www.transpoman.com';" to
"$remote_host='localhost.transpoman.com';"?
Or what, I'm floundering here...
--------------------------------------------------------------------------------------
#!/usr/bin/perl
use Socket;
$hostname='syslog03.powweb.com';
$remote_host='www.transpoman.com';
$sockaddr = 'S n a4 x8';
$proto=getprotobyname('tcp');
($name, $aliases, $type, $len, $thisaddr) = gethostbyname($hostname);
($name, $aliases, $type, $len, $thataddr) = gethostbyname($remote_host);
$this = pack($sockaddr, &AF_INET, 0, $thisaddr);
$that = pack($sockaddr, &AF_INET, 80, $thataddr);
socket(S, &AF_INET, &SOCK_STREAM, $proto)||die "socket: $!";
bind(S,$this)||die "bind: $!";
connect(S,$that)||die "connect: $!";
select(S); $|=1; select(STDOUT);
print S "GET /update_news.php HTTP/1.0\nHost: $remote_host\n\n";
while ($line=<S>) { }
close(S);
exit 0;
--------------------------------------------------------------------------------------
Do I change "$remote_host='www.transpoman.com';" to
"$remote_host='localhost.transpoman.com';"?
Or what, I'm floundering here...