【zabbix】zabbix遠端安裝部署
利用的指令碼有之前介紹的python指令碼:
【python】用python指令碼實現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
-
# 得到作業系統的版本
-
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
-
# 開始安裝
-
#如果作業系統的版本是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'
- #如果作業系統的版本是7
-
elif
[
"$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'
-
#如果作業系統的版本是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
- #升級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
關於zabbix
_agent_centos不同版本的指令碼請參見這裡:
install_zabbix_agent_centos5.sh
install_zabbix_agent_centos6.sh
install_zabbix_agent_centos7.sh
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/31442725/viewspace-2148721/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- Zabbix安裝部署
- Zabbix監控安裝部署
- 詳解zabbix安裝部署
- zabbix 客戶端安裝客戶端
- ZABBIX實踐(一) 服務端部署和安裝服務端
- 【ZABBIX】Linux下安裝ZABBIXLinux
- zabbix安裝
- zabbix agent 3.0部署文件 安裝部署
- 【Zabbix】zabbix_agent安裝指令碼指令碼
- zabbix監控客戶端安裝客戶端
- zabbix安裝agent
- Zabbix Agent安裝
- apt安裝zabbixAPT
- 編譯安裝zabbix編譯
- 【監控】Zabbix安裝
- zabbix的安裝配置
- zabbix一鍵安裝
- zabbix原始碼安裝原始碼
- zabbix3.0安裝
- 安裝zabbix使出錯
- Zabbix-2.4.5 安裝
- zabbix安裝文件薦
- zabbix5.0安裝
- zabbix server 部署Server
- linux安裝zabbix伺服器端文件Linux伺服器
- zabbix安裝—–nginx安裝和配置Nginx
- Zabbix 的容器版安裝
- centos8 安裝zabbixCentOS
- Zabbix Agent 安裝與使用
- Centos7-安裝ZabbixCentOS
- zabbix 安裝配置介紹
- 安裝Zabbix(多種方式)
- 安裝配置zabbix-serverServer
- zabbix2.4yum安裝
- zabbix環境安裝搭建
- Windows下安裝Zabbix AgentdWindows
- Ubuntu安裝zabbix配置教程Ubuntu
- zabbix安裝中文環境