Hi
I am having real trouble getting Glances to auto run with the --export influxdb command.
I have followed the instructions
here:
However I am getting this error:
● glances.service - Glances
Loaded: loaded (/etc/systemd/system/glances.service; enabled; vendor preset: enabled)
Active: activating (auto-restart) (Result: exit-code) since Mon 2020-09-21 17:17:41 BST; 4s ago
Process: 1778 ExecStart=/usr/local/bin/glances --quiet --export influxdb (code=exited, status=2)
Main PID: 1778 (code=exited, status=2)
Here is my glances.service file contents:
[Unit]
Description=Glances
After=network.target influxd.service
[Service]
ExecStart=/usr/local/bin/glances --quiet --export influxdb
Restart=on-failure
RemainAfterExit=yes
RestartSec=30s
TimeoutSec=30s
[Install]
WantedBy=multi-user.target
The log file is finding and reading my glances.conf file:
2020-09-21 15:47:05,894 -- INFO -- Start Glances 3.1.5
2020-09-21 15:47:05,896 -- INFO -- CPython 2.7.16 and psutil 5.7.2 detected
2020-09-21 15:47:05,932 -- INFO -- Search glances.conf file in /home/pi/.config/glances/glances.conf
2020-09-21 15:47:05,936 -- INFO -- Read configuration file '/home/pi/.config/glances/glances.conf'
2020-09-21 15:47:05,980 -- INFO -- Start GlancesStandalone mode
Here is my glances.conf file:
[influxdb]
host=localhost
port=8086
protocol=http
user=myuser
password=mypassword
db=glances
prefix=localhost
# Tags will be added for all measurements
#tags=foo:bar,spam:eggs
# You can also use dynamic values
#tags=system:`uname -a`
If I manually run this command in SSH terminal on the Pi it works OK and data is passed OK to InfluxDB / Grafana.
glances --quiet --export influxdb
2020-09-21 17:25:12,469 -- INFO -- Start Glances 3.1.5
2020-09-21 17:25:12,470 -- INFO -- CPython 2.7.16 and psutil 5.7.2 detected
2020-09-21 17:25:12,508 -- INFO -- Search glances.conf file in /home/pi/.config/glances/glances.conf
2020-09-21 17:25:12,511 -- INFO -- Read configuration file '/home/pi/.config/glances/glances.conf'
2020-09-21 17:25:12,556 -- INFO -- Start GlancesStandalone mode
2020-09-21 17:25:13,105 -- WARNING -- Sparklines module not found (No module named sparklines)
2020-09-21 17:25:13,768 -- WARNING -- Error loading Docker Python Lib. Docker plugin is disabled (No module named ssl_match_hostname)
2020-09-21 17:25:13,775 -- ERROR -- docker plugin - Can not connect to Docker (global name 'docker' is not defined)
2020-09-21 17:25:13,793 -- WARNING -- Missing Python Lib (No module named pySMART), HDD Smart plugin is disabled
2020-09-21 17:25:15,069 -- INFO -- Quiet mode is ON, nothing will be displayed
However I cannot get it to autostart after a reboot.
If in the glances.service file I change the command to just: glances -w
Then that does work after rebooting the Pi and I can access the Glances web GUI OK.
So why does it not work when using the command: glances --quiet --export influxdb ?
Please HELP !!