FastHandle - IT Operations Examples

FastHandle is fast operation tools for infrastructure configurations and tests.

User Tools

Site Tools


scripts:cron-for-performance.html



Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
scripts:cron-for-performance.html [2017/11/29 00:16]
kurihara created
— (current)
Line 1: Line 1:
-[[os:info.html|]] 
-====== Performance survey of seconds interval on Cron ====== 
- 
-\\ 
-{{INLINETOC}} 
-\\ 
- 
-===== vmstat.sh(memory, swap, io, system, cpu) ===== 
- 
-<sxh bash toolbar:false gutter:false> 
-#!/bin/sh 
-#0 0 * * * /home/fasthandle/scripts/vmstat.sh > /dev/null 2>&1 
-# daily about 60M 
- 
-DIR=/var/log/performance 
-[ -d "$DIR" ] || mkdir $DIR 
- 
-# 86400sec = 1day = 24h x 60m x 60s 
-vmstat 1 86400 | awk '{print strftime("%y/%m/%d %H:%M:%S"), $0} { system(":") }' >> ${DIR}/vmstat.`date +%Y%m%d` 
- 
-find ${DIR} -type f -name "vmstat*"  -mtime +30  -exec rm -rf {} \; 
-</sxh> 
- 
- 
-\\ 
-===== mpstat.sh (cpu) ===== 
-<sxh bash toolbar:false gutter:false> 
-#!/bin/sh 
-#0 0 * * * /home/fasthandle/scripts/mpstat.sh > /dev/null 2>&1 
-  
-DIR=/var/log/performance 
-[ -d "$DIR" ] || mkdir $DIR 
- 
-# 86400sec = 1day = 24h x 60m x 60s 
-mpstat 1 86400 >> ${DIR}/mpstat.`date +%Y%m%d` 
-  
-find ${DIR} -type f -name "mpstat*"  -mtime +30  -exec rm -rf {} \; 
-</sxh> 
- 
-\\ 
-===== iostat.sh (io) ===== 
-<sxh bash toolbar:false gutter:false> 
-#!/bin/sh 
-#0 0 * * * /home/fasthandle/scripts/iostat.sh > /dev/null 2>&1 
-# daily about 10M 
- 
-DIR=/var/log/performance 
-[ -d "$DIR" ] || mkdir $DIR 
- 
-# 86400sec = 1day = 24h x 60m x 60s 
-#iostat -xtm 1 86400 >> ${DIR}/iostat.`date +%Y%m%d` 
-iostat -xtm 10 8640 >> ${DIR}/iostat.`date +%Y%m%d` 
- 
-find ${DIR} -type f -name "iostat*"  -mtime +30  -exec rm -rf {} \; 
-</sxh> 
- 
-\\ 
-===== ps.sh ===== 
-<sxh bash toolbar:false gutter:false> 
-#!/bin/sh 
-#* * * * * /home/fasthandle/scripts/ps.sh > /dev/null 2>&1 
- 
-DIR=/var/log/performance 
-[ -d "$DIR" ] || mkdir $DIR 
- 
-date >> ${DIR}/ps.`date +%Y%m%d` 
-ps auxwf >> ${DIR}/ps.`date +%Y%m%d` 
- 
-find ${DIR} -type f -name "ps*"  -mtime +30  -exec rm -rf {} \; 
-</sxh> 
- 
-\\ 
-===== top.sh ===== 
-<sxh bash toolbar:false gutter:false> 
-#!/bin/sh 
-#* * * * * /home/fasthandle/scripts/top.sh > /dev/null 2>&1 
- 
-DIR=/var/log/performance 
-[ -d "$DIR" ] || mkdir $DIR 
- 
-top -b -n 4 -d 15 >> ${DIR}/top.`date +%Y%m%d` 
- 
-find ${DIR} -type f -name "top*"  -mtime +30  -exec rm -rf {} \; 
-</sxh> 
- 
- 
- 
-\\ 
-===== df.sh ===== 
- 
-<sxh bash toolbar:false gutter:false> 
-#!/bin/sh 
-#* * * * * /home/fasthandle/scripts/df-h.sh > /dev/null 2>&1 
- 
-DIR=/var/log/performance 
-[ -d "$DIR" ] || mkdir $DIR 
- 
-NUM=1 
-while [ "${NUM}" -le 6 ] 
-do 
-    df -h | awk '{print strftime("%y/%m/%d %H:%M:%S"), $0}' >> ${DIR}/df.`date +%Y%m%d` 
-    NUM=`expr ${NUM} + 1` 
-    sleep 10 
-done 
- 
-find ${DIR} -type f -name "df*"  -mtime +30  -exec rm -rf {} \; 
-</sxh> 
- 
- 
-\\ 
-\\ 
-[[os:info.html|]] 
- 
-\\ 
-<WRAP box 90%> 
-[[:index.html#OS Management|Top#OS Management]] 
-<catlist ..: -noAddPageButton -noHead -sortAscending> 
-</WRAP> 
  


scripts/cron-for-performance.html.1511882198.txt.gz · Last modified: 2017/11/29 00:16 by kurihara