Skip to content

Instantly share code, notes, and snippets.

@okisanjp
Last active December 28, 2015 07:39
Show Gist options
  • Save okisanjp/7465900 to your computer and use it in GitHub Desktop.
Save okisanjp/7465900 to your computer and use it in GitHub Desktop.
CentOSにzabbix-agent2.0を入れるときの作業用ひな形。実際には&&で全部つなげてワンライナーにして使います。 confは新しく作り直してるので入れておきたいオプションがあれば適宜追加で。 RHEL5/6系ならi386でもx86_64でも使えるはず。
OS_VER="5"
OS_TYPE="x86_64"
ZAB_VER="2.0.9"
ZAB_SERVER="ZABBIX_SERVER_IP_OR_FQDN"
rpm -ivh http://repo.zabbix.com/zabbix/2.0/rhel/$OS_VER/$OS_TYPE/zabbix-$ZAB_VER-1.el$OS_VER.$OS_TYPE.rpm http://repo.zabbix.com/zabbix/2.0/rhel/$OS_VER/$OS_TYPE/zabbix-agent-$ZAB_VER-1.el$OS_VER.$OS_TYPE.rpm
mv /etc/zabbix/zabbix_agentd.conf /etc/zabbix/zabbix_agentd.conf.org
echo -e "Server=$ZAB_SERVER\nServerActive=$ZAB_SERVER\nHostnameItem=system.hostname\nInclude=/etc/zabbix/zabbix_agentd.d/\nEnableRemoteCommands=1\nLogRemoteCommands=1\nAllowRoot=1\nLogFile=/var/log/zabbix/zabbix_agentd.log
\nLogFileSize=0\n" > /etc/zabbix/zabbix_agentd.conf
/etc/init.d/zabbix-agent start
/sbin/chkconfig zabbix-agent on
@okisanjp
Copy link
Author

AllowRoot=0が良ければ上記書き換えてご利用ください

@okisanjp
Copy link
Author

log系設定追加

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment