- #!/bin/bash
- #
- # Script to notify admin user if Linux,FreeBSD load crossed certain limit
- # It will send an email notification to admin.
- #
- # Copyright 2005 (c) nixCraft project
- # This is free script under GNU GPL version 2.0 or above.
- # Support/FeedBack/comment : http://cyberciti.biz/fb/
- # Tested os:
- # * RedHat Linux
- # * Debain Linux
- # * FreeBSD
- # -------------------------------------------------------------------------
- # This script is part of nixCraft shell script collection (NSSC)
- # Visit http://bash.cyberciti.biz/ for more information.
- # -------------------------------------------------------------------------
- # Set up limit below
- NOTIFY="6.0"
- # admin user email id
- EMAIL="root"
- # Subject for email
- SUBJECT="Alert $(hostname) load average"
- # -----------------------------------------------------------------
- # Os Specifc tweaks do not change anything below ;)
- OS="$(uname)"
- TRUE="1"
- if [ "$OS" == "FreeBSD" ]; then
- TEMPFILE="$(mktemp /tmp/$(basename $0).tmp.XXX)"
- FTEXT='load averages:'
- elif [ "$OS" == "Linux" ]; then
- TEMPFILE="$(mktemp)"
- FTEXT='load average:'
- fi
- # get first 5 min load
- F5M="$(uptime | awk -F "$FTEXT" '{ print $2 }' | cut -d, -f1) | sed 's/ //g'"
- # 10 min
- F10M="$(uptime | awk -F "$FTEXT" '{ print $2 }' | cut -d, -f2) | sed 's/ //g'"
- # 15 min
- F15M="$(uptime | awk -F "$FTEXT" '{ print $2 }' | cut -d, -f3) | sed 's/ //g'"
- # mail message
- # keep it short coz we may send it to page or as an short message (SMS)
- echo "Load average Crossed allowed limit $NOTIFY." >> $TEMPFILE
- echo "Hostname: $(hostname)" >> $TEMPFILE
- echo "Local Date & Time : $(date)" >> $TEMPFILE
- # Look if it crossed limit
- # compare it with last 15 min load average
- RESULT=$(echo "$F15M > $NOTIFY" | bc)
- # if so send an email
- if [ "$RESULT" == "$TRUE" ]; then
- mail -s "$SUBJECT" "$EMAIL" < $TEMPFILE
- fi
- # remove file
- rm -f $TEMPFILE
本日志由 flyinweb 于 2009-12-23 12:49:03 发表到 Linux 中,目前已经被浏览 66 次,评论 0 次;
作者添加了以下标签: Shell,System Load;
作者:田逸
通过主从复制,然后使用mysql-proxy实现
本日志由 flyinweb 于 2009-12-23 09:59:04 发表到 数据库技术 中,目前已经被浏览 62 次,评论 0 次;
作者添加了以下标签: mysql 读写分离;
首页只显示了部分日志内容,要查看日志的全部内容请阅读全文;
Java™ Enterprise Platforms and Developer Organization |
本日志由 flyinweb 于 2009-12-22 17:46:12 发表到 技术文摘 中,目前已经被浏览 81 次,评论 0 次;
作者添加了以下标签: Java Tuning;
首页只显示了部分日志内容,要查看日志的全部内容请阅读全文;
This document is a compilation of all the JVM options for various versions of the JVM on primarily SPARC/Solaris Platform. The descriptions for each option are taken mostly verbatim from the reference documents.
本日志由 flyinweb 于 2009-12-22 17:34:16 发表到 技术文摘 中,目前已经被浏览 79 次,评论 0 次;
作者添加了以下标签: JVM Options;
首页只显示了部分日志内容,要查看日志的全部内容请阅读全文;
java.lang.OutOfMemoryError: Java heap space
本日志由 flyinweb 于 2009-12-22 16:45:14 发表到 技术文摘 中,目前已经被浏览 88 次,评论 0 次;
作者添加了以下标签: OutOfMemoryError,Java heap space;
首页只显示了部分日志内容,要查看日志的全部内容请阅读全文;
本日志由 flyinweb 于 2009-12-18 10:00:38 发表到 系统架构 中,目前已经被浏览 79 次,评论 0 次;
作者添加了以下标签: apache+jk+tomcat,session同步;
首页只显示了部分日志内容,要查看日志的全部内容请阅读全文;
This document provides information on typical command-line options and environment variables that can affect the performance characteristics of the Java HotSpot Virtual Machine. Unless otherwise noted, all information in this document pertains to both the Java HotSpot Client VM and the Java HotSpot Server VM.
vllddaee: vllddaee...
根据inotify + rsync的思路,现在有了个c++版本的同步程序,只需指
真是有耐心呀。我做了个pdf 文件 在上面的网站可以下载