summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--CHANGES2
-rwxr-xr-xbin/smokeping2
-rw-r--r--doc/smokeping_install.pod161
-rw-r--r--lib/Smokeping.pm6
-rwxr-xr-xsetup/build-perl-modules.sh4
5 files changed, 80 insertions, 95 deletions
diff --git a/CHANGES b/CHANGES
index 764d181..a8afb7b 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,4 +1,4 @@
-
+* Switch from using SpeedyCGI to FastCGI.
* Added new OpenSSHJunOSPing probe to run ping from a juniper router via
ssh. This work has been sponsored by Juniper.
diff --git a/bin/smokeping b/bin/smokeping
index 3fe0575..a44361c 100755
--- a/bin/smokeping
+++ b/bin/smokeping
@@ -10,7 +10,7 @@ use lib "$FindBin::Bin/../lib";
use Smokeping 2.004002;
-Smokeping::main("etc/config.dist");
+Smokeping::main("$FindBin::Bin/../etc/config");
=head1 NAME
diff --git a/doc/smokeping_install.pod b/doc/smokeping_install.pod
index bb5d3d5..39a2078 100644
--- a/doc/smokeping_install.pod
+++ b/doc/smokeping_install.pod
@@ -18,12 +18,11 @@ downloading the tool.
=over
-=item RRDtool 1.2.x
+=item RRDtool 1.2.x or later
-L<http://oss.oetiker.ch/rrdtool/>
-
-Just follow the installation instructions. We need this package todo all the
-logging and graphing in SmokePing.
+Smokeping uses RRDtool for logging and graphing. If you linux distro provides
+an rrdtool package with perl support, use this. If you want to get the latest
+and greates version, compile your own: L<http://oss.oetiker.ch/rrdtool/>
=item FPing
@@ -60,19 +59,52 @@ L<http://www.openssh.org/>
You need this for the SSH probe.
-=item Various Perl modules (Most of these are optional)
+=item Webserver
+
+L<http://httpd.apache.org/>
+
+Well I wont get much into this. The important thing is, to have a webserver
+which allows you to run CGI and preferably FastCGI scripts. If you are using
+Apache I strongly recommend using the F<suexec> system for running CGI
+scripts as a particular user.
+
+See L<http://httpd.apache.org/mod_fcgid/mod/mod_fcgid.html> and
+L<http://httpd.apache.org/docs/2.2/mod/mod_suexec.html> for more information
+on this.
+
+=item Perl 5.8.8 or later.
+
+If you still have an older version, maybe have a look at perlbrew.
+
+=item Various Perl modules (Many are optional)
-You can get these from L<http://www.cpan.org/>.
+They are all from L<http://www.cpan.org> and you may be able to get them as
+packages from your distro, but there is also a script provided in the setup
+folder of this package which will install all the missing modules in a
+thirdparty directory into your smokeping installation. So, if you don't have
+them yet, look further down.
=over
-=item libwww-perl
+=item FCGI
+
+The module for supporting FastCGI operation.
+
+=item CGI, CGI::Fast
+
+Perl CGI/FastCGI support. Might already be installed localy.
+
+=item Config::Grammar
+
+The configuration file parser used in smokeping
+
+=item LWP
The master/slave functionality introduced a dependency LWP::UserAgent
from the libwww-perl (also known as LWP) library. Currently the module
is needed even if the master/slave mode is not enabled.
-=item Socket6 0.11-1
+=item Socket6 (optional)
Optionally installing the Socket6 module for perl enables
smokeping to check hostnames that only resolve to an IPv6
@@ -80,114 +112,70 @@ address. If you probe such hosts using ie. the FPing6 probe
and get warnings that those hosts don't resolve to an IP
address, you need to install it.
-=item Net::Telnet
+=item Net::Telnet (optional)
You need this for the TelnetIOSPing probe.
-=item Net::DNS
+=item Net::OpenSSH (optional)
+
+You need this for the OpenSSHJunOSPing probe.
+
+=item Net::DNS (optional)
You need this for the AnotherDNS probe.
-=item Net::LDAP
+=item Net::LDAP (optional)
You need this for the LDAP probe.
-=item IO::Socket::SSL
+=item IO::Socket::SSL (optional)
You need this if you want the LDAP probe to be able to use the 'starttls' command.
-=item Authen::Radius
+=item Authen::Radius (optional)
You need this for the Radius probe.
=back
-=item Webserver
-
-L<http://httpd.apache.org/>
-
-Well I wont get much into this. The important thing is, to have a webserver
-which allows you to run CGI scripts. If you are using Apache I strongly
-recommend using the F<suexec> system for running CGI scripts. Often it is
-sufficient to change the F<suexec> binary to setuid root and restart Apache.
-Using F<suexec> allow to run cgi scripts under proper user accounts.
-
-=item Perl 5.8.8
-
-L<http://www.perl.com>
-
-I guess you will get away with older versions of perl. I am using 5.8.8 here
-and it works fine.
-
-=item SpeedyCGI
-
-L<http://www.daemoninc.com/SpeedyCGI/>
-
-SpeedyCGI speeds up CGIs written in perl dramatically by making them memory
-resident and handing new request to the script which is already running.
-SmokePing has been optimized for use with SpeedyCGI. Note that you do NOT
-need mod_speedy, just the plain and simple speedy executable, this is the
-beauty of this tool it works without touching your apache ... Otherwise you
-could as well be using FastCGI or mod_perl. There is a bug in speedy with
-returning error messages to the apache error log. You can find a patch in
-the smokeping download area.
-
-=item CGI::Carp
-
-L<http://http://search.cpan.org/~lds/CGI.pm>
-
-If you are using a version of Perl older than 5.8.1, you should consider
-installing a newer version of CGI::Carp (must be at least 1.24, included in
-CGI.pm-2.82). Otherwise any error messages generated by the CGI script
-will not show up quite as clean as they could in the web server error log.
-If you can't or don't want to upgrade CGI::Carp, you can also set
-the C<changecgiprogramname> variable in the C<General> section to the
-value C<no>.
-
=back
=head2 Installation
Once the tools listed above are in place, you can start setting up SmokePing
-itself. Once the SmokePing tools are unpacked, they are more of less ready
+itself. Once the SmokePing tar archive is unpacked, it is more of less ready
to use. At least to the extent, that it is not necessary to B<install> them.
-You may want to rename the directory to a name which does not contain the
+
+You may want to move and rename the directory so that it does not contain the
version number of SmokePing, or at least make a symlink, so that you can use
a persistent name when referring to SmokePing files.
-In the distribution you find a number of files named F<*.dist> they have to
-be edited and renamed to F<*>. Below you find a short explanation for each
-of the files you have to edit:
-
+Once all is in place, you get to plug everyting together:
=over
-=item F<bin/smokeping>
+=item Building missing perl modules
-Make sure all the required libraries are available and the first line of the
-script points to your copy of perl. Adjust the B<use lib> lines to point to
-your B<RRDtool> installation and to the B<Smokeping/lib> directory and edit
-the path of the config file to be in sync with reality.
+To make sure all the necessary perl modules are available, use the script in the F<setup/> directory:
-=item F<htdocs/smokeping.cgi>
+ cd setup
+ ./build-perl-modules.sh
-Edit the F<smokeping.cgi> analog to the F<smokeping> script above. Make sure
-the first line of the script is pointing to your freshly installed copy of
-Speedy CGI. Store the script in a directory of your weberver where CGIs get
-executed. You also have to edit the B<use lib> line similar to what you did
-to F<smokeping>.
+=item Configure Smokeping
-=item F<htdocs/cropper/*>
+Use the F<etc/config.dist> file as a template to create your own smokeping configuration file.
+See L<smokeping_config> for details.
-To make the interactive graph-zoomer work, you have to place the content of the
-cropper directory somewhere on your webserver and adapt the links in F<basepage.html>
-(see below).
+=item Installing the webinterface
-=item F<etc/config>
+Copy the content of the F<htdocs/> directory to the place where your webserver
+expects its data. Maybe to F</var/www/smokeping>.
+
+Edit the F<smokeping.fcgi> script to point to your smokeping installation.
+
+If you have no FastCGI support in your webserver, you may want to rename the script
+to F<smokeping.cgi>.
-Create your SmokePing configuration file. The easiest is to copy the
-F<etc/config> file and work from there. Please refer to
-L<smokeping_config> for details.
=item F<etc/basepage.html>
@@ -208,26 +196,21 @@ With all the scaffolding in place, you can now launch the smokeping daemon and s
have it gather data for you. First you may want to run it in debug mode to see what
it is doing
- ./bin/smokeping --debug
+ ./bin/smokeping --config=/opt/smokeping/etc/config --debug
once all is well, start it up as a deamon. I would recomend to enable the logfile
option so that you can see if it runs into trouble.
- ./bin/smokeping --logfile=smoke.log
+ ./bin/smokeping --config=/opt/smokeping/etc/config --logfile=smoke.log
Once the system works, you may want to put a SmokePing startup script into
your F</etc/init.d> tree. Check out L<smokeping> for further information.
When you can now also open the smokeping.cgi webpage to look at your data.
-=head2 Adding SmokeTrace online Traceroute ability
-
-If you want to add traceroute ability to your smokeping setup, check out the
-L<smoketrace> manual page.
-
=head1 COPYRIGHT
-Copyright (c) 2001, 2008 by Tobias Oetiker. All right reserved.
+Copyright (c) 2001, 2011 by Tobias Oetiker. All right reserved.
=head1 LICENSE
diff --git a/lib/Smokeping.pm b/lib/Smokeping.pm
index c725005..293cdba 100644
--- a/lib/Smokeping.pm
+++ b/lib/Smokeping.pm
@@ -3766,7 +3766,7 @@ sub daemonize_me ($) {
sub load_cfg ($;$) {
my $cfgfile = shift;
my $noinit = shift;
- my $cfmod = (stat $cfgfile)[9] || die "ERROR: calling stat on $cfgfile: $!\n";
+ my $cfmod = (stat $cfgfile)[9] || die "ERROR: loading smokeping configuration file $cfgfile: $!\n";
# when running under speedy this will prevent reloading on every run
# if cfgfile has been modified we will still run.
if (not defined $cfg or not defined $probes # or $cfg->{__last} < $cfmod
@@ -3892,12 +3892,12 @@ ${e}cut
POD
}
-sub cgi ($) {
+sub cgi ($$) {
my $cfgfile = shift;
+ my $q = shift;
$cgimode = 'yes';
umask 022;
load_cfg $cfgfile;
- my $q=new CGI;
initialize_cgilog();
if ($q->param(-name=>'slave')) { # a slave is calling in
Smokeping::Master::answer_slave($cfg,$q);
diff --git a/setup/build-perl-modules.sh b/setup/build-perl-modules.sh
index 8c7d272..e0682b9 100755
--- a/setup/build-perl-modules.sh
+++ b/setup/build-perl-modules.sh
@@ -10,7 +10,9 @@ for module in \
Digest::HMAC_MD5 \
Net::Telnet \
Net::OpenSSH \
- Net::SNMT \
+ Net::SNMP \
+ Net::LDAP \
+ Net::DNS \
IO::Pty \
LWP \
; do