shell中循环监控MQ当前深度
2016-05-02 21:23
211 查看
在MQ交易,经常时时观察队列情况。如下脚本则是显示某队列深度情况。
新建test.sh 文件,脚本如下:
#!/bin/sh
time1=`date +%m%d%H%M`
sleep_time=10
if [ "$#" != "2" ]
then
echo "usage: queue.sh QManger Queue"
exit 1
fi
echo "--------------------BEGIN--------------------"
echo
start=`date +%s`
while [ 0 ]
do
str=`echo "display queue($2)" | runmqsc $1 | grep "CURDEPTH" | cut -b 3-18`
str1=`date +%H:%M:%S`
echo "${str1}:${1}:${2}:${str}"|tee -a ./queue/req_sp_depth_$time1.log
sleep $sleep_time
done
end=`date +%s`
echo
echo "----------------------END-----------------------------"
运行脚本命令:
test.sh GLMSQMGR GLMS.REQ_GW
第一参数:队列管理器名称
第 二参数:队列名称
新建test.sh 文件,脚本如下:
#!/bin/sh
time1=`date +%m%d%H%M`
sleep_time=10
if [ "$#" != "2" ]
then
echo "usage: queue.sh QManger Queue"
exit 1
fi
echo "--------------------BEGIN--------------------"
echo
start=`date +%s`
while [ 0 ]
do
str=`echo "display queue($2)" | runmqsc $1 | grep "CURDEPTH" | cut -b 3-18`
str1=`date +%H:%M:%S`
echo "${str1}:${1}:${2}:${str}"|tee -a ./queue/req_sp_depth_$time1.log
sleep $sleep_time
done
end=`date +%s`
echo
echo "----------------------END-----------------------------"
运行脚本命令:
test.sh GLMSQMGR GLMS.REQ_GW
第一参数:队列管理器名称
第 二参数:队列名称
相关文章推荐
- shell脚本:cp某个目录下筛选(find)后的某些文件到另一个目录
- ansible之shell和script模块
- Xshell4连接,Linux系统中文显示乱码解决办法
- Powershell集成OPENSSL客户端
- Linux入门基础 #1:命令行bash基本操作
- Linux shell 命令行参数
- shell简单使用(二)循环
- linux shell学习笔记二---自定义函数(定义、返回值、变量作用域)介绍
- linux shell脚本学习笔记一
- 05- Shell脚本学习--函数
- pgsql自动安装shell脚本整理
- shell面试题
- 常用的shell命令(持续更新)
- linux shell命令行选项与参数用法详解
- 希尔排序(Shell)
- Shell脚本中单引号(‘)和双引号(“)的使用区别[转载]
- bash环境变量读取顺序
- Shell scripts简单入门
- shell简单使用(-)判断
- Shell编程—根据用户输入来输出符号正方形