Ubuntu 14.04
Sponsored Link

Cacti : インストール2016/01/17

 
Cacti をインストールし、システムの状態を監視できるようにします。
[1]
[2]
[3]
[4] Cacti, SNMP をインストールします。
root@dlp:~#
apt-get -y install cacti snmp snmpd snmp-mibs-downloader php5-mysql php5-snmp rrdtool
# 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>                                   |
   |                                                                        |
   +------------------------------------------------------------------------+

# 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] SNMP (Simple Network Management Protocol) を設定します。
root@dlp:~#
vi /etc/snmp/snmp.conf
# 4行目:コメントにする

#
mibs :
root@dlp:~#
vi /etc/snmp/snmpd.conf
# 49行目:コメント解除してコミュニティ名を任意の名前に変更

rocommunity
Serverworld
localhost
# 51行目:コメントにする

#
rocommunity public default -V systemonly
root@dlp:~#
/etc/init.d/snmpd restart

* Restarting network management services:
# 動作確認 (「Serverworld」の箇所は設定したコミュニティ名)

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] Cacti 用のユーザーとデータベースを MariaDB に登録し、テーブルをインポートしておきます。
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.

# 「Cacti」データベース作成 ( 'password'の箇所は設定するパスワードを入力 )

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)]>
exit

Bye
root@dlp:~#
mysql -u cacti -p cacti < /usr/share/doc/cacti/cacti.sql

Enter password:    
# cacti ユーザーのパスワード
[7] Cacti の設定です。
root@dlp:~#
vi /usr/share/cacti/site/include/config.php
# 42行目:DB接続情報を変更

$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
# 17行目:必要に応じてアクセス許可範囲を変更

#
Require all granted
Require host localhost
Require ip 10.0.0.0/24
root@dlp:~#
/etc/init.d/apache2 restart

関連コンテンツ