summaryrefslogtreecommitdiffstats
path: root/roles/ands_monitor/templates/scripts/check_uptime_status.sh.j2
diff options
context:
space:
mode:
Diffstat (limited to 'roles/ands_monitor/templates/scripts/check_uptime_status.sh.j2')
-rwxr-xr-xroles/ands_monitor/templates/scripts/check_uptime_status.sh.j28
1 files changed, 8 insertions, 0 deletions
diff --git a/roles/ands_monitor/templates/scripts/check_uptime_status.sh.j2 b/roles/ands_monitor/templates/scripts/check_uptime_status.sh.j2
new file mode 100755
index 0000000..0602fcb
--- /dev/null
+++ b/roles/ands_monitor/templates/scripts/check_uptime_status.sh.j2
@@ -0,0 +1,8 @@
+#!/bin/bash
+
+up=$(uptime | cut -d ' ' -f 4- | cut -d ',' -f 1 | sed -re 's/^\s*//')
+load=$(uptime | cut -d ' ' -f 4- | cut -d ',' -f 4- | cut -d ':' -f 2 | cut -d ',' -f 3 | sed -re 's/^\s*//')
+disks=$(/opt/MegaRAID/storcli/storcli64 /c0 show | grep -P "(HDD|SSD)" | grep "Onln" | wc -l)
+data=`df -lh /mnt/ands | grep -vi Filesystem | sed -e 's/[[:space:]]\+/ /g' | cut -d ' ' -f 4`
+
+echo -n "1 Up $up \${color gray}/ $disks disks, $data free, load: $load"