LoginSignup
6
6

More than 5 years have passed since last update.

Amazon Linux AMI 2014.03にZabbixエージェントのRPMパッケージをインストールする

Last updated at Posted at 2014-03-28

お知らせ

公開場所を変更しました。また、サーバーも使いだしたのでサーバーのRPMパッケージも作りました。

詳細は http://qiita.com/iwaim@github/items/7aa60fb5403a70714062 を参照してください。

前置き

Amazon Linux AMIで使えるZabbixエージェントを作成したのでインストール方法を公開しておく。ちょっと前に2013.09用に作ったけどAmazon Linux AMI 2014.03でも動いているっぽい。

最終的な公開場所はどこにするか検討中だけど、とりあえずDropboxに置いておく。

インストール

yumの設定

yumリポジトリーの設定ファイルが含まれているRPMパッケージをインストールする。

$ rpm -ivh https://dl.dropboxusercontent.com/u/5110926/repos/amzn/1/x86_64/ec2-zabbix-release-1-1.ec2.noarch.rpm

あるいは/etc/yum.repos.d/ec2-zabbix.repoなどの名前で次のようなファイルを作る。

/etc/yum.repos.d/ec2-zabbix.repo
[ec2-zabbix]
name=Zabbix for Amazon Linux AMI $releasever - $basearch - unofficial
baseurl=https://dl.dropboxusercontent.com/u/5110926/repos/amzn/1/$basearch/
enabled=1
gpgcheck=0

[ec2-zabbix-source]
name=Zabbix for Amazon Linux AMI $releasever - $basearch - Source - unofficial
baseurl=https://dl.dropboxusercontent.com/u/5110926/repos/amzn/1/SRPMS/
enabled=0
gpgcheck=0

yumでのインストール

「zabbix-agent」というパッケージ名なのでyumでインストールする。

$ sudo yum install zabbix-agent
Loaded plugins: priorities, update-motd, upgrade-helper
amzn-main/latest                                         | 2.1 kB     00:00     
amzn-updates/latest                                      | 2.3 kB     00:00     
ec2-zabbix/x86_64                                        | 2.9 kB     00:00     
Resolving Dependencies
--> Running transaction check
---> Package zabbix-agent.x86_64 0:2.2.2-1.ec2 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

================================================================================
 Package             Arch          Version              Repository         Size
================================================================================
Installing:
 zabbix-agent        x86_64        2.2.2-1.ec2          ec2-zabbix        242 k

Transaction Summary
================================================================================
Install  1 Package

Total download size: 242 k
Installed size: 488 k
Is this ok [y/d/N]: y
Downloading packages:
zabbix-agent-2.2.2-1.ec2.x86_64.rpm                      | 242 kB     00:00     
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Warning: RPMDB altered outside of yum.
  Installing : zabbix-agent-2.2.2-1.ec2.x86_64                              1/1 
  Verifying  : zabbix-agent-2.2.2-1.ec2.x86_64                              1/1 

Installed:
  zabbix-agent.x86_64 0:2.2.2-1.ec2                                             

Complete!
$ 

OS起動時にZabbixエージェントも起動させる

$ sudo /sbin/chkconfig zabbix-agent on
$ 

リポジトリーに存在するRPMパッケージ

SRPMを含め、以下のRPMパッケージを作った。

  • SRPMS/zabbix-2.2.2-1.ec2.src.rpm
  • x86_64/zabbix-2.2.2-1.ec2.x86_64.rpm
  • x86_64/zabbix-agent-2.2.2-1.ec2.x86_64.rpm
  • x86_64/zabbix-debuginfo-2.2.2-1.ec2.x86_64.rpm
  • x86_64/zabbix-get-2.2.2-1.ec2.x86_64.rpm
  • x86_64/zabbix-sender-2.2.2-1.ec2.x86_64.rpm

公式RPMパッケージのSPECファイルをベースとしている。そのため、ZabbixサーバーのRPMパッケージは、SRPMをリビルドすれば作成できる。

6
6
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
6
6