diff options
author | Tobi Oetiker <tobi@oetiker.ch> | 2011-09-25 17:44:45 +0200 |
---|---|---|
committer | Tobi Oetiker <tobi@oetiker.ch> | 2011-09-25 17:44:45 +0200 |
commit | 6735adcb1d8a03b3d6e3309233335b32c9b9404c (patch) | |
tree | c8af40edf0731b3c618a921ab484aa002199cc5a /bin | |
parent | 595d31e93b261519631191330c9bde764064ede1 (diff) | |
download | smokeping-6735adcb1d8a03b3d6e3309233335b32c9b9404c.tar.gz smokeping-6735adcb1d8a03b3d6e3309233335b32c9b9404c.tar.xz |
initial
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/smokeping_cgi | 88 |
1 files changed, 88 insertions, 0 deletions
diff --git a/bin/smokeping_cgi b/bin/smokeping_cgi new file mode 100755 index 0000000..8bc1cde --- /dev/null +++ b/bin/smokeping_cgi @@ -0,0 +1,88 @@ +#!/usr/bin/env perl +# -*-perl-*- + +use strict; +use warnings; + +use FindBin; +use lib "$FindBin::Bin/../thirdparty/lib/perl5"; +use lib "$FindBin::Bin/../lib"; + +# don't bother with zombies +$SIG{CHLD} = 'IGNORE'; + +use CGI::Carp qw(fatalsToBrowser); + +use Smokeping 2.004002; + +use CGI::Fast; + +my $cfg = (shift @ARGV) || "$FindBin::Bin/../etc/config"; + + +while (my $q = new CGI::Fast) { + Smokeping::cgi($cfg,$q); +} + +=head1 NAME + +smokeping.cgi - SmokePing webfrontend + +=head1 OVERVIEW + +This script acts as a 'website' for your SmokePing monitoring operation. It +presents the targets you are looking at in a tree structure and draws graphs +as they are required by people looking at the pages. + +=head1 DESCRIPTION + +To get B<smokeping.cgi> going, you need a webserver which allows you to run +CGI or better FastCGI scripts. The system must be setup so that the cgi +process is allowed to write to the image caching area as defined in the +config file. + +This script runs fine as a normal CGI, B<BUT> it will appear to be very slow, +because it does a lot of things when starting up. So if the script has to be +started a fresh on every click, this is both slow and a tough thing for your +webserver. I therefore strongly recommend using FastCGI. + +Please refer to the installation document for detailed setup instructions. + +=head1 SETUP + +When installing SmokePing, I recomend to place a little shell wrapper +into your htdocs directory, to launch the actual smokeping.cgi process: + + #!/bin/sh + # maybe add some extra perl search path + # export PERL5LIB=/opt/rrdtool/lib/perl + exec /opt/smokeping/bin/smokeping.cgi /opt/smokeping/etc/config + +=head1 COPYRIGHT + +Copyright (c) 2011 by Tobias Oetiker. All right reserved. + +=head1 LICENSE + +This program is free software; you can redistribute it +and/or modify it under the terms of the GNU General Public +License as published by the Free Software Foundation; either +version 2 of the License, or (at your option) any later +version. + +This program is distributed in the hope that it will be +useful, but WITHOUT ANY WARRANTY; without even the implied +warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. See the GNU General Public License for more +details. + +You should have received a copy of the GNU General Public +License along with this program; if not, write to the Free +Software Foundation, Inc., 675 Mass Ave, Cambridge, MA +02139, USA. + +=head1 AUTHOR + +Tobias Oetiker E<lt>tobi@oetiker.chE<gt> + +=cut |