Commit 3b4a7361 authored by telyn's avatar telyn
Browse files

symbiosis-monit now emails on failure under systemd

parent 056c95b9
sbin/symbiosis-monit usr/sbin/
sbin/* usr/sbin/
monit.d/* etc/symbiosis/monit.d/
templates/* usr/share/symbiosis/monit/
lib/* usr/lib/ruby/vendor_ruby/
test.d/* etc/symbiosis/test.d/
debian/symbiosis-monit.timer lib/systemd/system/
system/* lib/systemd/
#!/bin/bash
set -e
args="--since=today"
[ -e "/run/symbiosis-monit.cursor" ] && args="--after-cursor=$(</run/symbiosis-monit.cursor)"
journalctl -b0 $args -u "symbiosis-monit.service" | mail -s "Symbiosis monitor detected service failure" root
[Unit]
Description=Notify by email about symbiosis-monit failure
[Service]
Type=simple
ExecStart=/usr/bin/symbiosis-monit-failure-email
[Unit]
Description=Symbiosis monitor
OnFailure=symbiosis-monit-failure-email.service
[Service]
Type=simple
ExecStartPre=/bin/sh -c 'journalctl -o cat -n 0 -u %n --show-cursor | cut -f3 -d" " > /run/symbiosis-monit.cursor'
ExecStart=/usr/sbin/symbiosis-monit -t email /etc/symbiosis/monit.d
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment