Hi Ben,
thank you for the suggestion. I created the service, but it's not working. it complains about "_curses.error: setupterm: could not find terminal"
here is the syslog info:
Jun 26 20:09:36 ip-172-26-10-63 systemd[1]: Started Glances Server.
Jun 26 20:09:38 ip-172-26-10-63 glances[13538]: Traceback (most recent call last):
Jun 26 20:09:38 ip-172-26-10-63 glances[13538]: File "/usr/bin/glances", line 11, in <module>
Jun 26 20:09:38 ip-172-26-10-63 glances[13538]: load_entry_point('Glances==2.11.1', 'console_scripts', 'glances')()
Jun 26 20:09:38 ip-172-26-10-63 glances[13538]: File "/usr/lib/python3/dist-packages/glances/__init__.py", line 134, in main
Jun 26 20:09:38 ip-172-26-10-63 glances[13538]: start(config=config, args=args)
Jun 26 20:09:38 ip-172-26-10-63 glances[13538]: File "/usr/lib/python3/dist-packages/glances/__init__.py", line 100, in start
Jun 26 20:09:38 ip-172-26-10-63 glances[13538]: mode = GlancesMode(config=config, args=args)
Jun 26 20:09:38 ip-172-26-10-63 glances[13538]: File "/usr/lib/python3/dist-packages/glances/standalone.py", line 79, in __init__
Jun 26 20:09:38 ip-172-26-10-63 glances[13538]: self.screen = GlancesCursesStandalone(config=config, args=args)
Jun 26 20:09:38 ip-172-26-10-63 glances[13538]: File "/usr/lib/python3/dist-packages/glances/outputs/glances_curses.py", line 104, in __init__
Jun 26 20:09:38 ip-172-26-10-63 glances[13538]: self.screen = curses.initscr()
Jun 26 20:09:38 ip-172-26-10-63 glances[13538]: File "/usr/lib/python3.6/curses/__init__.py", line 30, in initscr
Jun 26 20:09:38 ip-172-26-10-63 glances[13538]: fd=_sys.__stdout__.fileno())
Jun 26 20:09:38 ip-172-26-10-63 glances[13538]: _curses.error: setupterm: could not find terminal
Jun 26 20:09:38 ip-172-26-10-63 systemd[1]: glances_report.service: Main process exited, code=exited, status=1/FAILURE
Jun 26 20:09:38 ip-172-26-10-63 systemd[1]: glances_report.service: Failed with result 'exit-code'.
and here is my service file:
[Install]
WantedBy=multi-user.target
[Service]
ExecStart=/usr/bin/glances -t 60 --export-csv /tmp/test_glances_service.csv
Group=ubuntu
Restart=on-failure
RestartSec=30
TimeoutSec=30
Type=simple
User=ubuntu