Cacti monitors Redis implementation process and cacti monitors redis

Source: Internet
Author: User
Tags rrdtool import database ssh port

Cacti monitors Redis implementation process and cacti monitors redis


Cacti is a set of graphic analysis tools for network traffic monitoring developed based on PHP, MySQL, SNMP, and RRDTool. It is widely used in server O & M monitoring. Cacti provides plug-in management. As long as you write a specific template as required, you can monitor the traffic of any service. This article will introduce two templates: the Cacti templates for MongoDB and Redis. You can use them to monitor the traffic of your MongoDB and Redis services.

1. Upgrade python. If it is the default python version of the system, the following error will occur:

Python setup. py install

Traceback (most recent call last ):

File "setup. py", line 3, in?

From redis import _ version __

File "/usr/local/src/redis-2.4.11/redis/_ init _. py", line 1, in?

From redis. client import Redis, StrictRedis

File "/usr/local/src/redis-2.4.11/redis/client. py", line 240

With self. pipeline (True, shard_hint) as pipe:

^

SyntaxError: invalid syntax



2. Install python. First configure the python environment and download the python source code.
Wget http://www.python.org/ftp/python/2.5.2/Python-2.5.2.tar.bz2
$ Tar-jxvf Python-2.5.2.tar.bz2
$ Cd Python-2.5.2
$./Configure
$ Make
$ Make install

 

[Root @ mysqlvm2 Python-2.5.2] # python

Python 2.4.3 (#1, Jun 11 2009, 14:09:37)

[GCC 4.1.2 20080704 (Red Hat 4.1.2-44)] on linux2

Type "help", "copyright", "credits" or "license" for more information.

>>>

Version is still 2.4.3. The solution is as follows:

# Cd/usr/bin
# Ll | grep python // view python in this directory
# Rm-rf python

Just repeat the soft connection.

[Root @ mysqlvm2 Python-2.5.2] # ln-s/usr/local/bin/python/usr/bin/python

[Root @ mysqlvm2 Python-2.5.2] #

[Root @ mysqlvm2 Python-2.5.2] # python

Python 2.5.2 (r252: 60911, Aug 4 2014, 14:43:36)

[GCC 4.1.2 20080704 (Red Hat 4.1.2-54)] on linux2

Type "help", "copyright", "credits" or "license" for more information.

>>>

 

3. Download The apsaradb for redis template.

Wget http://mysql-cacti-templates.googlecode.com/files/better-cacti-templates-1.1.8.tar.gz

Configure monitoring script

 

To monitor mongodb or redis, You need to download better-cacti-templates-1.1.8 \ scripts

The ss_get_by_ssh.php script must be placed on the cacti server.

 

If cacti is installed in the/var/www/html/cacti/directory.

Put the file under the scripts directory. Don't forget to check the permissions. You must have the execution permission.

 

Then modify the file. Modify the options in about 40 rows.

 

#===================================================== ============================================

$ Ssh_user = 'root'; # SSH username

$ Ssh_port = 22; # SSH port

$ Ssh_iden = '-I/root/. ssh/id_rsa'; # SSH identity

# Modify the location of your ssh connection user and authentication private key based on your configuration.

If the value is greater than 50 rows, you can also modify the default port to be tested (if redis is not a normal default port, You need to modify the value ).

 

$ Redis_port = 6379; # Which port redis listens on

 

 

4. Import the template. The template directory is better-cacti-templates-1.1.8 \ templates.

On the cacti interface, create the Graph of the redis server as follows:

 

5. View Graph as follows:

 


From:Http://blog.itpub.net/26230597/viewspace-1254930/



Cacti monitoring

1. Enable the snmp service for vswitches and vrouters
2. Specify an snmp data receiving server for the vswitch and vro
3. You can monitor the data After configuring the preceding two items.

At the same time, we recommend cacti, the best software for network monitoring I have found.

Red hat linux unless you pay for a red update source...
No, you have to at least compile and install the software to solve the dependency problem.
Dejavu-lgc-sans-mono-fonts
Mysql
Net-snmp
Php
Php-cli
Php-common
Php-mysql
Php-pdo
Php-snmp
Rrdtool
Dejavu-fonts-common
Dejavu-sans-fonts
Dejavu-sans-mono-fonts
Dejavu-serif-fonts
Mysql-libs
Net-snmp-libs

Nagios is recommended for server monitoring, which is very powerful.

Installing the cacti monitored host is always in the Unknown state;

# Mysql-u root-p
Password:
# Mysql> create database cacti;
# Mysql> grant all on cacti. * to cacti @ localhost identified by 'cacti ';
Modify cacti to make it accessible to the database
# Vim/usr/local/cacti/include/config. php
# $ Database_type = "mysql ";
# $ Database_default = "cacti ";
# $ Database_hostname = "localhost ";
# $ Database_username = "cacti ";
# $ Database_password = "cacti ";
# $ Database_port = "3306 ";
Import database files
# Mysql-u root-p cacti <cacti. SQL
 

Related Article

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.