Systemd
I'm having an issue running this with systemd. do you have an example you can share?
I haven't configured an instance of this with systemd, so unfortunately I can't help you at present. I will leave this issue open though, as it would be nice to have a working example. If you can update with specific details of your issue and any resolution, that may help someone!
Just set this up on a pi as a systemd service, here's my setup:
Download and Install
git clone https://github.com/rouyng/tncexporter
cd tncexporter
pip3 install -r requirements.txt
Create Systemd Service
sudo nano /etc/systemd/system/tncexporter.service
[Unit]
Description=TNC Exporter
After=network.target
StartLimitIntervalSec=0
[Service]
Type=simple
Restart=always
RestartSec=1
User=pi
WorkingDirectory=/home/pi/tncexporter
ExecStart=/usr/bin/env python3 -m tncexporter --latitude xx --longitude xx
[Install]
WantedBy=multi-user.target
NOTE 1: replace
--latitude xx --longitude xxwith your own values for distance metrics to work. NOTE 2: set User and WorkingDirectory to your values. User is important for python deps to load.
Enable and Start Service
sudo systemctl enable tncexporter.service
sudo systemctl start tncexporter.service
sudo systemctl status tncexporter.service
Metrics should now be available at: http://127.0.0.1:9110/metrics
Just set this up on a pi as a
systemdservice, here's my setup:Download and Install
git clone https://github.com/rouyng/tncexporter cd tncexporter pip3 install -r requirements.txtCreate Systemd Service
sudo nano /etc/systemd/system/tncexporter.service[Unit] Description=TNC Exporter After=network.target StartLimitIntervalSec=0 [Service] Type=simple Restart=always RestartSec=1 User=pi WorkingDirectory=/home/pi/tncexporter ExecStart=/usr/bin/env python3 -m tncexporter --latitude xx --longitude xx [Install] WantedBy=multi-user.targetNOTE 1: replace
--latitude xx --longitude xxwith your own values for distance metrics to work. NOTE 2: set User and WorkingDirectory to your values. User is important for python deps to load.Enable and Start Service
sudo systemctl enable tncexporter.service sudo systemctl start tncexporter.service sudo systemctl status tncexporter.serviceMetrics should now be available at: http://127.0.0.1:9110/metrics
Hi Liam, Do you mind if I incorporate your instructions here into the project documentation? Thanks Ross
Sounds good to me 😃 thanks!