summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--CHANGES3
-rw-r--r--doc/smokeping_upgrade.pod12
-rw-r--r--lib/Smokeping.pm38
-rw-r--r--lib/Smokeping/Graphs.pm3
-rw-r--r--lib/Smokeping/Master.pm1
5 files changed, 38 insertions, 19 deletions
diff --git a/CHANGES b/CHANGES
index 7894802..8d425aa 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,6 @@
+* slaves should skip multi target hosts -- tobi
+* set Content-Length header to help multi request queries -- tobi
+
2007/8/30 -- released version 2.2.2
* fixed links to slave graphs from chart mode -- tobi
* minor cosmetic fixes -- tobi
diff --git a/doc/smokeping_upgrade.pod b/doc/smokeping_upgrade.pod
index a4aaeaf..bd2cbe0 100644
--- a/doc/smokeping_upgrade.pod
+++ b/doc/smokeping_upgrade.pod
@@ -36,11 +36,17 @@ interface introduced in version 6:
=over
-=item L<EchoPingDNS|Smokeping::probes::EchoPingDNS>
+=item *
-=item L<EchoPingLDAP|Smokeping::probes::EchoPingLDAP>
+L<EchoPingDNS|Smokeping::probes::EchoPingDNS>
-=item L<EchoPingWhois|Smokeping::probes::EchoPingWhois>
+=item *
+
+L<EchoPingLDAP|Smokeping::probes::EchoPingLDAP>
+
+=item *
+
+L<EchoPingWhois|Smokeping::probes::EchoPingWhois>
=back
diff --git a/lib/Smokeping.pm b/lib/Smokeping.pm
index 41a80b0..9b88a7d 100644
--- a/lib/Smokeping.pm
+++ b/lib/Smokeping.pm
@@ -1208,10 +1208,11 @@ sub get_detail ($$$$;$){
if ($mode eq 'a'){ # ajax mode
open my $img, "${imgbase}_${end}_${start}.png";
binmode $img;
- print "Content-Type: image/png\n\n";
+ print "Content-Type: image/png\n";
my $data;
read($img,$data,(stat($img))[7]);
close $img;
+ print "Content-Length: ".length($data)."\n\n";
print $data;
unlink "${imgbase}_${end}_${start}.png";
exit;
@@ -1410,6 +1411,12 @@ sub display_webpage($$){
smokelogo => '<A HREF="http://oss.oetiker.ch/smokeping/counter.cgi/'.$VERSION.'"><img border="0" src="'.$cfg->{General}{imgurl}.'/smokeping.png"></a>',
}
);
+ print $q->header(-type=>'text/html',
+ -expires=>'+'.($cfg->{Database}{step}).'s',
+ -charset=> ( $cfg->{Presentation}{charset} || 'iso-8859-15'),
+ -Content_length => length($page),
+ );
+
print $page || "<HTML><BODY>ERROR: Reading page template".$cfg->{Presentation}{template}."</BODY></HTML>";
}
@@ -2060,9 +2067,9 @@ DOC
$grammar->{$_} = $probevars->{$_};
%{$g->{$_}} = %{$probevars->{$_}};
# this makes the reference manual a bit less cluttered
- delete $g->{$_}{_doc};
+ $g->{$_}{_doc} = 'see above';
delete $g->{$_}{_example};
- delete $grammar->{$_}{_doc};
+ $grammar->{$_}{_doc} = 'see above';
delete $grammar->{$_}{_example};
}
# make any mandatory variable specified here non-mandatory in the Targets section
@@ -2079,7 +2086,7 @@ DOC
delete $g->{$var}{_doc};
delete $g->{$var}{_example};
# (note: intentionally overwrite _doc)
- $grammar->{$var}{_doc} = " (This variable can be overridden target-specifically in the Targets section.)";
+ $grammar->{$var}{_doc} = "(This variable can be overridden target-specifically in the Targets section.)";
$grammar->{$var}{_dyn} = $sub
if grep { $_ eq $var } @{$targetvars->{_mandatory}};
}
@@ -2170,7 +2177,7 @@ General configuration values valid for the whole SmokePing setup.
DOC
_vars =>
[ qw(owner imgcache imgurl datadir dyndir pagedir piddir sendmail offset
- smokemail cgiurl mailhost contact netsnpp display_name
+ smokemail cgiurl mailhost snpphost contact display_name
syslogfacility syslogpriority concurrentprobes changeprocessnames tmail
changecgiprogramname linkstyle) ],
@@ -2224,6 +2231,7 @@ try one after the other if one does not answer for 5 seconds.
DOC
_sub => sub { require Net::SMTP ||return "ERROR: loading Net::SMTP"; return undef; }
},
+
snpphost =>
{
_doc => <<DOC,
@@ -2352,7 +2360,7 @@ DOC
_re => '(\d+%|random)',
_re_error =>
"Use offset either in % of operation interval or 'random'",
- _doc => <<DOC,
+ _doc => <<DOC,
If you run many instances of smokeping you may want to prevent them from
hitting your network all at the same time. Using the offset parameter you
can change the point in time when the probes are run. Offset is specified
@@ -2561,7 +2569,9 @@ DOC
title => { _doc => 'Page title' },
format => { _doc => 'sprintf format string to format curent value' },
sorter => { _re => '\S+\(\S+\)',
- _re_error => 'use a sorter call here: Sorter(arg1=>val1,arg2=>val2)'}
+ _re_error => 'use a sorter call here: Sorter(arg1=>val1,arg2=>val2)',
+ _doc => 'sorter for this charts sections',
+ }
}
},
@@ -3151,10 +3161,12 @@ DOC
$g->{_vars} = [ @{$g->{_vars}}, @targetvars ];
$g->{_inherited} = [ @{$g->{_inherited}}, @targetvars ];
# this makes the reference manual a bit less cluttered
- delete $grammar->{$_}{_doc} for @targetvars;
- delete $grammar->{$_}{_example} for @targetvars;
- delete $g->{$_}{_doc} for @targetvars;
- delete $g->{$_}{_example} for @targetvars;
+ for (@targetvars){
+ $g->{$_}{_doc} = 'see above';
+ $grammar->{$_}{_doc} = 'see above';
+ delete $grammar->{$_}{_example};
+ delete $g->{$_}{_example};
+ }
# make the mandatory variables mandatory only in sections
# with 'host' defined
# see 2.3 above
@@ -3497,10 +3509,6 @@ sub cgi ($) {
}
} else {
if (not $q->param('displaymode') or $q->param('displaymode') ne 'a'){ #in ayax mode we do not issue a header YET
- print $q->header(-type=>'text/html',
- -expires=>'+'.($cfg->{Database}{step}).'s',
- -charset=> ( $cfg->{Presentation}{charset} || 'iso-8859-15')
- );
}
display_webpage $cfg,$q;
}
diff --git a/lib/Smokeping/Graphs.pm b/lib/Smokeping/Graphs.pm
index 2c62367..bb7002d 100644
--- a/lib/Smokeping/Graphs.pm
+++ b/lib/Smokeping/Graphs.pm
@@ -269,10 +269,11 @@ sub get_multi_detail ($$$$;$){
if ($mode eq 'a'){ # ajax mode
open my $img, "${imgbase}_${end}_${start}.png";
binmode $img;
- print "Content-Type: image/png\n\n";
+ print "Content-Type: image/png\n";
my $data;
read($img,$data,(stat($img))[7]);
close $img;
+ print "Content-Length: ".length($data)."\n\n";
print $data;
unlink "${imgbase}_${end}_${start}.png";
exit;
diff --git a/lib/Smokeping/Master.pm b/lib/Smokeping/Master.pm
index ddd708e..065270b 100644
--- a/lib/Smokeping/Master.pm
+++ b/lib/Smokeping/Master.pm
@@ -38,6 +38,7 @@ sub get_targets {
# dynamic hosts can only be queried from the
# master
next if $key eq 'host' and $trg->{$key} eq 'DYNAMIC';
+ next if $key eq 'host' and $trg->{$key} =~ m|^/|; # skip multi targets
next if $key eq 'host' and not ( defined $trg->{slaves} and $trg->{slaves} =~ /\b${slave}\b/);
if (ref $trg->{$key} eq 'HASH'){
$return{$key} = get_targets ($trg->{$key},$slave);