1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
|
*** src/support/log_server_status.orig Tue Mar 31 16:53:50 1998
--- src/support/log_server_status Tue Apr 21 17:18:10 1998
***************
*** 67,76 ****
#
require 'sys/socket.ph';
! $wherelog = "/var/log/graph/"; # Logs will be like "/var/log/graph/960312"
$server = "localhost"; # Name of server, could be "www.foo.com"
$port = "80"; # Port on server
! $request = "/status/?auto"; # Request to send
sub tcp_connect
{
--- 67,76 ----
#
require 'sys/socket.ph';
! $wherelog = "/var/log/httpd-status-"; # Logs will be like "/var/log/graph/960312"
$server = "localhost"; # Name of server, could be "www.foo.com"
$port = "80"; # Port on server
! $request = "/server-status/?auto"; # Request to send
sub tcp_connect
{
***************
*** 93,103 ****
### Main
{
! $date=`date +%y%m%d:%H%M%S`;
chop($date);
($day,$time)=split(/:/,$date);
$res=&tcp_connect($server,$port);
! open(OUT,">>$wherelog$day");
if ($res) {
print OUT "$time:-1:-1:-1:-1:$res\n";
exit 1;
--- 93,103 ----
### Main
{
! $date=`LC_TIME=C date +%y%m%d:%H%M%S`;
chop($date);
($day,$time)=split(/:/,$date);
$res=&tcp_connect($server,$port);
! open(OUT,">>$wherelog$day.log");
if ($res) {
print OUT "$time:-1:-1:-1:-1:$res\n";
exit 1;
|