Cacti : Install2025/10/03 |
|
Install Cacti that is a free and open-source computer system monitoring, network monitoring, and infrastructure monitoring software. |
|
| [1] | |
| [2] |
Configure SSL/TLS setting, refer to here. (not required but recommended) |
| [3] | |
| [4] | |
| [5] | Install Cacti, SNMP. |
|
root@dlp:~#
vi /etc/apt/sources.list # add [non-free] to each line deb http://deb.debian.org/debian/ trixie main non-free-firmware non-free deb http://security.debian.org/debian-security trixie-security main non-free-firmware non-free deb http://deb.debian.org/debian/ trixie-updates main non-free-firmware non-free deb http://deb.debian.org/debian/ trixie-backports main non-free-firmware non-free
root@dlp:~#
apt update root@dlp:~# apt -y install cacti snmp snmpd snmp-mibs-downloader php-mysql php-snmp php-intl rrdtool # select [apache2] on here +-------------------------------+ Configuring cacti +-------------------------------+ | Please select the web server for which Cacti should be automatically configured. | | | | Select "None" if you would like to configure the web server manually. | | | | Web server: | | | | apache2 | | lighttpd | | None | | | | | | <Ok> | | | +-----------------------------------------------------------------------------------+ # select [No] on here +---------------------------------------------------+ Configuring cacti +---------------------------------------------------+ | | | The cacti package must have a database installed and configured before it can be used. This can be optionally handled | | with dbconfig-common. | | | | If you are an advanced database administrator and know that you want to perform this configuration manually, or if your | | database has already been installed and configured, you should refuse this option. Details on what needs to be done | | should most likely be provided in /usr/share/doc/cacti. | | | | Otherwise, you should probably choose this option. | | | | Configure database for cacti with dbconfig-common? | | | | <Yes> <No> | | | +---------------------------------------------------------------------------------------------------------------------------+ |
| [6] | Configure SNMP (Simple Network Management Protocol). |
|
root@dlp:~#
vi /etc/snmp/snmp.conf # line 4 : comment out # mibs :
root@dlp:~#
vi /etc/snmp/snmpd.conf # line 71,72 : comment out and add a line # change [Serverworld] to your any community name #rocommunity public default -V systemonly #rocommunity6 public default -V systemonly rocommunity Serverworld localhost rocommunity6 Serverworld localhost
root@dlp:~#
systemctl restart snmpd # validation : replace [Serverworld] to the comunity name you set root@dlp:~# snmpwalk -v 2c -c Serverworld localhost system SNMPv2-MIB::sysDescr.0 = STRING: Linux dlp.srv.world 6.12.43+deb13-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.12.43-1 (2025-08-27) x86_64 SNMPv2-MIB::sysObjectID.0 = OID: NET-SNMP-MIB::netSnmpAgentOIDs.10 DISMAN-EVENT-MIB::sysUpTimeInstance = Timeticks: (833) 0:00:08.33 SNMPv2-MIB::sysContact.0 = STRING: Me <me@example.org> SNMPv2-MIB::sysName.0 = STRING: dlp.srv.world SNMPv2-MIB::sysLocation.0 = STRING: Sitting on the Dock of the Bay SNMPv2-MIB::sysServices.0 = INTEGER: 72 SNMPv2-MIB::sysORLastChange.0 = Timeticks: (0) 0:00:00.00 SNMPv2-MIB::sysORID.1 = OID: SNMP-FRAMEWORK-MIB::snmpFrameworkMIBCompliance SNMPv2-MIB::sysORID.2 = OID: SNMP-MPD-MIB::snmpMPDCompliance SNMPv2-MIB::sysORID.3 = OID: SNMP-USER-BASED-SM-MIB::usmMIBCompliance SNMPv2-MIB::sysORID.4 = OID: SNMPv2-MIB::snmpMIB SNMPv2-MIB::sysORID.5 = OID: SNMP-VIEW-BASED-ACM-MIB::vacmBasicGroup SNMPv2-MIB::sysORID.6 = OID: TCP-MIB::tcpMIB SNMPv2-MIB::sysORID.7 = OID: UDP-MIB::udpMIB SNMPv2-MIB::sysORID.8 = OID: IP-MIB::ip SNMPv2-MIB::sysORID.9 = OID: SNMP-NOTIFICATION-MIB::snmpNotifyFullCompliance SNMPv2-MIB::sysORID.10 = OID: NOTIFICATION-LOG-MIB::notificationLogMIB ..... ..... |
| [7] | Create a Database for Cacti and import tables. |
|
root@dlp:~#
vi /etc/mysql/mariadb.conf.d/50-server.cnf [mariadbd] # add follows under the [mariadbd] section for Cacti requirements default-time-zone=SYSTEM character-set-server=utf8mb4 character_set_client=utf8mb4 collation-server=utf8mb4_unicode_ci max_heap_table_size=128M tmp_table_size=128M innodb_doublewrite=OFF innodb_buffer_pool_size=2048M innodb_flush_log_at_timeout=3 innodb_read_io_threads=32 innodb_write_io_threads=16 innodb_io_capacity=5000 innodb_io_capacity_max=10000root@dlp:~# systemctl restart mariadb root@dlp:~# mysql Welcome to the MariaDB monitor. Commands end with ; or \g. Your MariaDB connection id is 49 Server version: 11.8.3-MariaDB-0+deb13u1 from Debian -- Please help get to 10k stars at https://github.com/MariaDB/Server Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. # create a [Cacti] database ( set any password for [password] section ) MariaDB [(none)]> create database cacti; Query OK, 1 row affected (0.00 sec) MariaDB [(none)]> grant all privileges on cacti.* to cacti@'localhost' identified by 'password'; Query OK, 0 rows affected (0.00 sec) # as a requirement for Cacti, grant the [select] permission to the [time_zone_name] parameter MariaDB [(none)]> grant select on mysql.time_zone_name to cacti@'localhost'; Query OK, 0 rows affected (0.005 sec) MariaDB [(none)]> exit Bye root@dlp:~# mariadb-tzinfo-to-sql /usr/share/zoneinfo | mysql -u root mysql root@dlp:~# mysql -u cacti -p cacti < /usr/share/doc/cacti/cacti.sql Enter password: # cacti user's password |
| [8] | Configure Cacti. |
|
root@dlp:~#
vi /etc/php/8.4/fpm/pool.d/www.conf ;; add to last line for Cacti requirements php_value[max_execution_time] = 60 php_value[memory_limit] = 512M php_value[date.timezone] = Asia/Tokyo
root@dlp:~#
vi /usr/share/cacti/site/include/config.php # line 45 : change Cacti DB connection info $database_type = "mysqli"; $database_default = "cacti"; $database_hostname = "localhost"; $database_username = "cacti"; $database_password = "password"; $database_port = "3306"; $database_retries = 5; $database_ssl = false;
root@dlp:~#
vi /etc/apache2/conf-available/cacti.conf
# line 6 : change access permission if you need
#Require all granted
Require ip 127.0.0.1 10.0.0.0/24
root@dlp:~# chown -R www-data:www-data /usr/share/cacti/resource root@dlp:~# chown -R www-data:www-data /usr/share/cacti/site/scripts root@dlp:~# systemctl reload apache2 php8.4-fpm root@dlp:~# chown www-data:www-data /var/log/cacti/{poller-error,rrd}.log |
| Sponsored Link |
|
|