Cacti, SNMP and Gentoo

Riscy's picture

Here are the instructions I followed to get SNMP and Cacti working on Gentoo:

emerge cacti cacti-cactid
groupadd cacti
useradd -g cacti -G cron cactiuser

cd /var/www/localhost/htdocs/cacti/
mysql --user=root cacti < cacti.sql
chown -R cactiuser rra/ log/
mysql
mysql> create database cactidb;
mysql> grant all on cactidb.* to root;
mysql> grant all on cactidb.* to root@localhost;
mysql> grant all on cactidb.* to cactiuser;
mysql> grant all on cactidb.* to cactiuser@localhost;
mysql> set password for cactiuser@localhost=password('mycactipw');
mysql> exit

nano config.php

$database_type = "mysql";
$database_default = "cacti";
$database_hostname = "localhost";
$database_username = "cactiuser";
$database_password = "mycactipw";

Now open browser to http://localhost/cacti

Follow the steps:

Login as admin password admin
change password

Back to the command line

crontab -e -u cactiuser
*/5 * * * * /usr/bin/php /var/www/localhost/htdocs/cacti/poller.php > /dev/null 2>&1

nano -w /etc/snmp/snmpd.conf

com2sec local     127.0.0.1/32    public
com2sec local     10.10.10.0/24   public

group MyROGroup v1         local
group MyROGroup v2c        local
group MyROGroup usm        local

view all    included  .1                               80

access MyROGroup ""      any       noauth    exact  all    none   none

syslocation MyLocation
syscontact Me <me@somewhere.org>

/etc/init.d/snmpd start
rc-update add snmpd default

Should be all good!

You should change this line "useradd -g cacti cactiuser" to "useradd -g cacti -G cron cactiuser". Beyond that, this was a fantastic help today. Thanks!

Mark Mills (not verified) | Sat, 03/12/2005 - 5:14am

Thanks for the update. I have changed the blog entry.

Here is also another guide in the Gentoo forums:
http://forums.gentoo.org/viewtopic-t-276539-highlight-cacti.html

Riscy | Thu, 15/12/2005 - 10:09am

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.