174 lines
5.0 KiB
Plaintext
174 lines
5.0 KiB
Plaintext
Description: hardcode the path to the config file in CGI
|
|
Author: Antoine Beaupré <anarcat@debian.org>
|
|
Forwarded: not-needed
|
|
Last-Update: 2019-02-16
|
|
|
|
Index: b/bin/smokeping_cgi
|
|
===================================================================
|
|
--- a/bin/smokeping_cgi 2018-05-12 17:02:02.090910241 -0400
|
|
+++ b/bin/smokeping_cgi 2018-05-12 17:05:36.224389954 -0400
|
|
@@ -4,9 +4,7 @@
|
|
use strict;
|
|
use warnings;
|
|
|
|
-use FindBin;
|
|
use lib (split /:/, q{}); # PERL5LIB
|
|
-use lib "$FindBin::RealBin/../lib";use lib "$FindBin::RealBin/../thirdparty/lib/perl5"; # LIBDIR
|
|
|
|
# don't bother with zombies
|
|
$SIG{CHLD} = 'IGNORE';
|
|
@@ -17,7 +15,7 @@ use Smokeping;
|
|
|
|
use CGI::Fast;
|
|
|
|
-my $cfg = (shift @ARGV) || "$FindBin::Bin/../etc/config";
|
|
+my $cfg = (shift @ARGV) || "/etc/smokeping/config";
|
|
|
|
|
|
while (my $q = new CGI::Fast) {
|
|
Index: b/bin/smokeping
|
|
===================================================================
|
|
--- a/bin/smokeping 2018-05-12 17:04:04.175753876 -0400
|
|
+++ b/bin/smokeping 2018-05-12 17:05:08.868200917 -0400
|
|
@@ -4,13 +4,11 @@
|
|
use strict;
|
|
use warnings;
|
|
|
|
-use FindBin;
|
|
use lib (split /:/, q{}); # PERL5LIB
|
|
-use lib "$FindBin::RealBin/../lib";use lib "$FindBin::RealBin/../thirdparty/lib/perl5"; # LIBDIR
|
|
|
|
use Smokeping;
|
|
-
|
|
-Smokeping::main("$FindBin::RealBin/../etc/config");
|
|
+
|
|
+Smokeping::main("/etc/smokeping/config");
|
|
|
|
=head1 NAME
|
|
|
|
@@ -128,25 +126,6 @@ L<documentation on the SmokePing configuration file|smokeping_config>.
|
|
|
|
Please refer to L<the installation document|smokeping_install> for detailed setup instructions.
|
|
|
|
-=head1 SETUP
|
|
-
|
|
-When installing SmokePing, this file has to be adjusted to fit your
|
|
-local system. Three paths have to be entered.
|
|
-
|
|
-One pointing to your B<rrdtool> installation
|
|
-
|
|
- use lib qw(/usr/pack/rrdtool-1.0.33-to/lib/perl);
|
|
-
|
|
-One pointing to the place where you have installed the SmokePing libraries
|
|
-
|
|
- use lib qw(/home/oetiker/public_html/smokeping/lib);
|
|
-
|
|
-The third path is the argument to the Smokeping::main command. It points to
|
|
-the SmokePing configuration file.
|
|
-
|
|
- use Smokeping;
|
|
- Smokeping::main("/home/oetiker/.smokeping/config");
|
|
-
|
|
=head1 SEE ALSO
|
|
|
|
L<smokeping_config(5)>, L<smokeping_examples(5)>, L<smokeping_cgi(1)>,
|
|
Index: b/bin/tSmoke
|
|
===================================================================
|
|
--- a/bin/tSmoke 2018-05-12 17:04:04.175753876 -0400
|
|
+++ b/bin/tSmoke 2018-05-12 17:06:18.924685024 -0400
|
|
@@ -53,7 +53,6 @@ use warnings;
|
|
# Point the lib variables to your implementation
|
|
|
|
use lib (split /:/, q{}); # PERL5LIB
|
|
-use FindBin;use lib "$FindBin::RealBin/../lib";use lib "$FindBin::RealBin/../thirdparty/lib/perl5"; # LIBDIR
|
|
|
|
|
|
use Smokeping;
|
|
@@ -63,7 +62,7 @@ use Pod::Usage;
|
|
use RRDs;
|
|
|
|
# Point to your Smokeping config file
|
|
-my $cfgfile = (shift @ARGV) || "$FindBin::Bin/../etc/config";
|
|
+my $cfgfile = (shift @ARGV) || "/etc/smokeping/config";
|
|
|
|
# global variables
|
|
my $cfg;
|
|
@@ -498,39 +497,9 @@ past week and past month including an overview.
|
|
Typical crontab used to invoke this are
|
|
|
|
# Quick morning alert to see what's down
|
|
- 0 6 * * * /usr/local/smokeping/bin/tSmoke.pl --q --to=mobilephone@att.net.invalid --morning
|
|
+ 0 6 * * * /usr/sbin/tSmoke --q --to=mobilephone@att.net.invalid --morning
|
|
# Weekly report on the percent availability of network systems with no detail
|
|
- 0 8 * * * /usr/local/smokeping/bin/tSmoke.pl --q --to=mailbox@company.com.invalid --weekly --detail=0
|
|
-
|
|
-=head1 SETUP
|
|
-
|
|
-When installing tSmoke, some variables must be adjusted to fit your local system.
|
|
-
|
|
-We need to use the following B<libraries>:
|
|
-
|
|
-=over
|
|
-
|
|
-=item Smokeping
|
|
-
|
|
-=item RRDTool Perl bindings
|
|
-
|
|
-=item Getopt::Long
|
|
-
|
|
-=back
|
|
-
|
|
-Set up your libraries:
|
|
-
|
|
- use lib "/usr/local/smokeping/lib";
|
|
- use lib "/usr/local/rrdtool-1.0.39/lib/perl";
|
|
-
|
|
-Point to your Smokeping B<config> file
|
|
-
|
|
- my $cfgfile = "/usr/local/smokeping/etc/config";
|
|
-
|
|
-Modify the Smokeping config file to include a path for tmail in the
|
|
-General section:
|
|
-
|
|
- tmail = /usr/local/smokeping/etc/tmail
|
|
+ 0 8 * * * /usr/sbin/tSmoke --q --to=mailbox@company.com.invalid --weekly --detail=0
|
|
|
|
=head1 SEE ALSO
|
|
|
|
diff --git a/bin/smokeinfo b/bin/smokeinfo
|
|
index 7c56c0f..83a346e 100755
|
|
--- a/bin/smokeinfo
|
|
+++ b/bin/smokeinfo
|
|
@@ -3,7 +3,6 @@ use strict;
|
|
use warnings;
|
|
|
|
use lib (split /:/, q{}); # PERL5LIB
|
|
-use FindBin;use lib "$FindBin::RealBin/../lib";use lib "$FindBin::RealBin/../thirdparty/lib/perl5"; # LIBDIR
|
|
|
|
use Smokeping::Info;
|
|
use Getopt::Long 2.25 qw(:config no_ignore_case);
|
|
@@ -82,19 +81,19 @@ they work on the same syntax.
|
|
|
|
Get all data all nodes
|
|
|
|
- smokeinfo etc/config
|
|
+ smokeinfo /etc/smokeping/config
|
|
|
|
Only show nodes directly under /Customers
|
|
|
|
- smokeinfo --filter=/Customers/ etc/config
|
|
+ smokeinfo --filter=/Customers/ /etc/smokeping/config
|
|
|
|
Show all nodes under /Customers
|
|
|
|
- smokeinfo --mode=recursive --filter=/Customers/ etc/config
|
|
+ smokeinfo --mode=recursive --filter=/Customers/ /etc/smokeping/config
|
|
|
|
Show all nodes with '_wlan_' in the name
|
|
|
|
- smokeinfo --mode=regexp --filter=_wlan_ etc/config
|
|
+ smokeinfo --mode=regexp --filter=_wlan_ /etc/smokeping/config
|
|
|
|
=head1 SEE ALSO
|
|
|