add example configurations
This commit is contained in:
parent
578615dbef
commit
d4a3d91b9f
3
docs/service.d.override.conf
Normal file
3
docs/service.d.override.conf
Normal file
@ -0,0 +1,3 @@
|
||||
[Unit]
|
||||
OnFailure=sysalert-failure@%n.service
|
||||
OnSuccess=sysalert-success@%n.service
|
3
docs/sysalert-.service.d.override.conf
Normal file
3
docs/sysalert-.service.d.override.conf
Normal file
@ -0,0 +1,3 @@
|
||||
[Unit]
|
||||
OnFailure=
|
||||
OnSuccess=
|
11
docs/sysalert-failure@.service
Normal file
11
docs/sysalert-failure@.service
Normal file
@ -0,0 +1,11 @@
|
||||
[Service]
|
||||
ExecStart=/usr/bin/sysalert %i
|
||||
Group=systemd-journal
|
||||
Type=oneshot
|
||||
DynamicUser=yes
|
||||
StateDirectory=sysalert
|
||||
|
||||
[Unit]
|
||||
Description=Failure-handler for %i
|
||||
After=network.target
|
||||
DefaultDependencies=no
|
11
docs/sysalert-success@.service
Normal file
11
docs/sysalert-success@.service
Normal file
@ -0,0 +1,11 @@
|
||||
[Service]
|
||||
ExecStart=/usr/bin/sysalert %i
|
||||
Group=systemd-journal
|
||||
Type=oneshot
|
||||
DynamicUser=yes
|
||||
StateDirectory=sysalert
|
||||
|
||||
[Unit]
|
||||
Description=Success-handler for %i
|
||||
After=network.target
|
||||
DefaultDependencies=no
|
31
docs/sysalert.ini.example
Normal file
31
docs/sysalert.ini.example
Normal file
@ -0,0 +1,31 @@
|
||||
[DEFAULT]
|
||||
# Alert after this many failures
|
||||
max_failures=0
|
||||
|
||||
# Send new alert after this many seconds if service still fails
|
||||
resend_alert_time=3600
|
||||
|
||||
# Send alert on recovery
|
||||
# can be yes, no or if-alerted
|
||||
recovery_alert=if-alerted
|
||||
|
||||
# python module to use for notifications.
|
||||
# currently provided modules:
|
||||
# - sysalert.email
|
||||
#
|
||||
# Module should contain success() and failure() methods.
|
||||
# These methods should take three paramters:
|
||||
#
|
||||
# service_name - name of the service
|
||||
# failures - list of dicts containing data about previous (and current) failures.
|
||||
# the list is sorted on time with the first failure first and latest failure at the end.
|
||||
# config - a dict containing any entries in the section from this file named after the alert method.
|
||||
# i.e 'sysalert.email'-section for 'sysalert.email' alert method.
|
||||
alert_method=sysalert.email
|
||||
|
||||
[sysalert.email]
|
||||
# defaulting to root@<fqdn> if these are not set
|
||||
#mail_from=sysalert <root@localhost>
|
||||
#mail_to=root <root@localhost>
|
||||
smtp_host=localhost
|
||||
|
@ -5,9 +5,27 @@ build-backend = "setuptools.build_meta"
|
||||
[project]
|
||||
name = "sysalert"
|
||||
version = "0.1.0"
|
||||
authors = [ {name = "Fredrik Eriksson", email = "sysalert@fulh.ax"} ]
|
||||
dependencies = [
|
||||
"systemd-python"
|
||||
]
|
||||
description = "generic OnFailure= and OnSuccess= handler for systemd"
|
||||
readme = "README.md"
|
||||
license = { file = "LICENSE" }
|
||||
keywords = [ "systemd" ]
|
||||
classifiers = [
|
||||
"Development Status :: 4 - Beta",
|
||||
"Intended Audience :: System Administrators",
|
||||
"License :: OSI Approved :: MIT License",
|
||||
"Operating System :: POSIX :: Linux",
|
||||
"Topic :: System :: Monitoring",
|
||||
]
|
||||
|
||||
[project.scripts]
|
||||
sysalert = "sysalert.util:cli"
|
||||
|
||||
[project.urls]
|
||||
Homepage = "https://gitea.fulh.ax/feffe/sysalert"
|
||||
Repository = "https://gitea.fulh.ax/feffe/sysalert.git"
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user