Cacti

De Admin -- TALEVAS.
Version du 14 octobre 2009 à 10:37 par Admin (discuter | contributions)
(diff) ← Version précédente | Voir la version courante (diff) | Version suivante → (diff)

Sommaire

DOC de gentoo-wiki.com

Getting Started

Before installing cacti check for net-snmp package.

Cacti/SNMP host setup

You will probably need the following USE flags set:

USE = mysql xml sockets vhosts

For php to work correctly

You will probably need the following USE flags set:

USE = apache2 snmp vhosts

For cacti.

To install Cacti run the following command:

emerge cacti

This will install cacti onto your system.

If you already installed php, but without xml flag set, you should re-emerge php with USE="xml" first of all! The same applies for the sockets flag.

NOTE: You have to run the command

webapp-config -I -h localhost -d cacti cacti <version  #> 

after you run the emerge.

Config

After installation you will need to edit the config file and insert the proper data to fit your installation Modèle:Box File

Install the database

First you need to create a database named 'cacti' with a user named cactiuser

mysql -u root -p
mysql> create database cacti;
mysql> grant all on cacti.* to cactiuser@localhost;
mysql> set password for cactiuser@localhost=password('cactipass');
mysql> exit


If this is a fresh installation of mysql you might get a message like "Can't connect to local MySQL server through Can't connect to local MySQL server through socket /var/run/mysqld/mysqld.sock (2)" . Just run mysql_install_db


While in the cacti folder run this command to insert the default database

mysql -u cactiuser -p cacti < cacti.sql

Finish the configuration by accessing the cacti web page

http://url/to/cacti/

Configure the required file paths. If you're going to login for the first time, the password-username pair is admin-admin by default.

Set the permissions on the cacti directories to be able to generate the graph/log. Execute this command in the cacti folder.

chown -R apache:apache rra/ log/

Crontab

as your cacti user add the following to the cron file

*/5 * * * * apache php <cacti path>/cacti/poller.php > /dev/null 2>&1


notice, under vixie cron you do not specify user account that the cronjob is ran, so you must use

*/5 * * * * php <cacti path>/cacti/poller.php > /dev/null 2>&1

Troubleshooting

If no graphs are generated and you receieve the following message in your cron logs, this indicates that an entry can not be found for the apache user in /etc/shadow.

su: Authentication service cannot retrieve authentication info.

This can be fixed by adding it with the following command:

pwconv

More

Modèle:Subpage


penser au fichier de config pour cactid

vim /etc/cactid.conf


Déplacer CACTI dans le serveur

Il faut en plus de copier les fichier refaire l'index des fichiers rra =>

php rebuild_poller_cache.php 

Et ca JAZZ ensuite


Ajouter un user sur le serveur distant

net-snmp-config --create-snmpv3-user -a "my_password" my_user


Ouvrir le port 161 pour snmp

iptables -A INPUT -p udp --dport 161 -i eth0 -j ACCEPT


IPV6

  • mettre le check sur le host uniquement en SNMP
  • dans "hostname" préfixé avec udp6: => udp6:playbox2.talevas.fr