Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

[Zabbix] zabbix remote installation and deployment

2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/02 Report--

The script used is the python script introduced earlier: [python] use python script to realize the functions of pushing, downloading and uploading files in ansible.

#! / bin / bash

IP = $1

Exceptip_file = "/ opt/python/set_host_proxy_exceptip.txt"

# check zabbix_agent is started

Stat_z = `python / opt / python / paramiko-upload. Py-H $IP-c'ps-ef | grep zabbix_agentd | grep-v sh | grep-v grep > / dev/null;echo $?'| g

Rep-v "#" | grep-v IP | grep-v Perform | grep-v Script`

Echo $stat_z

# exit 0

If [$stat_z-ne 0]; then

# get the version of the operating system

OS_VERSION = `python / opt / python / paramiko-upload. Py-H $IP-c "cat / etc/redhat-release" | awk-F 'release'' {print $2}'| awk'{pr

Int $1}'| awk-F\. '{print $1}' `

Echo $OS_VERSION

# start the installation

# if the operating system version is 6

If ["$OS_VERSION"-eq 6]; then

Echo "centos 6"

Python / opt / python / paramiko-upload. Py-H $IP-s'/ opt/python/zabbix_agentd''/ opt' zabbix-2. 4. 3_centos6. Tar. Gz

Python / opt / python / paramiko-upload. Py-H $IP-s'/ opt/python/zabbix_agentd''/ opt' install_zabbix_agent_centos6. Sh

Python / opt / python / paramiko-upload. Py-H $IP-c'sh / opt/install_zabbix_agent_centos6.sh'

# if the operating system version is 7elif ["$OS_VERSION"-eq 7]; then

Echo "centos 7"

Python / opt / python / paramiko-upload. Py-H $IP-s'/ opt/python/zabbix_agentd''/ opt' zabbix-2. 4. 3_centos7. Tar. Gz

Python / opt / python / paramiko-upload. Py-H $IP-s'/ opt/python/zabbix_agentd''/ opt' install_zabbix_agent_centos7. Sh

Python / opt / python / paramiko-upload. Py-H $IP-c'sh / opt/install_zabbix_agent_centos7.sh'

# if the operating system version is 5

Elif ["$OS_VERSION"-eq 5]; then

Echo "centos 5"

Python / opt / python / paramiko-upload. Py-H $IP-s'/ opt/python/zabbix_agentd''/ opt' zabbix-2. 4. 3_centos5. Tar. Gz

Python / opt / python / paramiko-upload. Py-H $IP-s'/ opt/python/zabbix_agentd''/ opt' install_zabbix_agent_centos5. Sh

Python / opt / python / paramiko-upload. Py-H $IP-c'sh / opt/install_zabbix_agent_centos5.sh'

Fi

# upgrade the configuration of zabbix sh / opt / python / yuanchen_update_zabbix_agent. Sh $IP

Else

# updata zabbix_agent config

Sh / opt / python / yuanchen_update_zabbix_agent. Sh $IP

Fi

For different versions of the script zabbix _ agent_centos, see here:

Install_zabbix_agent_centos5.sh

Install_zabbix_agent_centos6.sh

Install_zabbix_agent_centos7.sh

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report