首页 > 移动平台 > 详细

nagios监控redis端口、监控url接口告警脚本

时间:2015-05-07 17:05:16      阅读:679      评论:0      收藏:0      [点我收藏+]

监控redis端口如下:

#!/bin/sh

#Created by hys 20140823

declare -a master_is
master_is=($(redis-cli -h 192.168.0.76 -p 7711 INFO |grep role |awk -F: ‘{print $2}‘))
echo $master_is
if [ ${master_is} == "master" ];then
        echo "OK -slave is running"
        exit 0
else
        echo "Critical -slave is error"
        exit 2
fi


监控url地址如下:

#!/bin/sh
#Created by hys 20140823
ttl=`curl -o /dev/null -s -L --connect-timeout 60 http://192.168.0.161:8080 -w %{http_code}`
if [ "$ttl" == 200 ];
then
         echo "OK url is running"
         exit 0
else
      echo "Critical url is error"
      exit 2
fi



本文出自 “我的运维博客” 博客,请务必保留此出处http://linuxpython.blog.51cto.com/10015972/1643793

nagios监控redis端口、监控url接口告警脚本

原文:http://linuxpython.blog.51cto.com/10015972/1643793

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!