Настройка БД для cacti


cacti - это программа мониторинга трафика с хорошим веб-интерфейсом и удобными настройками. В 
отличие от zabbix, munun и других громоздких систем - cacti - "своя" программа для linux и unix, 
и заточена заточена она только под "железный" мониторинг. К сожалению, в cacti до сих пор много 
уязвимостей, поэтому доступ к ней нужно ограничивать как следует. Устанавливается кактус легко, с 
предварительной настройкой snmp-сервисов и демонов, что, в общем-то тоже не сложно. Единственный 
момент, который я всё время гуглю - установка и настройка базы данных. Однако, кажется в портах 
FreeBSD, нашлось такое красивое и компактное описание этого момента. Пусть останется на 
английском, как в оригинале:

POST-INSTALL INSTRUCTIONS

New Install

1. Create the new cacti database
   shell> mysqladmin -p --user=root create cacti
2. Import the default cacti database:
   shell> mysql -p --user=root cacti < /var/www/localhost/htdocs/cacti/cacti.sql
3. Create a MySQL username and password for cacti.
   shell> mysql -p --user=root mysql
   mysql> GRANT ALL ON cacti.* TO cacti@localhost IDENTIFIED BY 'Paey6yee';
   mysql> flush privileges;
4. Edit /var/www/localhost/htdocs/cacti/include/config.php and modify the MySQL user,
   password and database for your cacti configuration.

   Example:
        $database_default = "cacti";
        $database_hostname = "localhost";
        $database_username = "cactiuser";
        $database_password = "somepassword";

5. Point your web browser to:  http://localhost//cacti/
   Make sure to fill in all of the path variables carefully and
    correctly on the following screen.
6. After you've gone through the setup wizard, go back to the main cacti page
   and login as:
        Username: admin
        Password: admin

Upgrading

1. Backup DB in the case that something goes wrong.
   shell> mysqldump -l --add-drop-table cacti > mysql.cacti
2. Backup your rra/ directory and any custom scripts in your scripts/
   directory.
3. Edit /var/www/localhost/htdocs/cacti/include/config.php, and confirm that the MySQL user,
   password and database is correct for your cacti configuration.
   
   Example:
        $database_default = "cacti";
        $database_hostname = "localhost";
        $database_username = "cactiuser";
        $database_password = "somepassword";
4. Point your web browser to: http://localhost//cacti/
   Select "Upgrade".
   Make sure to fill in all of the path variables carefully and
   correctly on the following screen.

Cronjob

Either new or upgrading, make sure you have a cron job - Add this line to 
your /etc/crontab file:

   */5 * * * * apache /usr/bin/php /var/www/localhost/htdocs/cacti/poller.php > /dev/null 2>&1

Note that you should use poller.php as the cronjob instead of cmd.php (as it was with 
earlier versions) to enable you to switch between cmd.php and cactid.

Also make sure that the user poller.php runs as ( apache ) has
permission to create new files in Cacti's 'rra/' directory which is
/var/www/localhost/htdocs/cacti/rra