ZABBIX – agent Mac OS X

先週 Windows版のZABBIX-agentをインストール設定まで行い、特に問題が無いようなので今日は、MacOSX 10.5.6 Serverにインストールと設定を行います。

とは言ってもインストールMacPortsを利用するので、2Stepで完了です。ながらくMacPortを利用していなかったので、syncから始めたいところですが、macport自体をアップデートするところから始めます。

$ sudo port -d selfupdate
$ sudo port -d sync
$ port variants zabbix
zabbix has the variants:
server: Dummy variant
pgsql81: Use PostgreSQL 8.1.x for server database
pgsql82: Use PostgreSQL 8.2.x for server database
pgsql83: Use PostgreSQL 8.3.x for server database
sqlite3: Use SQLite3 for server database
agent_only: Do not install the Zabbix server
universal: Build for multiple architectures
$ port install zabbix +agent_only

インストール完了後、設定ファイルと起動ファイルを作成するわけですが、インストール後、詳しく設定方法が表示されますので、この通りでOKかと。

1) Edit the sample .conf file /opt/local/etc/zabbix/zabbix_agentd.conf (rename & omit .sample)

Set the following variable to the ip address of your ZABBIX server to
allow it access to the agent.

Server=x.x.x.x

2) Set zabbix_agentd to run at system boot

OS X 10.4 and up – Run launchctl so ZABBIX will start at system boot
sudo launchctl load -w /Library/LaunchDaemons/org.macports.zabbix.plist

OS X 10.3 and previous – A startup item was created in /Library/StartupItems
Add “ZABBIX=-YES-” to the /etc/hostconfig file to run ZABBIX at system boot

To start Zabbix manually, use: /opt/local/share/zabbix/zabbix_agentd.init start (stop|status)

3) A Win32 agent is in /opt/local/share/zabbix/zabbix_agent_win32 for
installation on Windows NT 4.0, Windows 2000, and Windows XP.

今回設定は、この通りにしました。

$ sudo cp /opt/local/etc/zabbix/zabbix_agentd.conf.sample /opt/local/etc/zabbix/zabbix_agentd.conf
$ sudo vi /opt/local/etc/zabbix/zabbix_agentd.conf
Server=192.168.0.xxx
Hostname=hoge
$ sudo launchctl load -w /Library/LaunchDaemons/org.macports.zabbix.plist
$ /opt/local/share/zabbix/zabbix_agentd.init start

すばらしい事に、TemplateにはMacOSXも既に含まれていますので便利ですね!

コメントを残す

メールアドレスが公開されることはありません。 が付いている欄は必須項目です

CAPTCHA