cloretsblackのテクニカルノート

言葉の意味はよくわからんがとにかくすごい自信だ

CentOS7にCactiをインストールする

新しいCentOS7が出たのでCactiを入れてみる。

少しハマッたので備忘。

#yum install -y perl php httpd net-snmp net-snmp-utils php-mysql php-snmp rrdtool mariadb-server

#rpm -ivh http://ftp.iij.ad.jp/pub/linux/fedora/epel//6/x86_64/cacti-0.8.8b-7.el6.noarch.rpm

#rpm -q cacti

mysql設定

#systemctl start mariadb.service
#systemctl enable mariadb.service

MysqlCacti環境作成

#mysqladmin -u root -p create password

#mysql -u root -p cacti < /usr/share/doc/cacti-0.8.8b/cacti.sql

mysql -u root -p

>grant all on cacti.* to cactiuser@localhost identified by 'cactiuser';
>flush privileges;

 

config設定

#vi /etc/httpd/conf.d/cacti.conf

<Directory /usr/share/cacti/> 直下に
Require all granted を追加

 

#vi /etc/sysconfig/httpd
LANG=ja_JP.UTF-8 を追加

 

/etc/httpd/conf/httpd.conf の ServerName にホスト名を入れる
ServerName ホスト名
これをやらないとhttpd起動時にエラーメッセージが出る

 

#vi /usr/share/cacti/include/config.php

$url_path = "/cacti/"; コメントをはずす

 

#vi /etc/php.ini
date.timezone = Asia/Tokyo を追加

 

WEBサービスを上げる

#systemctl restart httpd.service
#systemctl enable httpd.service

 

ファイアーウォールを止める

#systemctl list-unit-files | grep firewall
#systemctl disable firewalld.service
#reboot

できあがり。

http://hostname/cacti/

にアクセスして初期設定。