question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

running simplemonitor on Ubuntu Xenial

See original GitHub issue

Hi,

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:closed
  • Created 3 years ago
  • Comments:9 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
3c2b2ff5commented, Nov 19, 2020

Great! Exactly what I’ve been looking for. Great tool and great support. Thank you very much.

1reaction
jamesoffcommented, Nov 19, 2020

Example using the “subdir” version, using sm as the subdir:

root@ubuntu:/opt/simplemonitor# pip install -t sm simplemonitor
Collecting simplemonitor
  Using cached simplemonitor-1.10.0-py3-none-any.whl (119 kB)
[...]

root@ubuntu:/opt/simplemonitor# ll
total 20
drwxr-xr-x  3 root root 4096 Nov 19 03:40 ./
drwxr-xr-x  4 root root 4096 Nov 19 03:40 ../
-rw-r--r--  1 root root  202 Nov 19 03:40 monitor.ini
-rw-r--r--  1 root root   51 Nov 19 03:40 monitors.ini
drwxr-xr-x 48 root root 4096 Nov 19 03:40 sm/

root@ubuntu:/opt/simplemonitor# ./sm/bin/simplemonitor -t -d
2020-11-19 03:40:56     INFO (simplemonitor) === SimpleMonitor v1.10.0
2020-11-19 03:40:56     INFO (simplemonitor) Loading main config from monitor.ini
2020-11-19 03:40:56     INFO (simplemonitor) Loading monitor config from monitors.ini
2020-11-19 03:40:56     INFO (simplemonitor) === Loading monitors
2020-11-19 03:40:56     INFO (simplemonitor) Adding ping monitor host1.local: Checking localhost pings within 5 seconds
2020-11-19 03:40:56     INFO (simplemonitor) --- Loaded 1 monitors
2020-11-19 03:40:56     INFO (simplemonitor) === Loading loggers
2020-11-19 03:40:56     INFO (simplemonitor) Adding logfile logger logfile: Writing log file to monitor.log
2020-11-19 03:40:56     INFO (simplemonitor) --- Loaded 1 loggers
2020-11-19 03:40:56     INFO (simplemonitor) === Loading alerters
2020-11-19 03:40:56     INFO (simplemonitor) Adding email alerter email
2020-11-19 03:40:56     INFO (simplemonitor) --- Loaded 1 alerters
2020-11-19 03:40:56  WARNING (simplemonitor) Config test complete. Exiting.
Read more comments on GitHub >

github_iconTop Results From Across the Web

Ubuntu Manpage: top - display Linux processes
The top program provides a dynamic real-time view of a running system. It can display system summary information as well as a list...
Read more >
How to Install Monit Monitoring Tool on Ubuntu 16.04
Install Monit. By default, Monit is available in the Ubuntu 16.04 default repository. You can install it by just running the following command:...
Read more >
How To Monitor System Metrics with the TICK Stack on ...
One Ubuntu 16.04 server set up by following the Ubuntu 16.04 initial server setup guide, ... Run the following command to install InfluxDB:....
Read more >
Set primary monitor on 16.04 - Ask Ubuntu
Run the arandr command from a shell to configure and identify your displays. -- For Layout you can drag the monitors around. --...
Read more >
The Xenial Build Environment - Travis CI Docs
Using Xenial #. To route your builds to Ubuntu Xenial 16.04, add the following to your .travis.yml : dist: xenial. YAML. Please note...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found