Commit | Line | Data |
---|---|---|
6f89e24d SK |
1 | #! /bin/sh |
2 | ||
3 | set -e | |
4 | ||
5 | bin_dir="$(dirname $(realpath $0))" | |
6 | ||
7 | . "$bin_dir/khatus_x4_lib_common_sensor.sh" | |
8 | ||
9 | sensor() { | |
10 | free | awk ' | |
11 | $1 == "Mem:" { | |
12 | total = $2 | |
13 | used = $3 | |
14 | percent_used = int(((used / total) * 100) + 0.5) # Average | |
15 | print("percent_used", percent_used) | |
16 | } | |
17 | ' | |
18 | } | |
19 | ||
20 | run_as_poller |