Introduction
Introduction Statistics Contact Development Disclaimer Help
load-watcher.sh - annna - Annna the nice friendly bot.
git clone git://bitreich.org/annna/ git://enlrupgkhuxnvlhsf6lc3fziv5h2hhfrinws6…
Log
Files
Refs
Tags
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 #gent…
27 fi
28
You are viewing proxied material from bitreich.org. The copyright of proxied material belongs to its original authors. Any comments or complaints in relation to proxied material should be directed to the original authors of the content concerned. Please see the disclaimer for more details.