Zabbix agentd install script

Source: Internet
Author: User

#! /Bin/bash
Echo "nameserver 8.8.8.8 \ nnameserver 8.8.4.4">/etc/resolv. conf
/Sbin/iptables-F
Chkconfig iptables off
Sed-I '/^ SELinux =/S/enforcing/disabled/'/etc/sysconfig/SELinux
Sed-I '/^ SELinux =/S/enforcing/disabled/'/etc/SELinux/config
Setenforce 0
Yes | CP/usr/share/zoneinfo/Asia/hong_kong/etc/localtime
Yum-y install NTP openssh-clients rsync benchmark CT
Sed-I's/^ server 0.centos.pool.ntp.org iBurst/\ Server stdtime.gov.hk prefer/G'/etc/NTP. conf
Ntpdate stdtime.gov.hk
/Etc/init. d/ntpd start
Chkconfig ntpd on
Read-P "Please input the IP address of zabbix server:" ip
Echo $ IP
Read-P "Please input the password of zabbix server:" Password
Command1 = "rsync-AVU $ IP:/usr/local/etc/zabbix_agentd.conf/usr/local/etc /"
Command2 = "rsync-AVU $ IP:/etc/init. d/zabbix_agentd/etc/init. d /"
Command3 = "rsync-AVU $ IP:/usr/local/sbin/zabbix_agentd/usr/local/sbin /"
CT-c"
Spawn $ command1;
CT {
\ "Are you sure you want to continue connecting (Yes/No )? \ "{Send \" Yes \ r \ "; exp_continue}
\ "$ Ip's password: \" {send \ "$ password \ r \"; exp_continue}
}
Spawn $ command2;
CT {
\ "Are you sure you want to continue connecting (Yes/No )? \ "{Send \" Yes \ r \ "; exp_continue}
\ "$ Ip's password: \" {send \ "$ password \ r \"; exp_continue}
}
Spawn $ command3;
CT {
\ "Are you sure you want to continue connecting (Yes/No )? \ "{Send \" Yes \ r \ "; exp_continue}
\ "$ Ip's password: \" {send \ "$ password \ r \"; exp_continue}
}
"
Sed-I "s/Server = 127.0.0.1/Server =" $ IP "/g"/usr/local/etc/zabbix_agentd.conf
Useradd-S/sbin/nologin-M zabbix
Touch/var/log/zabbix_agentd.log
Chown zabbix. zabbix/var/log/zabbix_agentd.log
/Etc/init. d/zabbix_agentd restart
Chkconfig zabbix_agentd on

This article is from the wemux blog, please be sure to keep this source http://wemux.blog.51cto.com/2848943/1559523

Zabbix agentd install script

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.