__init__.py 993 Bytes
Newer Older
1
import socket
2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
from .attrtree import AttrTree
from .checks import Checks


config = AttrTree()

# the list of checks
config.install_attr('checks', Checks())

# This is the base granularity (in seconds) for polling
# Each check may then individually be configured to run every N * tick
config.install_attr('base_tick', 60)

# Email addresses to send to when an alert is triggered
config.install_attr('emails.to', [])
17 18 19 20 21
# The From: address
config.install_attr('emails.addr_from',
                    'Picomon <picomon@%s>' % socket.getfqdn())
# The SMTP host, with optional :port suffix
config.install_attr('emails.smtp_host', 'localhost:25')
22 23 24 25 26

# Subject template for state change email notifications
# available substitutions:
#   - state ("Problem" or "OK")
#   - check (check's name, like "CheckDNSRec6")
Colomban Wendling's avatar
Colomban Wendling committed
27 28 29 30
#   - dest  (the target of the check ie. an IP or a Host's 'name'
#            parameter)
config.install_attr('emails.subject_tpl',
                    '[DOMAIN] {state}: {check} on {dest}')