December 19, 2009

Automatically reboot on high iowait sta

Write below mentioned code in SHELL:
Automatically reboot on high iowait stat

Quote
# top -C -b -n 1 -i |awk '/total/ && substr($7, 0, index($7,".")) >70{print "/sbin/reboot"}'|sh

Awk displays "/sbin/reboot", if IOWAIT > 70 % and shell runs the command

you can run that in root's cron or include it via a shell script.

-C = combines statistics on a SMP machine into 1 line
-n 1 = display once
-i = ignore zombie/waiting processes

This how to is derived from Ev1servers forum

No comments:

Post a Comment