ttyplot

Realtime terminal plotter
git clone git://git.sgregoratto.me/ttyplot
Log | Files | Refs | README | LICENSE

commit 095c4032f30b63efc9538cf7bb2f3b32913c471f
parent 4c3c989d02ac1e0f177e0b09f35fb69c105a0c90
Author: Antoni Sawicki <as@tenoware.com>
Date:   Wed, 24 Oct 2018 01:57:18 -0700

in while loop fflush() and gawk are not needed

Diffstat:
MREADME.md | 8++++----
1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/README.md b/README.md @@ -45,7 +45,7 @@ ping 8.8.8.8 | sed -u 's/^.*time=//g; s/ ms//g' | ttyplot -t "ping to 8.8.8.8" - ### cpu temperature from proc ``` -{ while true; do gawk '{ printf("%.1f\n", $1/1000); fflush(); }' /sys/class/thermal/thermal_zone0/temp; sleep 1; done } | ttyplot -t "cpu temp" -u C +{ while true; do awk '{ printf("%.1f\n", $1/1000) }' /sys/class/thermal/thermal_zone0/temp; sleep 1; done } | ttyplot -t "cpu temp" -u C ``` ### fan speed from lm-sensors using grep, tr and cut @@ -65,7 +65,7 @@ ping 8.8.8.8 | sed -u 's/^.*time=//g; s/ ms//g' | ttyplot -t "ping to 8.8.8.8" - ### prometheus remote load average via node exporter ``` -{ while true; do curl -s http://10.4.7.180:9100/metrics | gawk '/^node_load1 / { print $2; fflush(); }'; sleep 1; done } | ttyplot +{ while true; do curl -s http://10.4.7.180:9100/metrics | awk '/^node_load1 / { print $2 }'; sleep 1; done } | ttyplot ``` &nbsp; @@ -108,12 +108,12 @@ ttyplot supports calculating rate on "counter" style metrics, the rate is divide ### snmp network throughput for an interface using snmpget ``` -{ while true; do snmpget -v 2c -c public 10.23.73.254 1.3.6.1.2.1.2.2.1.10.9 1.3.6.1.2.1.2.2.1.16.9 | gawk '{ print $NF/1000/1000; fflush(); }'; sleep 10; done } | ttyplot -2 -r -u "MB/s" +{ while true; do snmpget -v 2c -c public 10.23.73.254 1.3.6.1.2.1.2.2.1.10.9 1.3.6.1.2.1.2.2.1.16.9 | awk '{ print $NF/1000/1000; }'; sleep 10; done } | ttyplot -2 -r -u "MB/s" ``` ### prometheus node exporter disk throughput for sda device ``` -{ while true; do curl -s http://10.11.0.173:9100/metrics | gawk '/^node_disk_.+_bytes_total{device="sda"}/ { printf("%f\n", $2/1024/1024); fflush(); }'; sleep 1; done } | ttyplot -r -2 -u MB/s -t "10.11.0.173 sda writes" +{ while true; do curl -s http://10.11.0.173:9100/metrics | awk '/^node_disk_.+_bytes_total{device="sda"}/ { printf("%f\n", $2/1024/1024); }'; sleep 1; done } | ttyplot -r -2 -u MB/s -t "10.11.0.173 sda writes" ```