File: smokeping_cgi

package info (click to toggle)
smokeping 2.8.2%2Bds-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 2,356 kB
  • sloc: perl: 17,637; sh: 3,884; makefile: 156; javascript: 114
file content (92 lines) | stat: -rwxr-xr-x 2,632 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
#!/usr/bin/perl
# -*-perl-*-   

use strict;
use warnings;

use lib (split /:/, q{}); # PERL5LIB

# don't bother with zombies
$SIG{CHLD} = 'IGNORE';

use CGI::Carp qw(fatalsToBrowser);

use Smokeping;

use CGI::Fast;

my $cfg = (shift @ARGV) || "/etc/smokeping/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

There is a sample F<htdocs> directory in your smokeping installation root. 
Copy its content to the place where your webserver expects its files.  The
fcgi script shows the preferred method for running smokeping.  You can also
run smokeping as a cgi.  But make sure to still use the wrapper as exposing
ARGV to the webserver represents a security vulnerability you may rather not
want to deal with.

Adjust the paths in the script and you should be ready to go.

=head1 SEE ALSO

L<smokeping_config(5)>, L<smokeping(1)>, L<smokeping_install(7)>,
L<smokeping_upgrade(7)>

=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