1024programmer Nginx NginxApacheSmokeping installation configuration detailed process

NginxApacheSmokeping installation configuration detailed process

Smokeping installation configuration

1. Introduction

smokeping is by Tobi the author of rrdtool
Oetiker’s work, so it has great advantages in graphic display, and it is also a very characteristic opensource tool: a variety of detection methods, including fping, echoping, dig, curl, etc.;

Easy-to-use and extensible plug-ins;

The working mode of master/slave can collect the data of the same monitoring point on multiple nodes; the distinctive alert setting is not just a simple setting of a threshold;

2. Installation

After installing LAMP and PERL, install the following software

Smokeping need few perl module and other package to
run.

1. RRDtools Download here : http://oss.oetiker.ch/rrdtool/
2. FPing Download here : http://www.fping.com/
3. EchoPing Download here : http://echoping.sourceforge.net/
4. Curl Download here : http://curl.haxx.se/
5. Dig Download here: http://www.isc.org/sw/bind/
6. SSH Download here : http://www.openssh.org/
Various Perl Module Download here :
http://www.cpan.org/

1. libwww-perl
2. Socket6 0.11-1
3. Net::Telnet
4. Net::DNS
5. Net::LDAP
6. IO::Socket::SSL
7. Authen::Radius

http://fping.sourceforge.net/download/fping.tar.gz

http://daemoninc.com/SpeedyCGI/CGI-SpeedyCGI-2.22.tar.gz

http://sourceforge.net/projects/echoping/files/echoping/6.0.2/echoping-6.0.2.tar.gz/download

http://oss.oetiker.ch/smokeping/pub/smokeping-2.4.2.tar.gz

My rrdtool chooses yum

If you compile with , change the configuration file
The use of two libs

Install fping

tar zxvf fping.tar.gz

cd fping-2.4b2_to/

./configure

make && make install

Install CGI-SpeedyCGI

tar Czxvf CGI-SpeedyCGI-2.22.tar.gz

cd CGI-SpeedyCGI-2.22

perl Makefile.PL

Compile mod_speedycgi (default no)? no

make && make install

tar zxvf echoping-6.0.2.tar.gz

cd echoping-6.0.2

./configure –prefix=/usr/local/echoping –with-ssl
–without-libidn

make && make install

tar zxvf smokeping-2.4.2.tar.gz

mv smokeping-2.4.2 /usr/local/smokeping

mkdir Cp /usr/local/smokeping/cache

mkdir Cp /usr/local/smokeping/var

1. /usr/local/smokeping/etc/config.dist

*** General ***
owner = apache
cOntact= [email protected]
mailhost = localhost
sendmail = /usr/local/bin/sendmail
# NOTE: do not put the Image Cache below cgi-bin
# since all files under cgi-bin will be executed … this is
not
# good for images.
imgcache = /usr/local/smokeping/cache
imgurl = ../cache don’t use absolute path
datadir = /usr/local/smokeping/var
piddir = /usr/local/smokeping/var
cgiurl = http://some.url/smokeping.cgi
smokemail = /usr/local/smokeping/etc/smokemail.dist
tmail = /usr/local/smokeping/etc/tmail.dist
# specify this to get syslog logging
syslogfacility = local0
# each probe is now run in its own process
# disable this to revert to the old behavior
# cOncurrentprobes= no
*** Alerts ***
#to = |/usr/local/smokeping/fx.sh
to = [email protected]
from = [email protected]
Define the packet loss rate;
+someloss
type = loss
# in percent
pattern = >0%,*12*,>0%,*12*,>0%
comment = loss 3 times in a row
(Inspected 12 times, there are 3 times of packet loss, no matter how many packets are lost, alter)
+rttbad
type = rtt
pattern ===S,>50,>50
comment = route
(If there are two consecutive delays of more than 50ms, alter it)
*** Database ***
(20 pings every 300 seconds)
step = 300
pings = 20
# consfn mrhb steps total
AVERAGE 0.5 1 1008
AVERAGE 0.5 12 4320
MIN 0.5 12 4320
MAX 0.5 12 4320
AVERAGE 0.5 144 720
MAX 0.5 144 720
MIN 0.5 144 720
*** Presentation ***
template = /usr/local/smokeping/etc/basepage.html.dist (define page template)
+ charts
menu = Charts
title = The most interesting destinations
++ stddev
sorter = StdDev(entries=>4)
title = Top Standard Deviation
menu = Std Deviation
format = Standard Deviation %f
++ max
sorter = Max(entries=>5)
title = Top Max Roundtrip Time
menu = by Max
format = Max Roundtrip Time %f seconds
++ loss
sorter = Loss(entries=>5)
title = Top Packet Loss
menu = Loss
format = Packets Lost %f
++ median
sorter = Median(entries=>5)
title = Top Median Roundtrip Time
menu = by Median
format = Median RTT %f seconds
+ overview Define traffic map size
width = 600
height = 50
range = 10h
+ detail
width = 600
height = 200
unison_tolerance = 2
“Last 3 Hours” 3h
“Last 30 Hours” 30h
“Last 10 Days” 10d
“Last 400 Days” 400d
#+ hierarchies
#++ owner
#title = Host Owner
#++ location
#title = Location
*** Probes ***
+ FPing
binary = /usr/sbin/fping Tool used by PING
#*** Slaves ***
#secrets=/home/oetiker/checkouts/smokeping/trunk/software/etc/smokeping_secrets.dist
#+boomer
#display_name=boomer
#color=0000ff
#+slave2
#display_name=another
#color=00ff00
*** Targets ***
probe = FPing
menu = Top
title = Network Latency Grapher
remark = Welcome to the SmokePing website of xxx Company. \
Here you will learn all about the latency of our network.
+ Test defines a first-level directory
menu= test
tile = test
#parents = owner:/Test/James location:/
++ host1 add host
title = host1
alerts = someloss,rttbad
host = 192.168.11.111
+ nagios
menu = nagios
++ nagios
title = nagios
alerts = someloss
host = 192.168.11.105

2. Modify /usr/local/smokeping/htdocs/smokeping.cgi

Cp /usr/local/smokeping/htdocs/smokeping.cgi.dist
usr/local/smokeping/htdocs/smokeping.cgi

use lib qw(/usr/bin/perl);

use lib qw(/usr/local/smokeping/lib);

Smokeping::cgi(“/usr/local/smokeping/etc/config.dist”);

3. Modify /usr/local/smokeping/bin/smokeping.dist

use lib qw(/usr/bin/perl);

use lib qw(/usr/local/smokeping/lib);

4. Start /usr/local/smokeping/bin/smokeping.dist start

Chown www.www /usr/local/smokeping CR

3. Configure httpd.conf

as follows:

Alias ​​/smokeping/ “/usr/local/smokeping/”

AllowOverride None

AddHandler cgi-script cgi

Options ExecCGI

Order allow, deny

Allow from all

Four, nginx configuration (install Fcgi first)

Install perl cgi module
wget
http://www.cpan.org/modules/by-module/FCGI/FCGI-0.67.tar.gz
tar -zxvf FCGI-0.67.tar.gz
cd FCGI-0.67
perl Makefile.PL
make && make install

Install FCGI-ProcManager:
wget
http://search.cpan.org/CPAN/authors/id/G/GB/GBJK/FCGI-ProcManager-0.18.t…
tar -xzxf FCGI-ProcManager-0.18.tar.gz
cd FCGI-ProcManager-0.18
perl Makefile.PL
make make install

Download the nginx-fcgi script
Wget http://www.nginx.eu/nginx-fcgi/nginx-fcgi.txt
Placed in: /etc/nginx-fcgi
Comment out
in nginx-fcgi.txt
if ( $> == “0″ ) {
print “\n\tERROR\tRunning as a root!\n”;
print “\tSuggested not to do so !!!\n\n”;
exit 1;
}
Otherwise, it will prompt: ERROR Running as a root! Suggested not to do so !!!
Start method:
/etc/nginx-fcgi -l /var/log/nginx-fcgi.log -pid
/var/run/nginx-fcgi.pid -S /var/run/nginx-fcgi.sock
Pay attention to the permission of nginx-fcgi.sock 777

Install FCGI with cpan before running Getopt::Long IO::All
Socket;

server

{

listen 80;

server_name
smokeping.linuxtone.org;

root
/usr/local/smokeping/smokeping/;

location ~ .*\.cgi$ {

root /usr/local/smokeping/htdocs/;

fastcgi_pass unix:/var/run/nginx-fcgi.sock;

fastcgi_index index.cgi;

include fastcgi_params;

include enable_php5.conf;

}

Test: /usr/local/smokeping/bin/smokeping.cgi –debug

Start script: http://oss.oetiker.ch/smokeping/pub/contrib/smokeping-start-script

Apache access: http://ip/smokeping/htdocs/smokeping.cgi

This article is from the internet and does not represent1024programmerPosition, please indicate the source when reprinting:https://www.1024programmer.com/nginxapachesmokeping-installation-configuration-detailed-process/

author: admin

Previous article
Next article

Leave a Reply

Your email address will not be published. Required fields are marked *

Contact Us

Contact us

181-3619-1160

Online consultation: QQ交谈

E-mail: [email protected]

Working hours: Monday to Friday, 9:00-17:30, holidays off

Follow wechat
Scan wechat and follow us

Scan wechat and follow us

Follow Weibo
Back to top
首页
微信
电话
搜索