※接続できない場合以下を実施
systemctl status firewalld
systemctl stop firewall.d
これでcactiのトップが表示される
■cacti verUP
cd /usr/share
mv cacti cacti_old
wget http://www.cacti.net/downloads/cacti-1.0.4.tar.gz
tar xzvf cacti-1.0.4.tar.gz
mv cacti-1.0.4 cacti
cd /usr/share/cacti
■cactiの設定
vi /usr/share/cacti/include/config.php
30c30
< $database_password = "cactiuser";
---
> $database_password = "MyNewPass4!";
----------------------------------------------------
mysql -u root -p
DROP DATABASE cacti;
create database cacti;
grant all privileges on cacti.* to cactiuser@localhost identified by 'MyNewPass4!';
exit
mysql -u cactiuser -p cacti < /usr/share/cacti/cacti.sql ←上記で設定し
ERROR: Your Cacti database login account does not have access to the MySQL TimeZone database.
Please provide the Cacti database account "select" access to the "time_zone_name" table
in the "mysql" database, and populate MySQL's TimeZone information before proceeding.
~~まず古いcactiをyumでインストールしてそのあと1.04を置き換える。 ~~最後にphpのバージョンアップをしている。
... ★★参考 http://qiita.com/Kenji_TAJIMA/items/91965a94c624fa0c89ca
■net-snmp インストール http://www.server-memo.net/server-setting/snmp/net-snmp.html
■RRDTool インストール yum install rrdtool
■wgetインストール yum install wget
■MySQLインストール
wget http://dev.mysql.com/get/mysql-community-release-el7-5.noarch.rpm
rpm -Uvh mysql-community-release-el7-5.noarch.rpm
yum -y install php-mysql
chkconfig mysqld on
systemctl enable mysqld 自動起動設定
#
これではインストールされなかった
■MySQLインストール http://weblabo.oscasierra.net/installing-mysql57-centos7-yum/
...
★★ここからこちらに従う http://www.unix-power.net/linux/cacti.html
■cactiインストール cd /usr/local/src/
wget http://pkgs.repoforge.org/cacti/cacti-0.8.8b-1.el6.rf.noarch.rpm
←ダメだった
■mysql設定 /usr/bin/mysqladmin -u root password 'MyNewPass4!'
■cactiの設定 vi /usr/share/cacti/include/config.php
記で設定したcactiuserパスワード指定
/null 2>&1
/null 2>&1
■apacheの設定 vi /etc/httpd/conf.d/cacti.conf DROP DATABASE cacti;
■phpの設定 ※デフォルト設定だとアクセスするたびにphpエラーが出力されるため これを防ぐために以下設定をする。 vi /etc/php.ini
■接続確認 http://35.167.250.10/cacti/install/
■cacti verUP cd /usr/share mv cacti cacti_old
■cactiの設定 vi /usr/share/cacti/include/config.php
たcactiuserパスワード指定
■posix インストール
■ldap インストール yum install php-ldap
■mbstring インストール yum install php-mbstring
■gd インストール yum install php-gd
■mysqlチューニング vi /etc/my.cnf
...
■接続確認 http://35.167.250.10/cacti
...
cacti表示後のインストール作業 以下のエラーが出ていて次にすすめない。
ERROR: Your Cacti database login account does not have access to the MySQL TimeZone database. Please provide the Cacti database account "select" access to the "time_zone_name" table in the "mysql" database, and populate MySQL's TimeZone information before proceeding.
エラー:CactiデータベースのログインアカウントにMySQL TimeZoneデータベースへの アクセス権がありません。 「mysql」データベースの「time_zone_name」テーブルへの Cactiデータベースアカウントの「選択」アクセスを提供し、 処理を続ける前にMySQLのTimeZone情報を入力してください。
タイムゾーン対処ページ http://tmtms.hatenablog.com/entry/2015/08/22/mysql-timezone
MyNewPass4!
★対応 mysql -u root -p grant all privileges on . to cactiuser@localhost identified by 'MyNewPass4!'; show grants;
↓ まだ以下のエラーが残っている。
エラー:MySQL TimeZoneデータベースにデータが入力されていません。 続行する前にこのデータベースにデータを入力してください。
★対応 mysql -u root -p USE mysql SHOW TABLES LIKE '%time_zone%'; SELECT * FROM time_zone; ←まだタイムゾーンが追加されていない。 exit
mysql_tzinfo_to_sql /usr/share/zoneinfo mysql_tzinfo_to_sql /usr/share/zoneinfo | mysql -uroot mysql ←登録
mysql -u root -p USE mysql SHOW TABLES LIKE '%time_zone%'; SELECT * FROM time_zone; ←登録された。
↓ エラー解消
ログイン情報 http://35.167.250.10/cacti/ admin Kccs0000!
SPINEインストール ソース場所:http://www.cacti.net/downloads/spine/cacti-spine-1.0.4.tar.gz
cd /usr/local/src;pwd wget http://www.cacti.net/downloads/spine/cacti-spine-1.0.4.tar.gz
tar xvzf cacti-spine-.tar.gz cd cacti-spine- ./configure
開発ツールをインストール yum groupinstall 'Development tools'
このエラーがでるので
configure:3471: gcc -lpthread -lssl -lm conftest.c >&5 /bin/ld: cannot find -lssl collect2: error: ld returned 1 exit status
yum install openssl-devel
上記は解消したが新たなエラーが
configure: error: Cannot find MySQL headers. Use --with-mysql= to specify non-default path.
yum install mysql-community-devel
このエラーも残っていた
common.h:134:38: fatal error: net-snmp/net-snmp-config.h: No such file or directory
yum install net-snmp-devel
これですべて解消
make
エラーでた
[root@ip-10-56-121-31 cacti-spine-1.0.4]# make false // No help2man // --output=spine.1 --name='Data Collector for Cacti' --no-info --version-option='--version' ./spine make: *** [spine.1] Error 1
yum install help2man
これで解決
sudo make install
Spineは、デフォルトの場所/ usr / local / spineにインストールされます。 /usr/local/spine/etc/spine.confを正しいデータベース情報で更新することを忘れないでください。 最後にCacti設定のSpineパスを/ usr / local / spine / bin / spineに更新し、Poller TypeをSpineに切り替えます。
vi /usr/local/spine/etc/spine.conf.dist
45c45 < DB_Pass cactiuser
あとはcacti画面より実施
Spineがシステムにインストールされたら、次の手順を実行してCactiインストールで認識させる必要があります。
1.管理者としてCactiにログインします。 2.メニューの[設定]を選択し、[パス]タブをクリックします。
これらのステップを完了すると、Cactiはcmd.phpではなく5分ごとにSpineを生成します。 Spineにデータを収集させるのに問題がある場合、 いつでもPoller Typeを一時的に "cmd.php"に戻すことができます。
グラフが作成されない
RRDTool Says: ERROR: opening '/usr/share/cacti/rra/local_linux_machine_mem_buffers_4.rrd': No such file or directory が出ていたので
これをやってみる chmod 777 /usr/share/cacti/rra/ これでrrdファイルが作られた
これでグラフの枠は出力されたが、値がでてこない とりあえず /usr/share/cacti/ 配下を chown -R cacti:cacti とする。
これでもグラフ値が出てこないので selinuxをoffに
getenforce vi /etc/selinux/config
shutdown -r now
あとは以下の権限を777へ chmod 777 /usr/share/cacti/rra chmod 777 /usr/share/cacti/rra/ chmod 777 /usr/share/cacti/plugins chmod 777 /usr/share/cacti/plugins/
php 7.1 バージョンアップ
remiリポジトリ追加 rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-7.rpm
インストール前にmysql,apache,net-snmpを停止しておく
systemctl stop httpd systemctl status httpd
systemctl stop mysqld systemctl status mysqld
systemctl stop snmpd systemctl status snmpd
yum list --enablerepo=remi-php71 php yum install --enablerepo=remi-php71 php
■SPINEでデータ取得できない タイマを伸ばしてみる 25→60
cacti画面からの設定で「パス」の Spine Config File Pathに /usr/local/spine/etc/spine.conf.distを設定する
...