This article can be reproduced freely, but please follow"Signature-non-commercial use-consistent". Permanent Link:JoeCens
-----------------------------
I. Introduction
SmokepingYesRrdtoolAuthorTobi OetikerSo it has a great advantage in graphic display and is also a very characteristic opensource tool:
Multiple detection methods, including fping, echoping, dig, and curl;
Easy to use and scalable plug-ins;
Master/slaveYou can collect data from the same monitoring site on multiple nodes;
Alert settings are quite distinctive, not just a simple set of thresholds;
The current version of smokeping is2.4.2This article is based on this version.
Ii. Installation
Download Page:Http://oss.oetiker.ch/smokeping/pub/
1. preparations:
Smokeping is a program written in perl, so it does not need to be installed. However, he needs to use some tools and perl modules, such as rrdtool, fping, and echoping, which must be installed in advance.
If debian is used, you can directly use apt to install it:
Aptitude install rrdtool apache2 fping echoping libapache2-mod-speedycgi libwww-perl libsocket6-perl libnet-telnet-perl libnet-dns-perl libnet-ldap-perl libio-socket-ssl-perl libauthen-radius-perl libcgi- perl librrds-perl librrdp-perl
For other linux releases, you can useCPANTo install the perl module.
When smokeping is started, it will also check whether the program to be used can be found.
2. settings:
In the smokeping subdirectory, you will find many files named "*. dist". Change these files to "*" and configure them.
Bin/smokeping
The main program runs in the background.
In this file, we need to modify the path of the first two lib and the config file.
The two lib libraries are the lib of smokeping and the lib of rrdtool respectively.
My smokeping is installed in the/usr/local/directory, so my settings are as follows:
Use lib qw (/usr/lib/perl5 /);
Use lib qw (/usr/local/smokeping/lib );
Smokeping: main ("/usr/local/smokeping/etc/config ");
Htdocs/smokeping. cgi
Displays pages, images, and slave Data Transmission interfaces. The setting method is similar to "bin/smokeping.
However, the path of speedy in the first line may need to be modified. Otherwise, only a white page is displayed in the browser.
Htdocs/cropper /*
This tool is used to zoom in and out page images.
Etc/config
The main configuration file is very important.
It uses perlConfig: GrammarModule.
For more detailed configuration, click html ">Here.
In section:
* ** General ***
Here I mainly configure several paths:
Imgcache =/home/temp/smokeping/cache
Imgurl = https: // smokeping/smokepingcache
Datadir =/home/temp/smokeping/data
Piddir =/home/temp/smokeping/var
Cgiurl = https: // smokeping/smokeping. cgi (I used ssl)
To display Chinese characters on the page, go to section:
* ** Presentation ***
, Add:
Charset = gb2312
However, the rrdtool image still does not display Chinese characters.
Etc/basepage.html
Displays the main frame of the page. You just need to configure the location of "htdocs/cropper.
3. Configure apache:
<Directory/usr/local/smokeping/htdocs/>
AllowOverride None
AddHandler cgi-script cgi
Options ExecCGI
</Directory>
Alias/smokeping/"/usr/local/smokeping/htdocs /"
Alias/smokepingcache/"/home/temp/smokeping/cache /"
Iii. Common Use
1. Start Using
The smokeping configuration file "etc/config" uses the Config file in the form of config: Grammar and uses "+" as the starting symbol of the layer.
For example:
+ Layer1
Menu = layer1
Title = layer1
++ Site1
Menu = layer2
Title = layer2
++ Myhost1
Menu = layer3
Title = layer3
Host = myhost.com
++ Myhost2
Menu = layer4
Title = layer4
Host = yourhost.com
...
Myhost1 and myhost2 belong to site1, while site1 belongs to layer1. In addition, the sub-layer "menu" and "title" are not required.
After configuration, you can start smokeping:
./Bin/smokeping
If there is an error, debug it:
./Bin/smokeping -- debug
2. multi-graph function
That is, to draw the values of multiple monitoring points in a graph, it is very simple:
++ Multi
Menu = Multi
Title = My Multi
Host =/layer1/site1/myhost1/layer1/site1/myhost2
All others are the same. The difference is that in "host", you can specify the path of the host to be put together (the previously configured host is required.
Iv. smoketrace
I personally think the new features added by the author in version 2.4 are of little use.
HereThere are detailed installation methods. If you also use the "htdocs" directory as the cgi directory, you do not need to change anything. You only need to set "htdocs/tr. cgi. the dist file is renamed "tr. cgi ", and configure the lib path.
Finally, in section:
* ** Targets ***
Add:
Menuextra = <a target = _ blank href1_tr.html {HOST} class = {CLASS}
Onclick = "Publish publish open(this.href,this.tar get,
Width = 800, height = 500, toolbar = no, location = no,
Status = no, scrollbars = no );
Return false; "> * </a>
You can see that each host on the left of the page is followed by a "*" number. Click this "*" number to bring up the trace page.
This trace is similar to the trace result of "MTR". Why is it useless? Because the returned results are relatively slow, and only the "master" machine can be used for trace.
V. master/slave Mode
The following describes the master and slave modes.See here.
[Slave 1] [slave 2] [slave 3]
|
+ ------- + | + -------- +
|
& N