1.//nagios 测试36
#因为crontab里面的时间间隔最小单位为1个星期,故不适合我做监控的判断,我需要的是间隔3、5秒的脚本执行,故用loop来实现。
[yangkai@admin ~]$ cat jiance.sh
#!/bin/bash
echo "$(date +\%Y\%m\%d--\%H\%M\%S) $(/usr/local/nagios/libexec/check_http -I **.***.221.136 -p 80)" >>/yk/3.nagios.txt
[yangkai@admin ~]$ cat test.sh
#!/bin/bash
for((i=1;i<50000;i++))
do
echo "$(date +\%Y\%m\%d--\%H\%M\%S) $(/usr/local/nagios/libexec/check_http -I **.***.221.136 -p 80)" >>3os.txt
sleep 5;
done
[yangkai@admin ~]$
[yangkai@admin ~]$ wc -l *
10 2nagios136.txt
1157 3.nagios.txt
13385 3os.txt
14 file1
2 jiance.sh
20 nagios136.txt
9 nohup.out
7 test.sh
3 test.txt
14607 总计
You have new mail in /var/spool/mail/yangkai
[yangkai@admin ~]$
if [ $a > $b ];then
print
阅读(1712) | 评论(0) | 转发(0) |