息抜き

Rubyがなかなか進まないので息抜きがてらZabbix2.4をインストした。

ここにしたがってパッケージを追加してやる。

1) リポジトリ登録
# rpm -ivh http://repo.zabbix.com/zabbix/2.4/rhel/7/x86_64/zabbix-server-2.4.3-1.el7.x86_64.rpm
http://repo.zabbix.com/zabbix/2.4/rhel/7/x86_64/zabbix-server-2.4.3-1.el7.x86_64.rpm を取得中
警告: /var/tmp/rpm-tmp.VOoJhc: ヘッダー V4 DSA/SHA1 Signature、鍵 ID 79ea5ed4: NOKEY
エラー: 依存性の欠如:
        OpenIPMI-libs >= 2.0.14 は zabbix-server-2.4.3-1.el7.x86_64 に必要とされています
        fping >= 3 は zabbix-server-2.4.3-1.el7.x86_64 に必要とされています
        iksemel は zabbix-server-2.4.3-1.el7.x86_64 に必要とされています
        net-snmp は zabbix-server-2.4.3-1.el7.x86_64 に必要とされています
        unixODBC は zabbix-server-2.4.3-1.el7.x86_64 に必要とされています
        zabbix は zabbix-server-2.4.3-1.el7.x86_64 に必要とされています
        zabbix-server-implementation = 2.4.3-1.el7 は zabbix-server-2.4.3-1.el7.x86_64 に必要とされています

色々足りない・・・。

足りないものを入れる。

その前にyumのプライオリティを設定できるようにyum-plugin-prioritiesを入れる。

fpingとiksemelは標準パッケージで提供されてないらしく, RPMfforgeリポジトリから入れるのがいいらしい。
(パッケージってすごく便利だけど, なんか色々と背景がめんどくさいね。いや, 自分でコンパイルして入れるよりも全然いいんだけどさ)

RPMforgeのリポジトリの設定の仕方はググる。
1) RPMforgeリポジトリ登録
2) priorityを設定(20にした) そしてzabbixのpriorotyはなんとなく10に・・・。
以上。
あとは再びfping/iksemelのインストール。
# yum –enablerepo=rpmforge -y install fping

iksemelのパッケージが見つからないのでzabbixのnonn-supportから直接インストールした。
# rpm -ivh http://repo.zabbix.com/non-supported/rhel/7/x86_64/iksemel-1.4-2.el7.centos.x86_64.rpm

んーこれだったらfpingも合わせておけばよかったかな。ま, いっか。

再びZabbixインストールへ戻る。

2) zabbixインストール
# yum –enablerepo=zabbix install zabbix-server-mysql zabbix-web-mysql
# yum –enablerepo=zabbix install zabbix-agent

3) Database作成
※事前にmariadb, mariadb-serverをインストールしておく

# mysql -u root -p
Enter password:
Welcome to the MariaDB monitor.  Commands end with ; or g.
Your MariaDB connection id is 11
Server version: 5.5.41-MariaDB MariaDB Server

Copyright (c) 2000, 2014, Oracle, MariaDB Corporation Ab and others.

Type ‘help;’ or ‘h’ for help. Type ‘c’ to clear the current input statement.

MariaDB [(none)]> create database zabbix character set utf8 collate utf8_bin;
Query OK, 1 row affected (0.00 sec)

MariaDB [(none)]> grant all privileges on zabbix.* to zabbix@localhost identified by ‘z@bbix’;
Query OK, 0 rows affected (0.00 sec)

MariaDB [(none)]> quit;
Bye


# mysql -u root -p zabbix < ./schema.sql
Enter password:
# mysql -u root -p zabbix < ./images.sql
Enter password:
# mysql -u root -p zabbix < data.sql
Enter password:

完了。

4) zabbix_server.confの編集

# vi /etc/zabbix/zabbix_server.conf
DBHost=localhost
DBName=zabbix
DBUser=zabbix
DBPassword=db-pass

5) PHPの設定
# vi /etc/httpd/conf.d/zabbix.conf
php_value max_execution_time 300
php_value memory_limit 128M
php_value post_max_size 16M
php_value upload_max_filesize 2M
php_value max_input_time 300
php_value date.timezone Asia/Tokyo

ここはタイムゾーンだけいじった。

6) zabbix起動

# systemctl enable zabbix-server
# systemctl start zabbix-server

ここまできたら http://zabbixのIP/zabbix/ にアクセスできるんだがFirewalldが効いていて弾かれる。
んーーーあっちゃこっちゃで制御するとめんどいし, うちはL3SWでACLかけるからサーバ側のFW系止めちゃうか。SELinuxも合わせて。

ってことで

# setenforcce 0
# systemctl stop firewalld
# systemctl disable firewalld

以上。

こっからはWebbUIにしたがって設定していく。

いやーやっぱ目に見える結果があるといいね。