load-watcher.sh - annna - Annna the nice friendly bot. HTML git clone git://bitreich.org/annna/ git://enlrupgkhuxnvlhsf6lc3fziv5h2hhfrinws65d7roiv6bfj7d652fid.onion/annna/ DIR Log DIR Files DIR Refs DIR Tags DIR README --- load-watcher.sh (675B) --- 1 #!/bin/sh 2 3 channels="#bitreich-en" 4 5 export PATH="/home/annna/bin:$PATH" 6 7 load1="$(LANG=C uptime \ 8 | sed 's,.*load average: \(.*\)$,\1,' \ 9 | tr -d " " \ 10 | cut -d"," -f 1 \ 11 | cut -d"." -f 1)" 12 load5="$(LANG=C uptime \ 13 | sed 's,.*load average: \(.*\)$,\1,' \ 14 | tr -d " " \ 15 | cut -d"," -f 2 \ 16 | cut -d"." -f 1)" 17 load15="$(LANG=C uptime \ 18 | sed 's,.*load average: \(.*\)$,\1,' \ 19 | tr -d " " \ 20 | cut -d"," -f 3 \ 21 | cut -d"." -f 1)" 22 cpucores="$(cat /proc/cpuinfo | grep "processor" | wc -l)" 23 24 if [ $load15 -gt $cpucores ]; 25 then 26 annna-say -c "${channels}" "Bitreich.org load is high! The #gentoo-fans are cheering! gophers://bitreich.org/I/memecache/gentoo-fans.png" 27 fi 28