Debian cacti installation procedure

Source: Internet
Author: User
Tags rrd rrdtool snmpget snmpwalk mrtg
Debian: Install cacti-Debian, the Linux release technology. For more information, see the following. I. Comparison of mrtg and cacti:
Advantages of MRTG: simple and easy to use. After installation, you only need to change the configuration file.
Disadvantages:
1. text-based databases cannot be reused;
2. data can only be viewed by day, week, month, or year;
3. Only two DS (one line and one block) can be drawn );
4. data needs to be painted every time data is retrieved, which wastes system resources;
5. No management functions;
Advantages of rrdtool:
1. Data can be reused in rrd storage format. For example, I can add the data in an rrd file to the data in another rrd file.
2. You can define a graph for any time period, that is, you can draw a graph of data from the past six months or a graph of the past half an hour.
3. can draw any DS.
4. CDEF allows you to play with data at will.
Disadvantages:
1. rrdtool is only used to store data and draw images. It does not have the data collection function integrated in mrtg;
2. The use of command lines is very complex, with many parameters.
3. No management function.
In short, rrdtool is a powerful drawing engine.
Because of its complex commands and unfriendly user experience, I wanted to write a system in php. Fortunately, I found cacti (www.cacti.net) six months ago ). I only have one word for this tool: "great !".
Cacti is actually a php program that uses snmpget to collect data and rrdtool to plot data. Its interface is very beautiful, so that you do not need to understand the rrdtool parameters to easily draw beautiful images. Even more valuable, it provides powerful data management and user management functions. A graph belongs to a host, and each host can be attached to a tree structure. In terms of user management, as an open-source software, it can actually specify a "Tree", host ", or even each graph that a user can view, you can also use LDAP for user verification! I can't help admiring the thoughtful consideration of the Author! Cacti also provides its own template function, allowing you to add your own snmp_query and script! It can be said that cacti makes up all the "disadvantages" of rrdtool!
Here are two pictures to help you understand:
Ii. cacti installation steps:
Ensure that the software packages GCC, Perl, gd, libpng, and zlib are available before, so it is best to install them under debian.
Apt-cache show mrtg
Package: mrtg
Priority: extra
Section: net
Installed-Size: 1308
Maintainer: Adam Majer
Architecture: i386
Version: 2.14.7-2
Depends: debconf (> = 1.2.0) | debconf-2.0, libsnmp-session-perl (> = 0.97), perl-modules (> = 5.6.0), perl (> = 5.6.0-16 ), libc6 (> = 2.3.6-6), libgd2-noxpm (> = 2.0.33) | libgd2-xpm (> = 2.0.33), libpng12-0 (> = 1.2.8rel), zlib1g (> =. 2.1) you can see the dependencies of mrtg.
1. Install mysql
Find the source code package online
2. install apache
Download:
Http://apache.freelamp.com/httpd/httpd-2.0.54.tar.bz2
Installation:
./Configure -- prefix =/www -- enable-so checking for chosen layout... apr
Checking for gcc... no
Checking for cc... no
Checking for cl.exe... no
Configure: error: no acceptable C compiler found in $ PATH
See 'config. log' for more details. Ensure that gcc is available before installation.
Make & make install make; make install
Bash: make: command not found
Bash: make: command not found indicates that The make package is not installed. aptitude search makep make-the GNU version of The "make" utility.
Create Startup Script
Cp/www/bin/apachectl/etc/init. d/httpd
Start
/Www/bin/apachectl start
Cat/etc/inittab: The system startup Item is added after the runlevel.
Cd/etc/rc3.d
Ln-s ../init. d/httpd S85httpd
Ln-s ../init. d/httpd K85httpd
2. install php
Download:
Http://us4.php.net/get/php-4.3.10.tar.gz/from/cn2.php.net/mirror

Installation: refer to: less INSTALL
./Configure -- with-apxs2 =/usr/local/apache2/bin/apxs -- with-mysql
E LIBXML support... yes
Checking libxml2 install dir... no
Check for xml2-config path...
Configure: error: xml2-config not found. Please check your libxml2 installation. found that libxml2 is not installed, so:
[Email = liangyin @ debian :~ /Php-5.2.5 $] liangyin @ debian :~ /Php-5.2.5 $ [/email]
Sudo aptitutde search libxml2
Make & make install
Checking for MSSQL support via FreeTDS... no
Checking for MySQL support... yes
Checking for specified location of the MySQL UNIX socket... no
Checking for MySQL UNIX socket location.../var/run/mysqld. sock
Configure: error: Cannot find MySQL header files under yes.
Note that the MySQL client library is not bundled anymore!
Found no apt-cache show php5-mysql installed
Package: php5-mysql
Priority: optional
Section: web
Installed-Size: 236
Maintainer: Debian PHP Maintainers
Architecture: i386
Source: php5
Version: 5.2.0-8 + etch10
Replaces: php5-mysqli
Depends: libc6 (> = 2.3.6-6), libmysqlclient15off (> = 5.0.27-1), phpapi-20060613 + lfs, php5-common (= 5.2.0-8 + etch10)
Debian:/home/liangyin/php-5.2.5 # aptitude search myslq


Cp php. ini-dist/www/php. ini
Vi/www/conf/httpd. conf
Join:
############## For php and cacti ###################
AddType application/x-tar. tgz
AddType application/x-httpd-php. php
AddType image/x-icon. ico
DirectoryIndex index. php index.html. var
################ ########
3,
4. Set mysql
# Mysql-u root-prootroot
Welcome to the MySQL monitor. Commands end with; or \ g.
Your MySQL connection id is 10 to server version: 4.0.23-standard
Type 'help; 'or' \ H' for help. Type '\ C' to clear the buffer.
Mysql>; create database cactidb;
Query OK, 1 row affected (0.00 sec)
Mysql>; grant all on cactidb. * to root;
Query OK, 0 rows affected (0.01 sec)
Mysql>; grant all on cactidb. * to root @ localhost;
Query OK, 0 rows affected (0.01 sec)
Mysql>; grant all on cactidb. * to cactiuser;
Query OK, 0 rows affected (0.00 sec)
Mysql>; grant all on cactidb. * to cactiuser @ localhost;
Query OK, 0 rows affected (0.01 sec)
Mysql>; set password for cactiuser @ localhost = password ('cactipw ');
Query OK, 0 rows affected (0.00 sec)
Mysql>; exit
5. Install rrdtool
Download:
Http://people.ee.ethz.ch /~ Dtool-1.0.50.tar.gz...
Then
./Configure
Make & make install
Compared with mrtg, rrdtool comes with the gd library, so you do not need to install the gd library first. (However, because the gd library provided by rrdtool does not support Chinese characters, the diagram drawn by rrdtool cannot contain Chinese characters. Otherwise, garbled characters may occur ).
Note: rrdtool1.2 version because no longer comes with external lib Library (such as cgilib, zlib, etc.), so need from the http://people.ee.ethz.ch /~ Oetiker/webtools/rrdtool/pub/libs/download these libraries for installation. We recommend that you use version 1.0 for ease of use.
6. Install net-snmp
Snmp is installed on almost all network devices and operating systems by default.
The unix system is installed with net-snmp or ucd-snmp (in fact, both are written by the same group of people ).
If you have not installed snmp, you can download the source code compilation installation on the net-snmp.sourceforge.org.
I mentioned here that installing the SNMP service does not require installing SNMPD. Actually, Cacti needs to use two net-snmp commands ?? Snmpwalk and snmpget are used to collect data.
You can run snmpwalk and snmpget in the system to check whether the command exists. If yes, you do not need to install it. 7. Install cacti
Note: When writing this document, the maximum cacti version is 0.8.6c, and the current maximum version is 0.8.6f. Since versions earlier than 0.8.6f have the SQL injection vulnerability, please download version 0.8.6f or later for installation.
Download:
Http://www.cacti.net/downloads/cacti-0.8.6c.tar.gz
Installation:
Cp cacti-0.8.6c.tar.gz/www/htdocs
Tar xzvf cacti-0.8.6c.tar.gz
Music cacti-0.8.6c cacti
Cd cacti
Import table:
/Usr/local/mysql/bin/mysql? U root? Prootroot cactidb
Set the configuration file:
Vi/www/htdocs/cacti/include/config. php
$ Database_type = "mysql ";
$ Database_default = "cactidb ";
$ Database_hostname = "localhost ";
$ Database_username = "cactiuser ";
$ Database_password = "cactipw ";
Check whether the preceding items are correct
Crontab? U cactiuser? E
Add cactiuser
*/5 */www/php/bin/php/www/htdocs/cacti/poller. php>;/dev/null 2>; & 1
(Do not run the preceding command as the root user; otherwise, run chown again? R cactiuser rra/log /)
8. Page settings:
Enter:
Http: // IP/cacti
Go to the initial cacti settings page:
Here we need to enter some original information:
NEXT-"
Enter some information, such as the location of rrdtool, php, snmpwalk, and snmpget, and use ucd-snmp or net-snmp.
Enter the original user and password: admin/admin-
Change admin user password-"
Click Save
Installation complete!
Now you can enter the Cacti world in the browser!

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.