Differences

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

Link to this comparison view

tech:linux:check_swap [2015/02/10 06:51]
tech:linux:check_swap [2015/02/10 06:51] (current)
Line 1: Line 1:
 +====== Check pswpin and pswpout ======
 +Script to check ''​pswpin''​ and ''​pswpou''​t for non-zero values and log/email.
 +<code bash>
 +#!/bin/bash
 +cd /​home/​senthil/​temp_files/​pswp
 +TS=$(date +%Y%m%d_%H%M%S);​
 +cat /​proc/​vmstat|grep pswp > log/​pswp_${TS}.txt
 +PSZ=`grep -c "​^pswpin 0$" log/​pswp_${TS}.txt`
 +if [ $PSZ -eq 0 ]; then
 +  cat log/​pswp_${TS}.txt | mailx -s "​Non-zero pswpin"​ system@example.org
 +fi
 +</​code>​
 +Cron entry
 +<​code>​
 +0,​10,​20,​30,​40,​50 * * * * /​path/​to/​script
 +</​code>​
  

QR Code
QR Code tech:linux:check_swap (generated for current page)