Cacti : Install2016/01/17 |
Install Cacti to monitor system status.
|
|
[1] | |
[2] | |
[3] | |
[4] | Install Cacti, SNMP. |
root@dlp:~# apt-get -y install cacti snmp snmpd snmp-mibs-downloader php5-mysql php5-snmp rrdtool
# select apache2 +-------------------------+ 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 +---------------------------+ 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> | | | +---------------------------------------------------------------------------+ |
[5] | 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 49: uncomment and change to any comunity name you like rocommunity Serverworld localhost
# line 51: comment out # rocommunity public default -V systemonly
root@dlp:~#
/etc/init.d/snmpd restart * Restarting network management services: # 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 3.13.0-74-generic #118-Ubuntu SMP Thu Dec 17 22:52:10 UTC 2015 x86_64 SNMPv2-MIB::sysObjectID.0 = OID: NET-SNMP-MIB::netSnmpAgentOIDs.10 DISMAN-EVENT-MIB::sysUpTimeInstance = Timeticks: (18674) 0:03:06.74 ..... ..... SNMPv2-MIB::sysORUpTime.9 = Timeticks: (0) 0:00:00.00 SNMPv2-MIB::sysORUpTime.10 = Timeticks: (0) 0:00:00.00 |
[6] | Create a Database for Cacti and import tables. |
root@dlp:~# mysql -u root -p Enter password: Welcome to the MariaDB monitor. Commands end with ; or \g. Your MariaDB connection id is 57 Server version: 5.5.46-MariaDB-1ubuntu0.14.04.2 (Ubuntu) Copyright (c) 2000, 2015, 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)
MariaDB [(none)]>
flush privileges; Query OK, 0 rows affected (0.00 sec)
MariaDB [(none)]>
root@dlp:~# exit Bye mysql -u cacti -p cacti < /usr/share/doc/cacti/cacti.sql Enter password: # cacti user's password
|
[7] | Configure Cacti. |
root@dlp:~#
vi /usr/share/cacti/site/include/config.php # line 42: change Cacti's DB connection info $database_type = "mysql"; $database_default = " cacti ";$database_hostname = "localhost"; $database_username = " cacti ";$database_password = " password ";$database_port = " 3306 ";$database_ssl = false;
root@dlp:~#
vi /etc/apache2/conf-available/cacti.conf # line 17: change access permission # Require all granted
Require host localhost
Require ip 10.0.0.0/24 /etc/init.d/apache2 restart |
Sponsored Link |