1. #!/bin/bash  
  2. #  
  3. # Script to notify admin user if Linux,FreeBSD load crossed certain limit  
  4. # It will send an email notification to admin.  
  5. #  
  6. # Copyright 2005 (c) nixCraft project  
  7. # This is free script under GNU GPL version 2.0 or above.  
  8. # Support/FeedBack/comment :  http://cyberciti.biz/fb/  
  9. # Tested os:  
  10. # * RedHat Linux  
  11. # * Debain Linux  
  12. # * FreeBSD  
  13. # -------------------------------------------------------------------------  
  14. # This script is part of nixCraft shell script collection (NSSC)  
  15. # Visit http://bash.cyberciti.biz/ for more information.  
  16. # -------------------------------------------------------------------------  
  17.    
  18. # Set up limit below  
  19. NOTIFY="6.0"  
  20.    
  21. # admin user email id  
  22. EMAIL="root"  
  23.    
  24. # Subject for email  
  25. SUBJECT="Alert $(hostname) load average"  
  26.    
  27. # -----------------------------------------------------------------  
  28.    
  29. # Os Specifc tweaks do not change anything below ;)  
  30. OS="$(uname)"  
  31. TRUE="1"  
  32. if [ "$OS" == "FreeBSD" ]; then  
  33.         TEMPFILE="$(mktemp /tmp/$(basename $0).tmp.XXX)"  
  34.     FTEXT='load averages:'  
  35. elif [ "$OS" == "Linux" ]; then  
  36.         TEMPFILE="$(mktemp)"  
  37.     FTEXT='load average:'  
  38. fi  
  39.    
  40. # get first 5 min load  
  41. F5M="$(uptime | awk -F "$FTEXT" '{ print $2 }' | cut -d, -f1) | sed 's/ //g'"  
  42. # 10 min  
  43. F10M="$(uptime | awk -F "$FTEXT" '{ print $2 }' | cut -d, -f2) | sed 's/ //g'"  
  44. # 15 min  
  45. F15M="$(uptime | awk -F "$FTEXT" '{ print $2 }' | cut -d, -f3) | sed 's/ //g'"  
  46.    
  47. # mail message  
  48. # keep it short coz we may send it to page or as an short message (SMS)  
  49. echo "Load average Crossed allowed limit $NOTIFY." >> $TEMPFILE  
  50. echo "Hostname: $(hostname)" >> $TEMPFILE  
  51. echo "Local Date & Time : $(date)" >> $TEMPFILE  
  52.    
  53. # Look if it crossed limit  
  54. # compare it with last 15 min load average  
  55. RESULT=$(echo "$F15M > $NOTIFY" | bc)  
  56.    
  57. # if so send an email  
  58. if [ "$RESULT" == "$TRUE" ]; then  
  59.         mail -s "$SUBJECT" "$EMAIL" < $TEMPFILE  
  60. fi  
  61.    
  62. # remove file  
  63. rm -f $TEMPFILE 

本日志由 flyinweb 于 2009-12-23 12:49:03 发表到 Linux 中,目前已经被浏览 66 次,评论 0 次;

作者添加了以下标签: ShellSystem Load

作者:田逸

通过主从复制,然后使用mysql-proxy实现

本日志由 flyinweb 于 2009-12-23 09:59:04 发表到 数据库技术 中,目前已经被浏览 62 次,评论 0 次;

作者添加了以下标签: mysql 读写分离

首页只显示了部分日志内容,要查看日志的全部内容请阅读全文

Java™ Enterprise Platforms and Developer Organization
Sun Microsystems, Inc.


 

Revised: December 20, 2005

本日志由 flyinweb 于 2009-12-22 17:46:12 发表到 技术文摘 中,目前已经被浏览 81 次,评论 0 次;

作者添加了以下标签: Java Tuning

首页只显示了部分日志内容,要查看日志的全部内容请阅读全文

A Collection of JVM Options

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 次;

作者添加了以下标签: OutOfMemoryErrorJava heap space

首页只显示了部分日志内容,要查看日志的全部内容请阅读全文

VB中通过WMI控制DNS服务器,可在ASP中调用

本日志由 flyinweb 于 2009-12-22 15:18:43 发表到 技术文摘 中,目前已经被浏览 52 次,评论 0 次;

作者添加了以下标签: VBWMIDNS

首页只显示了部分日志内容,要查看日志的全部内容请阅读全文

作者:刘宇 liuyu.blog.51cto.com
msn:mgroup49073@hotmail.com linuxtone
 
说明:借前人之鉴,写一篇关于tomcat集群及session同步的问题,首先介绍tomcat集成及做集群的原因和必要性,session同步的作用。然后包括各软件的安装配置。

本日志由 flyinweb 于 2009-12-18 10:00:38 发表到 系统架构 中,目前已经被浏览 79 次,评论 0 次;

作者添加了以下标签: apache+jk+tomcatsession同步

首页只显示了部分日志内容,要查看日志的全部内容请阅读全文

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.

本日志由 flyinweb 于 2009-12-17 14:16:52 发表到 技术文摘 中,目前已经被浏览 96 次,评论 0 次;

作者添加了以下标签: JVM

首页只显示了部分日志内容,要查看日志的全部内容请阅读全文

3967/50