Mon, 20 Apr 2009 12:34:50 +0200
Correct perl syntax and provide all four outputs to MRTG from scripts.
mrtg/mrtg.spec | file | annotate | diff | comparison | revisions | |
mrtg/uptime.pl | file | annotate | diff | comparison | revisions | |
mrtg/webstat.pl | file | annotate | diff | comparison | revisions |
1.1 --- a/mrtg/mrtg.spec Mon Apr 20 12:34:08 2009 +0200 1.2 +++ b/mrtg/mrtg.spec Mon Apr 20 12:34:50 2009 +0200 1.3 @@ -32,7 +32,7 @@ 1.4 Group: Monitoring 1.5 License: GPL 1.6 Version: 2.16.2 1.7 -Release: 20090405 1.8 +Release: 20090418 1.9 1.10 # list of sources 1.11 Source0: http://oss.oetiker.ch/mrtg/pub/mrtg-%{version}.tar.gz
2.1 --- a/mrtg/uptime.pl Mon Apr 20 12:34:08 2009 +0200 2.2 +++ b/mrtg/uptime.pl Mon Apr 20 12:34:50 2009 +0200 2.3 @@ -1,4 +1,4 @@ 2.4 -#!@l_prefix@/bin/perl 2.5 +#! @l_prefix@/bin/perl 2.6 ## 2.7 ## uptime.pl: provide formatted uptime(1) information 2.8 ##
3.1 --- a/mrtg/webstat.pl Mon Apr 20 12:34:08 2009 +0200 3.2 +++ b/mrtg/webstat.pl Mon Apr 20 12:34:50 2009 +0200 3.3 @@ -1,4 +1,4 @@ 3.4 -#!@l_prefix@/bin/perl 3.5 +#! @l_prefix@/bin/perl 3.6 ## 3.7 ## webstats.pl: return HTTP server hits and bytes 3.8 ## 3.9 @@ -17,15 +17,17 @@ 3.10 if ($res =~ /Server uptime: (.*)$/) { 3.11 $up = $1;last 3.12 } 3.13 - else 3.14 + else { 3.15 next 3.16 + } 3.17 3.18 if ($res =~ /Server at/) { 3.19 $server = $res; 3.20 last 3.21 } 3.22 - else 3.23 + else { 3.24 next 3.25 + } 3.26 } 3.27 3.28 @res = `@l_prefix@/bin/lynx -dump http://localhost/server-status?auto`; 3.29 @@ -55,4 +57,6 @@ 3.30 3.31 print "$up\n"; 3.32 print "$server"; 3.33 +print "$null\n"; 3.34 +print "$null\n"; 3.35