LCG-FR / SA1-FR Monitoring WG CACTI

Un article de lcgwiki.
Revision as of 17:54, 9 décembre 2008 by LEROY (talk | contribs) (Utilisation des commandes en ligne)
Jump to: navigation, search

Installation et Configuration de CACTI

Installation

installation des RPMs

wget http://quattorsrv.lal.in2p3.fr/packages/cacti/cacti-0.8.7b-2.el4.rf.noarch.rpm
wget http://quattorsrv.lal.in2p3.fr/packages/os/sl460-x86_64/base/SL/RPMS/php-snmp-4.3.9-3.22.9.x86_64.rpm
wget http://quattorsrv.lal.in2p3.fr/packages/os/sl460-x86_64/base/SL/RPMS/mysql-server\
 -4.1.20-3.RHEL4.1.el4_6.1.x86_64.rpm
wget http://quattorsrv.lal.in2p3.fr/packages/os/sl460-x86_64/base/SL/RPMS/perl-DBD-MySQL-2.9004-3.1.x86_64.rpm
rpm -ivh http://quattorsrv.lal.in2p3.fr/packages/os/sl460-x86_64/base/SL/RPMS/perl-DBD-MySQL-2.9004-3.1.x86_64.rpm mysql-server-4.1.20-3.RHEL4.1.el4_6.1.x86_64.rpm
 

Config Mysql

/etc/init.d/mysqld start
mysqladmin --user=root password *yourpasswd*

mysqladmin --user=root create cacti -p
 mysql cacti -p  < /var/www/cacti/cacti.sql
Modifier 
/var/www/cacti/include/config.php

Config http

Modifier le fichier:

/etc/httpd/conf.d/cacti.conf


verifier que snmp V1 repond

snmpwalk -v 1 -c public 192.54.208.247


Utilisation des commandes en ligne

Cela permet d'automatiser la configuration de plusieurs machines:

http://www.cacti.net/downloads/docs/html/scripts.html

Ajouter un decvice (attention utiliser template 1 pour pouvoir recuperer les stats des interfaces)

for i in $(cat /root/CACTI/wnlistplat); do php -q add_device.php --avail=ping --ping_method=udp --ping_retries=1 \
 --description=$i --ip=$i --template=1 --community="public" ; done

Ajouter les devices dans un tree:

for i in $(seq  83 147); do php -q add_tree.php --type=node --node-type=host --tree-id=4 --host-id=$i; done


Ajouter les graphes (type 'ds') des interfaces pour tous les devices:

for i in $(seq  83 147); do php -q add_graphs.php --host-id=$i --graph-type=ds --snmp-query-id=1 \
--snmp-query- type-id=13 --snmp-field=ifOperStatus  --snmp-value=Up --graph-template-id=2 ; done

Ajouter les graphes cg linux

for i in $(seq  83 147); do  for j in  7 8 9 10 12 ; do  php -q add_graphs.php --host-id=$i  \
--snmp-query-id=6 --graph- template-id=$j --graph-type=cg; done; done