ubuntu 12.04.5 LTS(Precise Pangolin)へzabbixエージェントをインストールする手順です。
なお、zabbix serverのバージョンは「Zabbix 3.0.7」です。
ubuntuのバージョンは異なりますがUbuntu 16.04 LTS(xenial)にzabbix3.0をソースからインストールを参考に作業を行いました。
zabbixのダウンロード
下記ページの「zabbixソース」部分のリンクからダウンロードしました。
現時点ではバージョン3.0.7が最新のようです。
zabbixの公式
root@microserver02:/usr/local/src# wget --no-check-certificate -O zabbix-3.0.7.tar.gz https://downloads.sourceforge.net/project/zabbix/ZABBIX%20Latest%20Stable/3.0.7/zabbix-3.0.7.tar.gz?r=http%3A%2F%2Fwww.zabbix.com%2Fjp%2Fdownload&ts=1487428040&use_mirror=jaist
コンパイルとインストール
root@microserver02:/usr/local/src# tar zxvf ./zabbix-3.0.7.tar.gz root@microserver02:/usr/local/src# cd ./zabbix-3.0.7/ root@microserver02:/usr/local/src/zabbix-3.0.7# ./configure --prefix=/usr/local --enable-agent checking for a BSD-compatible install... /usr/bin/install -c checking whether build environment is sane... yes checking for a thread-safe mkdir -p... /bin/mkdir -p checking for gawk... no checking for mawk... mawk ~略~ config.status: executing depfiles commands Configuration: Detected OS: linux-gnu Install path: /usr/local Compilation arch: linux Compiler: gcc Compiler flags: -g -O2 Library-specific flags: Enable server: no Enable proxy: no Enable agent: yes Agent details: TLS: no Linker flags: -rdynamic Libraries: -lm -ldl -lrt -lresolv Enable Java gateway: no LDAP support: no IPv6 support: no *********************************************************** * Now run 'make install' * * * * Thank you for using Zabbix! * * <http://www.zabbix.com> * ***********************************************************
make install します。
root@microserver02:/usr/local/src/zabbix-3.0.7# make install Making install in src make[1]: ディレクトリ `/usr/local/src/zabbix-3.0.7/src' に入ります Making install in libs make[2]: ディレクトリ `/usr/local/src/zabbix-3.0.7/src/libs' に入ります ~略~
ユーザー作成とログディレクトリ作成
root@microserver02:/usr/local/src/zabbix-3.0.7# groupadd zabbix root@microserver02:/usr/local/src/zabbix-3.0.7# useradd -g zabbix -s /bin/false -M zabbix root@microserver02:/usr/local/src/zabbix-3.0.7# mkdir /var/log/zabbix root@microserver02:/usr/local/src/zabbix-3.0.7# chown zabbix:zabbix /var/log/zabbix
設定ファイルの編集
/usr/local/etc/zabbix_agentd.conf を編集します。下記を変更しました。
#LogFile=/tmp/zabbix_agentd.log LogFile=/var/log/zabbix/zabbix_agentd.log #Server=127.0.0.1 Server=192.168.11.110 #ServerActive=127.0.0.1 ServerActive=192.168.11.110 #Hostname=Zabbix server Hostname=microserver02
起動スクリプトの作成
ソースを展開したフォルダからコピーします。
内容は特に変更しませんでした。
root@microserver02:/usr/local/src/zabbix-3.0.7# cp misc/init.d/ubuntu/zabbix-agent.conf /etc/init root@microserver02:/usr/local/src/zabbix-3.0.7# cp misc/init.d/debian/zabbix-agent /etc/init.d
zabbix agentの起動
root@microserver02:/usr/local/src/zabbix-3.0.7# /etc/init.d/zabbix-agent start
zabbix agentの起動確認
root@microserver02:/usr/local/src/zabbix-3.0.7# netstat -an | grep 10050 tcp 0 0 0.0.0.0:10050 0.0.0.0:* LISTEN
zabbix agentの自動起動
root@microserver02:/usr/local/src/zabbix-3.0.7# apt-get install sysv-rc-conf root@microserver02:/usr/local/src/zabbix-3.0.7# sysv-rc-conf zabbix-agent on
以上で完了です。