[smokeping-users] Re: Smokeping problem in case of DNS outages

Tobias Oetiker oetiker at ee.ethz.ch
Fri May 7 16:43:38 MEST 2004


Today Ralf Hildebrandt wrote:

> * Arnold Nipper <arnold at nipper.de>:
>
> > > Smokeping should "pollute" the HTML code with these remarks, thus
> > > rendering the webpage unrenderable.
> > >
> >
> > "Should" or "should not" . As far as I understood it does and that's
> > what you don't want.
>
> "Should not", of course.

this should help ...


--- Smokeping.pm~       Fri May  7 16:37:16 2004
+++ Smokeping.pm        Fri May  7 16:42:41 2004
@@ -16,7 +16,7 @@
 use File::Basename;

 # globale persistent variables for speedy
-use vars qw($cfg $probes $VERSION $havegetaddrinfo);
+use vars qw($cfg $probes $VERSION $havegetaddrinfo $cgimode);
 $VERSION="1.28";

 # we want opts everywhere
@@ -982,11 +982,11 @@
                  @ai = getaddrinfo( $_, "" );
                  if (scalar(@ai) <= 5) {
 # do not bomb, as this could be temporary
-                   warn "WARNING: Hostname '$_' does currently not resolve to an IP address (@ai)\n";
+                   $cgimode || warn "WARNING: Hostname '$_' does currently not resolve to an IP address (@ai)\n";
                  }
                } else {
 # do not bomb, as this could be temporary
-                 warn "WARNING: Hostname '$_' does currently not resolve to an IP address\n"
+                 $cgimode || warn "WARNING: Hostname '$_' does currently not resolve to an IP address\n"
                    unless gethostbyname( $_ );
                }
                 return undef;
@@ -1908,6 +1908,7 @@

 }
 sub cgi ($) {
+    $cgimode = 1;
     # make sure error are shown in appropriate manner even when running from speedy
     # and thus not getting BEGIN re-executed.
     if ($ENV{SERVER_SOFTWARE}) {
@@ -2007,6 +2008,7 @@
 }

 sub main ($) {
+    $cgimode = 0;
     umask 022;
     my $cfgfile = shift;
     $opt{filter}=[];

>
>

-- 
 ______    __   _
/_  __/_  / /  (_) Oetiker @ ISG.EE, ETZ J97, ETH, CH-8092 Zurich
 / // _ \/ _ \/ /  System Manager, Time Lord, Coder, Designer, Coach
/_/ \.__/_.__/_/   http://people.ee.ethz.ch/~oetiker   +41(0)44-632-5286

--
Unsubscribe mailto:smokeping-users-request at list.ee.ethz.ch?subject=unsubscribe
Help        mailto:smokeping-users-request at list.ee.ethz.ch?subject=help
Archive     http://www.ee.ethz.ch/~slist/smokeping-users
WebAdmin    http://www.ee.ethz.ch/~slist/lsg2.cgi



More information about the smokeping-users mailing list