shell写的告警次数控制及恢复示例代码
俺也是新手,写的有点老土,权当练手了,供初学的朋友们参考吧。实现代码如下:#!/bin/bashif [ $succ_ping -gt $((ping_count-1)) ];thenif [ -f ./alarm_file/alarm_$host ];thenrm -rf ./alarm_file
俺也是新手,写的有点老土,权当练手了,供初学的朋友们参考吧。实现代码如下:#!/bin/bashif [ $succ_ping -gt $((ping_count-1)) ];thenif [ -f ./alarm_file/alarm_$host ];thenrm -rf ./alarm_file
实现代码如下:#!/bin/bash ping_monitor(){host_=(203 204 205 207 208 209 210 212 213 214 215 216 217 218 219 220 221)ping_count=3called=(13000000001 130000000
实现代码如下:#!/bin/bash#main---network=192.168.1ping_count=3IP=1:>IP_use:>IP_idle:>ping_actionecho "`date "+%Y%m%d %H:%M:%S"`----->脚本开始执行......
实现代码如下:#!/bin/bash#telno 为查询号码列表文件#sendsms.log为短信发送结果文件#1 代表发送成功query_sms(){>submit_telno>delivered_telno>fail_delivered_telnocat telno |whil
需求:删除文件,目录结构为:ip/年份/月份,每个人都有一份这样的目录现需要删除2012年以前的所有文件,2012年以后的删除特定月份。本来想用find,结果发现这些文件time(a,m,c)记录已经不是当初生成的。没办法只好想了个土办法去遍历,哪位有好的方法,欢迎告知。实现代码如下:#!/bin/
将bill 文件夹下的文件按一定规则(文件名奇偶)拷贝至bill1,bill2 文件夹下。更新bill1,bill2 处理进度标签(更新file.max)file3 为bill 目录下当前最新文件的标签,正常情况下每分钟会更新(格式为:20121016122100)实现代码如下:#!/bin/bas
实现代码如下:#!/bin/bash#********************************##并发后台运行fun##for wanggy 2012-01-25##note:##fun_num fun函数后台运行次数##sql_num 每个函数sql运行次数##**************
实现代码如下:#!/bin/bash#********************************##2013-01-11 17:00:00 wanggy exp##note:ping monitor##********************************#set -uping_fu
实现代码如下:#!/bin/bash#2013-01-06 14:00:00 wanggy exp#note:ping monitorset -u#set -xping_fun(){d_network=192.168.1echo -n "input the network(default $d_ne
实现代码如下: //有两个按钮分别响应两个事件,用来控制iframe显示的网页。 function bd(){ var baidu = document.getElementById("i"); baidu.src = "http://www.baidu.com"; } function xl()