Commit 5283a00f authored by Andrew Ladlow's avatar Andrew Ladlow
Browse files

monit: Don't email on service failure

parent 58c4d852
#!/bin/bash
set -e
args="--since=today"
[ -e "/var/tmp/symbiosis-monit.cursor" ] && args="--after-cursor=$(</var/tmp/symbiosis-monit.cursor)"
journalctl -b0 $args -o cat -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/sbin/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" " | sudo -u nobody tee /var/tmp/symbiosis-monit.cursor >/dev/null'
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