Server version RedHat 6.4-64
First, solve the permission problem:
1. Ssh-keygen # if it is a root user, the default directory generated is id_rsa (Public Key) id_rsa.pub (Private Key), which is the two files under/root/. Ssh)
2. CD/root/. Ssh/& chmod 600id_rsa * change the permission of the two files to 600.
3. Ssh-copy-ID-I/root/. Ssh/[email protected] # Add the public/private key authentication of the monitored Node
First, check whether the python-redis module is installed on the server. If not, install:
Yum-y install Python-redis
Download the redis script and template file.
Address:
Https://github.com/nazgul5/cacti-redis
Put the redis-status.py under the $ cacti/scripts/directory and add the permission:
Chmod 755 redis-status.py
Import cacti_host_template_redis_server.xml to cacti on the cacti page.
650) This. width = 650; "src =" http://s3.51cto.com/wyfs02/M02/44/D0/wKioL1Pi3a3jBoW8AAOa-dAjSnU774.jpg "Title =" redis.png "alt =" wKioL1Pi3a3jBoW8AAOa-dAjSnU774.jpg "/>
In the cacti console, click Import templates and Click Browse to import the cacti_host_template_redis_server.xml file to cacti,
You can add the redis server to be monitored to the device. The default template should only have four modules for monitoring,
If there is no data, check whether the redis-status.py file has execution permission in the/var/www/html/scripts/directory on the server side, if you have the permission, run the command to go to the/var/www/html/RRA/directory to check whether the command is generated ***. RRD file. If yes, run: rrdtool fetchredis_46_connected_clients_225.rrd average. If the result is 1407335100:-Nan, there is no data in the file, so the line of the page is not drawn,
Since the RRD file is generated, it proves that you have established a connection with the machine you need to monitor, that is, the data is not caught, how can this happen, may be the problem of redis-status.py execution, okay, let's see if this script is correct.
Go to the/var/www/html/scripts/directory and execute:
Python/var/www/html/scripts/redis_v1.py the IP address of the machine to be monitored-P redis port number
But I reported the following when executing the command:
650) This. width = 650; "src =" http://s3.51cto.com/wyfs02/M00/44/CF/wKiom1Pi3KLR-ElCAAFUwt7SneI012.jpg "Title =" redis2.png "alt =" wKiom1Pi3KLR-ElCAAFUwt7SneI012.jpg "/>
This problem is really weird, I have read the online information is still not able to solve, and finally found the problem under the guidance of high people, the original I modified the name of the redis-status.py file to redis. py is stored in the/var/www/html/scripts/directory. When loading, he puts redis. the py script is loaded, but the installed redis module is not loaded. PY to solve this problem, funk, modify redis. after py, do not forget to change the script name on the cacti page. You can modify the Script Name in Console> data input methods> redis statistics, remember to modify the same name as the script on the server ,,,