Directory
First, common monitoring software
Ii. Overview of Cacti
Three, cacti working principle
Iv. installation of cacti
V. Configure cacti Monitor the machine
Note: All software in this document is installed with Yum
I. Overview of common monitoring software
1, cacti
Cacti is a set of graphical analysis tools for network traffic monitoring based on PHP,MYSQL,SNMP and RRDtool development.
Simply put, cacti is a PHP program. It uses the SNMP protocol to obtain remote network devices and related information, (in fact, using the NET-SNMP software package snmpget and Snmpwalk command) and through the RRDtool tool drawing, through the PHP program to show. We use it to show the status or performance trend of a monitored object over time.
2. Nagios
Nagios is an open source, free network monitoring tool that effectively monitors Windows, Linux and UNIX host status, network settings such as switch routers, printers, and more. Send mail or SMS alarm when the system or service status is abnormal the first time to notify the site operators, after the status of the resumption of normal mail or SMS notification.
3, Zabbix
Zabbix is an enterprise-class open source solution that provides distributed system monitoring and network monitoring capabilities based on a web interface. Zabbix can monitor various network parameters, ensure the safe operation of the server system, and provide a soft notification mechanism for the system administrator to quickly locate/resolve various problems.
The Zabbix is composed of 2 parts, zabbixserver and optional Components Zabbix agent. Zabbix server can provide monitoring of remote server/network status, data collection and other functions through Snmp,zabbix agent,ping, port monitoring, etc., which can run on Linux, Solaris, HP-UX, AIX, free BSD, Open BSD, OS X and other platforms.
Ii. Overview of Cacti
1. Cacti is a software implemented in PHP language, its main function is to use the SNMP service to obtain data, and then use RRDtool storage and new data, when the user needs to view the data with RRDtool generated The chart is presented to the user. Therefore, SNMP and rrdtool are the cacti keys. SNMP is related to the collection of data, rrdtool relationship between data storage and chart generation.
2. mysql with PHP program to store some variable data and call the variable data, such as: Host name, host IP, SNMP community
Name, port number, template information, and other variables.
3. The SNMP catch data is not stored in MySQL, but exists in the RRDtool generated RRD file (under the Rra folder in the cacti root directory ). RRDtool Data Update and storage is the RRD file processing, the RRD file is a fixed size of the file (Round RobinArchive), it can store the number of data is defined at the time of Creation .
Three, cacti working principle
650) this.width=650; "src=" Http://img1.51cto.com/attachment/201310/12/2033581_13815694817428.png "width=" 678 " height= "268" style= "Float:left; alt=" 2033581_13815694817428.png "/>
Cacti Workflow:
Step one, the SNMP protocol collects data from the remote server
Step Two: Save the data collected by SNMP in the RRD database
Step three, if the user view the traffic or other status information on a device
Step four, find the name of the RRA database file for the device in the MySQL database
Step five, draw with the RRDtool command
Iv. installation of cacti
Cacti operating Environment first install lamp environment based on lamp environment
1. Install the Yum source
[email protected] ~]# Yum install-y epel-release
2. Synchronization Time
[[email protected] ~]# yum install-y ntpdate[[email protected] ~]# ntpdate time.windows.com12 Apr 22:44:15 ntpdate[11234] : Adjust time server 23.102.23.44 offset 0.109652 sec[[email protected] ~]#
3. Install lamp environment
Install related packages using Yum: Http,php,mysql
[[email protected] ~]# yum install-y httpd php php-mysql mysql mysql-server mysql-devel php-gd libjpeg libjpeg-devel li Bpng Libpng-devel
Setting up the boot-up service
[[email protected] ~]# chkconfig httpd on[[email protected] ~]# /etc/ init.d/httpd startstarting httpd: [ ok ][[email protected] ~]# chkconfig mysqld on[[email protected] ~ ]# /etc/init.d/mysqld startstarting mysqld: [ OK ][[email protected] ~]# netstat -tunlpActive Internet connections (Only servERS) proto recv-q send-q local address Foreign Address State PID/Program nametcp 0 0 127.0.0.1:53 0.0.0.0:* listen 2811/namedtcp 0 0 0.0.0.0:22 0.0.0.0:* listen 10947/sshdtcp 0 0 127.0.0.1:953 0.0.0.0:* LISTEN 2811/namedtcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN 1007/mastertcp 0 0 127.0.0.1:199 0.0.0.0:* LISTEN 10433/snmpdtcp 0 0 0.0.0.0:3306 0.0.0.0:* LISTEN 11490/mysqldtcp 0 0 :::80 :::* listen 11345/httpdtcp 0 0 ::1:53 :::* LISTEN 2811/namedtcp 0 0 :::22 :::* LISTEN 10947/sshdtcp 0 0 ::1:953 :::* listen 2811/ Namedtcp 0 0 ::1:25 :::* LISTEN 1007/masterudp 0 0 0.0.0.0:161 0.0.0.0:* 10433/snmpdudp 0 0 127.0.0.1:53 0.0.0.0:* 2811/namedudp 0 0 ::1:53 :::* &nbsP; 2811/named
Test PHP parsing
4, installation cacti Net-snmp RRDtool
[[email protected] ~]# yum install -y cacti net-snmp Net-snmp-utils rrdtool[[email protected] ~]# /etc/init.d/snmpd start[[email protected] ~]# netstat -tunlp|grep snmpdtcp 0 0 127.0.0.1:199 0.0.0.0:* LISTEN 10433/snmpdudp 0 0 0.0.0.0:161 0.0.0.0:* 10433/snmpd[[email protected] ~]#
5. Edit the httpd configuration file
[Email protected] ~]# vim/etc/httpd/conf.d/cacti.conf
This article is from the "Time Still Wipe" blog, please be sure to keep this source http://xulianglinux.blog.51cto.com/8001428/1763333
The cacti of Linux monitoring