Introduction
Introduction Statistics Contact Development Disclaimer Help
Add load league and fix watcher. - annna - Annna the nice friendly bot.
git clone git://bitreich.org/annna/ git://enlrupgkhuxnvlhsf6lc3fziv5h2hhfrinws6…
Log
Files
Refs
Tags
README
---
commit 695bdbf9ec862eef4f8f6d36203b426082da3db4
parent b891901f456753f5d9118adf77bb1307c9940fc9
Author: Annna Robert-Houdin <[email protected]>
Date: Mon, 1 Aug 2022 20:44:47 +0200
Add load league and fix watcher.
Diffstat:
A modules/load-league/load-watcher.sh | 28 ++++++++++++++++++++++++++++
1 file changed, 28 insertions(+), 0 deletions(-)
---
diff --git a/modules/load-league/load-watcher.sh b/modules/load-league/load-wat…
@@ -0,0 +1,28 @@
+#!/bin/sh
+
+channels="#bitreich-en"
+
+export PATH="/home/annna/bin:$PATH"
+
+load1="$(LANG=C uptime \
+ | sed 's,.*load average: \(.*\)$,\1,' \
+ | tr -d " " \
+ | cut -d"," -f 1 \
+ | cut -d"." -f 1)"
+load5="$(LANG=C uptime \
+ | sed 's,.*load average: \(.*\)$,\1,' \
+ | tr -d " " \
+ | cut -d"," -f 2 \
+ | cut -d"." -f 1)"
+load15="$(LANG=C uptime \
+ | sed 's,.*load average: \(.*\)$,\1,' \
+ | tr -d " " \
+ | cut -d"," -f 3 \
+ | cut -d"." -f 1)"
+cpucores="$(cat /proc/cpuinfo | grep "processor" | wc -l)"
+
+if [ $load15 -gt $cpucores ];
+then
+ annna-say -c "${channels}" "Bitreich.org load is high! The #gentoo-fan…
+fi
+
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.