nagios 监控xenserver 流量

#使用xe 命令来获取xenserver服务器的网络流量,方式如下
#cat check_xen_pif.sh
#!/bin/sh
 
count=0
uuid_list=`xe bond-list | grep master | awk '{print $4}'`
 
#get io_read_kbs param
for uuid in $uuid_list
do     
    io_read[$count]=`xe pif-param-get param-name=io_read_kbs uuid=$uuid`
#   echo ${io_read[$count]}
        let count=count+1 
done
 
#get io_write_kbs param
count=0
for uuid in $uuid_list
do
        io_write[$count]=`xe pif-param-get param-name=io_write_kbs uuid=$uuid`
#        echo ${io_write[$count]}
        let count=count+1
done
 
 
count=0
performance1=""
performance2=""
while [ $count -lt ${#io_read[@]} ]
do
    performance1="$performance1 bond${count}(r,w): ${io_read[$count]}kb,${io_write[$count]}kb;"
    performance2="$performance2 bond${count}_io_read_kbs=${io_read[$count]};1500;2000;0;10000;bond${count}_io_write_kbs=${io_write[$count]};1500;2000;0;10000;"
    let count=count+1
done
echo "$performance1 | $performance2"
exit 0



本文出自 “月童” 博客,谢绝转载!

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值