zabbix-client-install

#!/bin/bash
# 此脚本主要针对CentOS 6 or 7 版本进行zabbix-agent添加

# 以root用户运行脚本
if [ $(id -u) != "0" ]; then
    echo "You must be root to run this script ..."
    exit 1
fi

if [ $# != "1" ]; then
    echo "Give me ZABBIX server IP ..."
    exit 2
fi

# selinux 会阻止服务开启,所以关闭
sed -i ‘/SELINUX/s/enforcing/disabled/‘ /etc/selinux/config
setenforce 0

if [ -f /etc/redhat-release ];then
        Edition=`grep -o ‘[[:digit:]]‘ /etc/redhat-release |head -1`
else
        Edition=`uname`
fi

case "$Edition" in
      7)
        echo -e "\n\033[34mStart installation……\033[0m\n"
        rpm -ivh http://repo.zabbix.com/zabbix/3.0/rhel/7/x86_64/zabbix-release-3.0-1.el7.noarch.rpm
        yum -y install zabbix-agent zabbix-sender
        sed -i  "/Server/s/Server=127.0.0.1/Server=$1/" /etc/zabbix/zabbix_agentd.conf
        sed -i  "/Server/s/ServerActive=127.0.0.1/ServerActive=$1/" /etc/zabbix/zabbix_agentd.conf
        systemctl start zabbix-agent
        systemctl enable zabbix-agent
        ;;
      6)
        echo -e "\n\033[34mStart installation……\033[0m\n"
        rpm -ivh http://repo.zabbix.com/zabbix/3.0/rhel/6/x86_64/zabbix-release-3.0-1.el6.noarch.rpm
        yum -y install zabbix-agent zabbix-sender
        sed -i  "/Server/s/Server=127.0.0.1/Server=$1/" /etc/zabbix/zabbix_agentd.conf
        sed -i  "/Server/s/ServerActive=127.0.0.1/ServerActive=$1/" /etc/zabbix/zabbix_agentd.conf
        /etc/init.d/zabbix-agent start
        chkconfig zabbix-agent on
        ;;
    *)
        echo "========================================================================"
        echo "This system is not CentOS 6 or 7, script execution failed!!"
        echo "========================================================================"
        exit 3
esac

if ss -ntl|grep 10050 &>/dev/null; then
    echo -e "\n\033[32mCongratulations, ZABBIX client installed successfully\033[0m\n"
else
    echo -e "\n\033[31mSorry, please rerun the command or contact the administrator\033[0m\n"
fi

时间: 2024-10-21 19:12:15

zabbix-client-install的相关文章

Zabbix agentd install Script

#!/bin/bashecho "nameserver 8.8.8.8\nnameserver 8.8.4.4" >/etc/resolv.conf/sbin/iptables -Fchkconfig iptables offsed -i '/^SELINUX=/s/enforcing/disabled/' /etc/sysconfig/selinuxsed -i '/^SELINUX=/s/enforcing/disabled/' /etc/selinux/configsete

zabbix client安装配置执行

1 创建zabbix 用户 groupadd zabbix; useradd -g zabbix zabbix; passwd zabbix; 两次输入password 2 下载获得zabbix的包.然后解压 tar zxvf zabbix-2.2.3.tar.gz; 3 安装 cd /home/zabbix/zabbix-2.2.3; ./configure --with-net-snmp --with-libcurl --enable-agent --prefix=/usr/local/za

How to Install Zabbix Agent on Windows System

Zabbix Agent is installed on remote systems needs to monitor through Zabbix server. The Zabbix agent collects resource utilization and applications data on client system and provide such information to zabbix server on their requests. This article wi

yum install zabbix

环境: centos 6.5 下载并安装epel源 links  http://fedoraproject.org/wiki/EPEL rpm -ivh epel-* 2.安装amp环境 yum install httpd mysql mysql-server php php-mysql -y 3.安装zabbix yum install zabbix22.x86_64 zabbix22-agent.x86_64 zabbix22-server.noarch zabbix22-server-my

How to install Zabbix on CENTOS 7

when you have installed zabbix , it is important of changing password. How to install Zabbix on CENTOS 7 Setup 1 INSTALL Create the repos of Zabbix rpm -ivh https://mirrors.aliyun.com/zabbix/zabbix/3.0/rhel/7/x86_64/zabbix-release-3.0-1.el7.noarch.rp

在centOS7.2安装配置zabbix监控

zabbix由两部分组成,zabbix-server与可选的zabbix-agent.zabbix-server可以通过SNMP,ZABBIX-AGENT,PING,端口监视等方法提供对远程服务器/网络状态的监控与数据收集. 安装环境: 192.168.1.12 server端,监控自己同时也监控其他主机(暂且叫client) 192.168.1.9 client端 准备:NTP时钟服务正常.DNS解析正常(在此两台服务器所以配置hosts即可) server端安装配置: 1) 挂载本地镜像,配

基于LNMP实现zabbix环境搭建

系统环境 $ cat /etc/issueCentOS release 6.6 (Final)$ uname -rsLinux 2.6.32-504.23.4.el6.centos.plus.x86_64 下载所需要的源码包 wget -c http://cn2.php.net/get/php-5.6.5.tar.gz/from/this/mirrorwget -c http://xcache.lighttpd.net/pub/Releases/3.2.0/xcache-3.2.0.tar.gz

ansible 批量安装zabbix agentd客户端

目录结构 ansible/ ├── ansible.cfg ├── hosts ├── roles │   └── zabbix-agentd │   ├── files │   │   ├── install_zabbix.sh │   │   └── zabbix-3.0.1.tar.gz │   ├── handlers │   ├── tasks │   │   └── main.yml │   └── templates └── site.yml [[email protected]

Nginx服务纳入到zabbix监控

工作中有用到Nginx做负载均衡,所以想尝试一下,把Nginx服务用zabbix监控起来 记录下操作步骤,以防下次忘记 涉及的实验环境: 服务器操作系统:CentOS 7.2 zabbix版本:zabbix-2.2.5 Nginx版本:nginx-1.10.1 要做监控步骤前,先查看下当前Nginx中是否加载了--with-http_stub_status_module的模块. # /data0/nginx/sbin/nginx -V nginx version: nginx/1.10.1 bu

zabbix监控之基于LNMP环境安装

本文描述zabbix在lnmp环境中的搭建过程,为减少配置难度,mysql,php采用yum安装. 本安装过程以直接高效的方式叙述. 1.Yum安装mysql mysql使用yum安装方式 yum install mysql-servermysql-devel mysql /etc/init.d/mysqld start 2.Yum安装php yum安装后的php配置文件是/etc/php.ini. yum install -y php php-mysqlphp-gd libjpeg* php-