利用的腳本有之前介紹的python腳本:
【python】用python腳本實(shí)現(xiàn)ansible的推送、下載、上傳文件功能
創(chuàng)新互聯(lián)-專業(yè)網(wǎng)站定制、快速模板網(wǎng)站建設(shè)、高性價(jià)比秀山土家族苗族網(wǎng)站開(kāi)發(fā)、企業(yè)建站全套包干低至880元,成熟完善的模板庫(kù),直接使用。一站式秀山土家族苗族網(wǎng)站制作公司更省心,省錢,快速模板網(wǎng)站建設(shè)找我們,業(yè)務(wù)覆蓋秀山土家族苗族地區(qū)。費(fèi)用合理售后完善,十年實(shí)體公司更值得信賴。
-
#
!
/
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
-
# 得到操作系統(tǒng)的版本
-
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
-
# 開(kāi)始安裝
-
#如果操作系統(tǒng)的版本是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'
-
#如果操作系統(tǒng)的版本是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'
-
#如果操作系統(tǒng)的版本是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
-
#升級(jí)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
關(guān)于zabbix
_agent_centos不同版本的腳本請(qǐng)參見(jiàn)這里:
install_zabbix_agent_centos5.sh
install_zabbix_agent_centos6.sh
install_zabbix_agent_centos7.sh
網(wǎng)頁(yè)題目:【Zabbix】zabbix遠(yuǎn)程安裝部署
網(wǎng)頁(yè)URL:http://vcdvsql.cn/article30/gjehso.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供響應(yīng)式網(wǎng)站、網(wǎng)站改版、用戶體驗(yàn)、做網(wǎng)站、手機(jī)網(wǎng)站建設(shè)、網(wǎng)站制作
廣告
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請(qǐng)盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如需處理請(qǐng)聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來(lái)源:
創(chuàng)新互聯(lián)