summaryrefslogtreecommitdiffstats
path: root/lib/Smokeping
diff options
context:
space:
mode:
authorNiko Tyni <ntyni@iki.fi>2005-02-18 14:04:12 +0100
committerNiko Tyni <ntyni@iki.fi>2005-02-18 14:04:12 +0100
commitf6d4093e0dc827fbc853ed21ad3cb0ab1f898704 (patch)
tree3a1b6a248b2a3af2f95ee309b0defa5eb570dc19 /lib/Smokeping
parent634fe0bf599454c203fd64e9f634e8a3d3abf1c5 (diff)
downloadsmokeping-f6d4093e0dc827fbc853ed21ad3cb0ab1f898704.tar.gz
smokeping-f6d4093e0dc827fbc853ed21ad3cb0ab1f898704.tar.xz
* graph fixes for small numbers of pings -- Chris Wilson <chris *aidworld.org>
* fix the LDAP probe killing the CGI with perl <5.6 -- Peter Farmer <pfarmer *hashbang.org.uk> * make the LDAP probe work withouth IO::Socket::SSL -- niko * make Curl description shorter -- Chris Wilson <chris *aidworld.org> * use CGI::Carp for CGI error handling - remove the now unnecessary kludge from AnotherDNS * don't call exit() in the daemon __DIE__ handler * raise Curl and EchoPingHttp{,s} default timeouts * add a section on timeouts to smokeping_upgrade * add IO::Socket::SSL to smokeping_install
Diffstat (limited to 'lib/Smokeping')
-rw-r--r--lib/Smokeping/probes/AnotherDNS.pm11
-rw-r--r--lib/Smokeping/probes/Curl.pm6
-rw-r--r--lib/Smokeping/probes/EchoPingHttp.pm2
-rw-r--r--lib/Smokeping/probes/LDAP.pm20
4 files changed, 24 insertions, 15 deletions
diff --git a/lib/Smokeping/probes/AnotherDNS.pm b/lib/Smokeping/probes/AnotherDNS.pm
index 6d5a63f..65a1bd4 100644
--- a/lib/Smokeping/probes/AnotherDNS.pm
+++ b/lib/Smokeping/probes/AnotherDNS.pm
@@ -16,16 +16,6 @@ to generate the POD document.
use strict;
-# And now, an extra ugly hack
-# Reason: Net::DNS does an eval("use Win32:Registry") to
-# find out if it is running on Windows. This triggers the signal
-# handler in the cgi mode.
-
-my $tmp = $SIG{__DIE__};
-$SIG{__DIE__} = sub { };
-eval("use Net::DNS;");
-$SIG{__DIE__} = $tmp;
-
use base qw(Smokeping::probes::basefork);
use IPC::Open3;
use Symbol;
@@ -33,6 +23,7 @@ use Carp;
use Time::HiRes qw(sleep ualarm gettimeofday tv_interval);
use IO::Socket;
use IO::Select;
+use Net::DNS;
sub pod_hash {
return {
diff --git a/lib/Smokeping/probes/Curl.pm b/lib/Smokeping/probes/Curl.pm
index e04e6c9..8e40067 100644
--- a/lib/Smokeping/probes/Curl.pm
+++ b/lib/Smokeping/probes/Curl.pm
@@ -72,8 +72,8 @@ DOC
timeout => {
_doc => qq{The "-m" curl(1) option. Maximum timeout in seconds.},
_re => '\d+',
- _example => 10,
- _default => 5,
+ _example => 20,
+ _default => 10,
},
interface => {
_doc => <<DOC,
@@ -144,7 +144,7 @@ sub test_usage {
}
sub ProbeDesc($) {
- return "HTTP, HTTPS, and FTP URLs using curl(1)";
+ return "URLs using curl(1)";
}
# other than host, count and protocol-specific args come from here
diff --git a/lib/Smokeping/probes/EchoPingHttp.pm b/lib/Smokeping/probes/EchoPingHttp.pm
index 6483e10..464dd12 100644
--- a/lib/Smokeping/probes/EchoPingHttp.pm
+++ b/lib/Smokeping/probes/EchoPingHttp.pm
@@ -110,6 +110,8 @@ sub targetvars {
delete $h->{udp};
delete $h->{fill};
delete $h->{size};
+ $h->{timeout}{default} = 10;
+ $h->{timeout}{example} = 20;
return $class->_makevars($h, {
url => {
_doc => <<DOC,
diff --git a/lib/Smokeping/probes/LDAP.pm b/lib/Smokeping/probes/LDAP.pm
index 07dd7f6..2888a14 100644
--- a/lib/Smokeping/probes/LDAP.pm
+++ b/lib/Smokeping/probes/LDAP.pm
@@ -19,7 +19,15 @@ use Smokeping::probes::passwordchecker;
use Net::LDAP;
use Time::HiRes qw(gettimeofday sleep);
use base qw(Smokeping::probes::passwordchecker);
-use IO::Socket::SSL;
+
+# don't bail out if IO::Socket::SSL
+# can't be loaded, just warn
+# about it when doing starttls
+
+my $havessl = 0;
+
+eval "use IO::Socket::SSL;";
+$havessl = 1 unless $@;
my $DEFAULTINTERVAL = 1;
@@ -42,7 +50,9 @@ be specified by the variables `port' and `version'.
The probe can issue the starttls command to convert the connection
into encrypted mode, if so instructed by the `start_tls' variable.
-It can also optionally do an authenticated LDAP bind, if the `binddn'
+This requires the 'IO::Socket::SSL' perl module to be installed.
+
+The probe can also optionally do an authenticated LDAP bind, if the `binddn'
variable is present. The password to be used can be specified by the
target-specific variable `password' or in an external file.
The location of this file is given in the probe-specific variable
@@ -95,6 +105,12 @@ sub targetvars {
},
start_tls => {
_doc => "If true, encrypt the connection with the starttls command. Disabled by default.",
+ _sub => sub {
+ my $val = shift;
+ return "ERROR: start_tls defined but IO::Socket::SSL couldn't be loaded"
+ if $val and not $havessl;
+ return undef;
+ },
_example => "1",
},
timeout => {