Commit 9894b6af authored by Jonathan Michalon's avatar Jonathan Michalon

Rename the 'lib' module to 'picomon'

parent f7d2adce
...@@ -36,7 +36,7 @@ Everything can be configured from config.py: notified email(s), base tick, hosts ...@@ -36,7 +36,7 @@ Everything can be configured from config.py: notified email(s), base tick, hosts
The `base_tick` option defines the base granularity (in seconds) for polling. The `base_tick` option defines the base granularity (in seconds) for polling.
`Host`s are shorthands to avoid repeating addresses within checks. `Host`s are shorthands to avoid repeating addresses within checks.
Checks are then defined as a list of `Check`-derived class instances that Checks are then defined as a list of `Check`-derived class instances that
implement every single check (see lib/checks.py). implement every single check (see picomon/checks.py).
Each check may be initialised with some options: Each check may be initialised with some options:
...@@ -45,12 +45,12 @@ Each check may be initialised with some options: ...@@ -45,12 +45,12 @@ Each check may be initialised with some options:
* `timeout`: subcommand timeout, to avoid stalling checks (defaults to 2 seconds); * `timeout`: subcommand timeout, to avoid stalling checks (defaults to 2 seconds);
* `target_name`: human-readable name of the target of the check (automatically set by the `name` option if using `Host` instances). * `target_name`: human-readable name of the target of the check (automatically set by the `name` option if using `Host` instances).
In addition some checks have specific options, see lib/checks.py for examples. In addition some checks have specific options, see picomon/checks.py for examples.
In case you want to check lesser important services and configure very long check intervals, you may In case you want to check lesser important services and configure very long check intervals, you may
want to have another interval, global to all checks, for error retries. This can be set with the `error_every` option. want to have another interval, global to all checks, for error retries. This can be set with the `error_every` option.
For a full list of all available options, see the lib/__init__.py file. For a full list of all available options, see the picomon/__init__.py file.
Current state output Current state output
-------------------- --------------------
......
from lib.checks import * from picomon.checks import *
from lib import config from picomon import config
# This is a sample config file, so that you have the most useful parameters # This is a sample config file, so that you have the most useful parameters
# to hand in there, along with their default value # to hand in there, along with their default value
# For a full, explained list see lib/__init__.py # For a full, explained list see picomon/__init__.py
# Polling # Polling
...@@ -66,7 +66,7 @@ v6only = Host(ipv6='2001:0DB8::beef') ...@@ -66,7 +66,7 @@ v6only = Host(ipv6='2001:0DB8::beef')
day = 86400 / config.base_tick day = 86400 / config.base_tick
halfday = 43200 / config.base_tick halfday = 43200 / config.base_tick
# For a list of checks, see the different classes in lib/checks.py # For a list of checks, see the different classes in picomon/checks.py
config.checks.add([CheckPing4, CheckPing6], [localhost, h1], retry=2, every=5) config.checks.add([CheckPing4, CheckPing6], [localhost, h1], retry=2, every=5)
#config.checks.add(CheckDNSZone, ["example.net", "example.org"], ip_version=4) #config.checks.add(CheckDNSZone, ["example.net", "example.org"], ip_version=4)
......
...@@ -6,8 +6,8 @@ import importlib ...@@ -6,8 +6,8 @@ import importlib
import sys import sys
import os import os
from time import sleep from time import sleep
from lib import config from picomon import config
from lib import mails from picomon import mails
from datetime import datetime, timedelta from datetime import datetime, timedelta
......
import subprocess import subprocess
import config import config
from lib import mails from picomon import mails
retcode = subprocess.call(["python3", "picomon.py"]) retcode = subprocess.call(["python3", "picomon.py"])
......
Markdown is supported
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