Aller au contenu

« Cacti » : différence entre les versions

De Admin -- TALEVAS
Aucun résumé des modifications
Aucun résumé des modifications
 
(2 versions intermédiaires par 2 utilisateurs non affichées)
Ligne 1 : Ligne 1 :
== 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
{{Box File|<path to cacti>include/config.php|
<pre> ...
$database_type = "mysql";
$database_default = "cacti";
$database_hostname = "localhost";
$database_username = "cactiuser";
$database_password = "cactipass";
$database_port = "3306";
... </pre>
}}
== 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.
<pre>
su: Authentication service cannot retrieve authentication info.
</pre>
This can be fixed by adding it with the following command:
<pre>pwconv</pre>
== More ==
* [[Cacti]]
* [[Cacti/Installation]]
* [[Cacti/SNMP host setup]]
* [[Cacti/Hacking prevention]]
* http://cacti.net
{{subpage}}
== penser au fichier de config pour cactid ==
vim /etc/cactid.conf
== Déplacer CACTI dans le serveur ==
== Déplacer CACTI dans le serveur ==


Ligne 18 : Ligne 118 :


iptables -A INPUT -p udp --dport 161  -i eth0 -j ACCEPT
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

Dernière version du 14 octobre 2009 à 10:37

DOC de gentoo-wiki.com[modifier]

Getting Started[modifier]

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[modifier]

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[modifier]

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[modifier]

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[modifier]

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[modifier]

Modèle:Subpage


penser au fichier de config pour cactid[modifier]

vim /etc/cactid.conf


Déplacer CACTI dans le serveur[modifier]

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[modifier]

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


Ouvrir le port 161 pour snmp[modifier]

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


IPV6[modifier]

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