rbonghi / jetson_stats

📊 Simple package for monitoring and control your NVIDIA Jetson [Orin, Xavier, Nano, TX] series
https://rnext.it/jetson_stats
GNU Affero General Public License v3.0
2.17k stars 264 forks source link

Option to print stats as json #133

Closed dketterer closed 3 years ago

dketterer commented 3 years ago

Is your feature request related to a problem? Please describe. I am using telegraf to send statistics to an InfluxDB display them in Grafana. Telegraf can only read CPU/RAM/Network on the Jetson Nano. I would be cool to have all the values like, GPU, HWENC/HWDEC, FAN, clock speeds as well.

Describe the solution you'd like A new option to jtop: jtop --json. If you call it jtop outputs all values as a json to stdout repeatedly every 5 or 10 seconds. The json should be flat, means one object with values, no nested objects.

Describe alternatives you've considered The systemd background service could permanently write a json file to somewhere in /proc and telegraf can simply look it up in an interval of 10s (for example).

Additional context json is preferred since telegraf can read it by default. The relevant inputs in telegraf: exec and execd.

dketterer commented 3 years ago

Ok, right after I submitted this I had a look into the examples folder and I think I found what I am looking for.

jtop_callback.py does exactly what I want.

Thanks for the great project and have a good day!