Remove loggers report from motd
authorSiraaj Khandkar <siraaj@khandkar.net>
Mon, 2 Nov 2020 14:14:01 +0000 (09:14 -0500)
committerSiraaj Khandkar <siraaj@khandkar.net>
Mon, 2 Nov 2020 14:14:01 +0000 (09:14 -0500)
but keep it as independent command function.

home/lib/login_functions.sh

index e17c5c6..9730feb 100644 (file)
@@ -582,30 +582,6 @@ motd() {
         ' \
     | flat_top_5 \
     | indent "${indent_unit}"
-
-    echo
-
-    echo 'Loggers (top 5)'
-    awk '
-        {
-            split($5, prog, "[")
-            sub(":$", "", prog[1]) # if there were no [], than : will is left behind
-            print prog[1]
-        }' /var/log/syslog \
-    | awk '
-        {
-            n = split($1, path, "/")  # prog may be in path form
-            prog = path[n]
-            total++
-            count[prog]++
-        }
-
-        END {
-            for (prog in count)
-                print count[prog], total, prog
-        }' \
-    | flat_top_5 \
-    | indent "${indent_unit}"
 }
 
 ssh_invalid_attempts_from() {
@@ -629,3 +605,26 @@ ssh_invalid_attempts_from() {
     | bar_gauge -v width="$(stty size | awk '{print $2}')" -v num=1 -v ch_right=' ' -v ch_left=' ' -v ch_blank=' ' \
     | column -t
 }
+
+loggers() {
+    awk '
+        {
+            split($5, prog, "[")
+            sub(":$", "", prog[1]) # if there were no [], than : will is left behind
+            print prog[1]
+        }' /var/log/syslog \
+    | awk '
+        {
+            n = split($1, path, "/")  # prog may be in path form
+            prog = path[n]
+            total++
+            count[prog]++
+        }
+
+        END {
+            for (prog in count)
+                print count[prog], total, prog
+        }' \
+    | bar_gauge -v num=1 -v ch_right=' ' -v ch_left=' ' -v ch_blank=' ' \
+    | column -t
+}
This page took 0.031396 seconds and 4 git commands to generate.