Zabbix Node Automation installation

Source: Internet
Author: User
Tags snmp

#!/bin/bash

# datetime:2016-01-14

# Author:sckghost

# Description:zabbix One-click installation script

# Note: Because of the server more, so on the service side to build a wget software center, wget address can be customized

# useing: can be installed directly on the client using the command Curl serverip/script/install_zabbix_agentd.sh | Sh


serverip=192.168.1.218#zabbix_server服务端IP

version=zabbix-2.4.6#zabbix版本

Basedir=/usr/local/zabbix#zabbix安装目录

wget= ' wget-n-p/tmp http:/$ServerIP/download/$Version.tar.gz ' #软件中心下载


#1, open firewall port

Iptables-i input-p tcp-m multiport--dport 10050:10051-j ACCEPT

Service Iptables Save

Service Iptables Restart

Groupadd Zabbix

Useradd zabbix-g Zabbix

Ln-s $BASEDIR/sbin/*/usr/local/sbin/

Ln-s $BASEDIR/bin/*/usr/local/bin/


# 2, Zabbix installation

Yum install-y gcc make autoconf gcc net-snmp-devel Curl curl-devel mysql-devel

if [!-f/tmp/$Version. tar.gz]

Then

$wget

Fi


Tar zxvf/tmp/$Version. TAR.GZ-C/tmp

cd/tmp/$Version

./configure--prefix= $BASEDIR--enable-agent--with-net-snmp--with-libcurl

Make && make install


#3, configuration zabbix_agentd.conf

Sed-i ' s:# pidfile=/tmp/zabbix_agentd.pid:logfile= $BASEDIR/zabbix_agentd.pid:g ' $BASEDIR/etc/zabbix_agentd.conf

Sed-i ' s#logfile=.*$ #LogFile = $BASEDIR/log/zabbix_agentd.log#g ' $BASEDIR/etc/zabbix_agentd.conf

Sed-i ' s/^server=127.0.0.1/server= $ServerIP/g ' $BASEDIR/etc/zabbix_agentd.conf

Sed-i ' s/^serveractive=127.0.0.1/serveractive= $ServerIP/g ' $BASEDIR/etc/zabbix_agentd.conf

Sed-i ' s/# enableremotecommands=0/enableremotecommands=0/g ' $BASEDIR/etc/zabbix_agentd.conf

Sed-i ' s/# logremotecommands=0/logremotecommands=0/g ' $BASEDIR/etc/zabbix_agentd.conf

Sed-i ' s:# include=/usr/local/etc/zabbix_agentd.conf.d/*.conf:include= $BASEDIR/etc/zabbix_agentd.conf.d/*.conf:g ' $BASEDIR/etc/zabbix_agentd.conf

Sed-i ' s/# unsafeuserparameters=0/unsafeuserparameters=1/g ' $BASEDIR/etc/zabbix_agentd.conf


#4, boot entry

cp/tmp/$Version/misc/init.d/fedora/core/zabbix_agentd/etc/rc.d/init.d/zabbix_agentd

Sed-i "s:basedir=/usr/local:basedir= $BASEDIR: G"/etc/rc.d/init.d/zabbix_agentd

chmod +x/etc/rc.d/init.d/zabbix_agentd

Chkconfig Zabbix_agentd on

Killall Zabbix_agentd

/etc/init.d/zabbix_agentd restart


This article is from the "Streamer Blade" blog, please be sure to keep this source http://sckghost.blog.51cto.com/4762240/1735242

Zabbix Node Automation installation

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.