8) *Adding possibility to collect memory (RAM), CPU and flash (disk space)
usage of devices via the API*:
I did a bit research to find out that currently only openwrt (linux based)
is supported by openwisp-controller as a backend (LEDE has been removed in
latest release, if I am not wrong). So, I had a simple way of collecting
the data, I do it very often on my Ubuntu to check details when it hangs
(sometimes) :smile:. Create a system_check.sh shell script.
system_check.sh file
# !/bin/sh
free -m | awk 'NR==2{printf "Memory Usage: %s/%sMB (%.2f%%)\n",
$3,$2,$3*100/$2 }'
df -h | awk '$NF=="/"{printf "Disk Usage: %d/%dGB (%s)\n", $3,$2,$5}'
top -bn1 | grep load | awk '{printf "CPU Usage: %.0f%%\n", $(NF-2)*100}'
# convert it into an executable
chmod +x system_check.sh
# This results in:
~$ ./system_check.sh
Memory Usage: 6156/7676MB (80.20%)
Disk Usage: 27/187GB (15%)
CPU Usage: 74%
My query is will it be acceptable if I use this simple shell script to
import data in a python file in api directory, convert it into a JSON
object (keeping in mind NETJSON device_monitoring spec.) or an alternative
approach would be required here.
Best Regards
Hardik Jain
:)
--
You received this message because you are subscribed to the Google Groups
"OpenWISP" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web, visit
https://groups.google.com/d/msgid/openwisp/b95adf80-fdf2-46b0-8a6a-43152de22c4f%40googlegroups.com.