Giter Club home page Giter Club logo

tncexporter's People

Contributors

rouyng avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

tncexporter's Issues

Systemd

I'm having an issue running this with systemd. do you have an example you can share?

Automatic reconnect not updating metrics

Hey! Thanks for this project, it's great to see some metrics, and I got it up and running pretty quickly. I also shared my systemd config in #6.

I've come across an issue where the automatic reconnect to the TNC after the connection has been lost is successful, but the metrics are never updated again. The only way for the metrics to be updated is if I kill the tncexporter process and restart it.

I'm connecting tncexporter to direwolf, and occasionally start/stop the direwolf process. From the logs below, you can see that metrics don't update after the connection to the TNC is re-established, but after restarting tncexporter, it is working again (since it doesn't use the reconnect logic).

I was just going to edit the python script to have it exit when the connection is lost, as I'm running this as a systemd service and it would just auto restart anyway, but wanted to make this known if you weren't aware.

pi@raspberrypi:~ $ journalctl -u tncexporter -f
-- Journal begins at Sat 2000-01-01 13:00:19 NZDT. --
Aug 01 17:00:35 raspberrypi env[502]: INFO: 01-Aug-23 17:00:35 - Attempting to connect to TNC at localhost:8000
Aug 01 17:00:35 raspberrypi env[502]: ERROR: 01-Aug-23 17:00:35 - Could not connect to TNC at localhost:8000, connection refused. Retrying in 10 seconds
Aug 01 17:00:45 raspberrypi env[502]: INFO: 01-Aug-23 17:00:45 - Attempting to connect to TNC at localhost:8000
Aug 01 17:00:45 raspberrypi env[502]: ERROR: 01-Aug-23 17:00:45 - Could not connect to TNC at localhost:8000, connection refused. Retrying in 10 seconds
Aug 01 17:00:55 raspberrypi env[502]: INFO: 01-Aug-23 17:00:55 - Attempting to connect to TNC at localhost:8000
Aug 01 17:00:55 raspberrypi env[502]: ERROR: 01-Aug-23 17:00:55 - Could not connect to TNC at localhost:8000, connection refused. Retrying in 10 seconds
Aug 01 17:01:05 raspberrypi env[502]: INFO: 01-Aug-23 17:01:05 - Attempting to connect to TNC at localhost:8000
Aug 01 17:01:05 raspberrypi env[502]: ERROR: 01-Aug-23 17:01:05 - Could not connect to TNC at localhost:8000, connection refused. Retrying in 10 seconds
Aug 01 17:01:15 raspberrypi env[502]: INFO: 01-Aug-23 17:01:15 - Attempting to connect to TNC at localhost:8000
Aug 01 17:01:15 raspberrypi env[502]: INFO: 01-Aug-23 17:01:15 - Connection established to TNC at localhost:8000
pi@raspberrypi:~ $ service tncexporter restart
pi@raspberrypi:~ $ journalctl -u tncexporter -f
-- Journal begins at Sat 2000-01-01 13:00:19 NZDT. --
Aug 01 17:00:55 raspberrypi env[502]: ERROR: 01-Aug-23 17:00:55 - Could not connect to TNC at localhost:8000, connection refused. Retrying in 10 seconds
Aug 01 17:01:05 raspberrypi env[502]: INFO: 01-Aug-23 17:01:05 - Attempting to connect to TNC at localhost:8000
Aug 01 17:01:05 raspberrypi env[502]: ERROR: 01-Aug-23 17:01:05 - Could not connect to TNC at localhost:8000, connection refused. Retrying in 10 seconds
Aug 01 17:01:15 raspberrypi env[502]: INFO: 01-Aug-23 17:01:15 - Attempting to connect to TNC at localhost:8000
Aug 01 17:01:15 raspberrypi env[502]: INFO: 01-Aug-23 17:01:15 - Connection established to TNC at localhost:8000
Aug 01 17:03:44 raspberrypi systemd[1]: Stopping TNC Exporter...
Aug 01 17:03:44 raspberrypi systemd[1]: tncexporter.service: Succeeded.
Aug 01 17:03:44 raspberrypi systemd[1]: Stopped TNC Exporter.
Aug 01 17:03:44 raspberrypi systemd[1]: tncexporter.service: Consumed 5min 44.813s CPU time.
Aug 01 17:03:44 raspberrypi systemd[1]: Started TNC Exporter.
Aug 01 17:03:45 raspberrypi env[2642]: INFO: 01-Aug-23 17:03:45 - Attempting to connect to TNC at localhost:8000
Aug 01 17:03:49 raspberrypi env[2642]: INFO: 01-Aug-23 17:03:45 - Connection established to TNC at localhost:8000
Aug 01 17:03:49 raspberrypi env[2642]: INFO: 01-Aug-23 17:03:46 - Serving TNC prometheus metrics on: http://0.0.0.0:9110/metrics
Aug 01 17:03:49 raspberrypi env[2642]: INFO: 01-Aug-23 17:03:46 - Updated metrics for 0 packets
Aug 01 17:03:49 raspberrypi env[2642]: INFO: 01-Aug-23 17:03:48 - 10.1.0.103 [01/Aug/2023:05:03:48 +0000] "GET /metrics HTTP/1.1" 200 2543 "-" "Prometheus/2.44.0"
Aug 01 17:04:03 raspberrypi env[2642]: INFO: 01-Aug-23 17:04:03 - 10.1.0.103 [01/Aug/2023:05:04:03 +0000] "GET /metrics HTTP/1.1" 200 2543 "-" "Prometheus/2.44.0"
Aug 01 17:04:16 raspberrypi env[2642]: INFO: 01-Aug-23 17:04:16 - Updated metrics for 0 packets
Aug 01 17:04:18 raspberrypi env[2642]: INFO: 01-Aug-23 17:04:18 - 10.1.0.103 [01/Aug/2023:05:04:18 +0000] "GET /metrics HTTP/1.1" 200 2543 "-" "Prometheus/2.44.0"

Distance issue

Distance set as per instructions - distance as decimal 56.0552 -27093. Distances displayed are in billions of metres....

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.