running simplemonitor on Ubuntu Xenial
See original GitHub issueHi,
I am trying to run simplemonitor on Ubuntu xenial, I installed Python3.6 from deadsnakes/ppa. Simplemonitor is successfully installed. The ini files look like this now: monitors.ini
[host1.local]
type=ping
host=host1.local.domain
tolerance=2
monitor.ini
[monitor]
interval=60
[reporting]
loggers=logfile
alerters=email
[email]
type=email
host=localhost
from=root
to=me@local.domain
[logfile]
type=logfile
filename=monitor.log
only_failures=0
python3
# which python3
/usr/local/bin/python3
# ll /usr/local/bin/python3
lrwxrwxrwx 1 root root 18 Nov 19 09:37 /usr/local/bin/python3 -> /usr/bin/python3.6*
I am now trying to write the systemd unit:
[Unit]
Description=monitoring service
After=network.target
[Service]
WorkingDirectory=/usr/local/lib/python3.6/dist-packages/simplemonitor
ExecStart=/usr/local/bin/simplemonitor
Restart=on-failure
ExecReload=/bin/kill -HUP $MAINPID
User=root
Group=root
[Install]
WantedBy=multi-user.target
I tried the ExecStart
with ExecStart=/usr/bin/python3.6 /usr/local/lib/python3.6/dist-packages/simplemonitor/monitor.py
and ExecStart=/usr/local/bin/python3 /usr/local/lib/python3.6/dist-packages/simplemonitor/monitor.py
,
both don’t work and the service exits with failer.
When trying ExecStart=/usr/local/bin/python3 /usr/local/bin/simplemonitor
,
and ExecStart=/usr/local/bin/simplemonitor
the service is running without problems, but it doesn’t log any thing. so I don’t know if it performs the ping check.
When I run simplemonitor
form cli, it logs to monitor.log
only when I hit Ctrl+c.
Any idea how to fix this?
Thanks
Issue Analytics
- State:
- Created 3 years ago
- Comments:9 (5 by maintainers)
Top GitHub Comments
Great! Exactly what I’ve been looking for. Great tool and great support. Thank you very much.
Example using the “subdir” version, using
sm
as the subdir: