A dead hand system that monitor changes in network device and act accordingly
Project description
Perimetr
A dead hand system that monitor changes in network device and act accordingly.
Installation
python3 -m pip install Perimetr
Usage
from Perimetr import Monitor
monitor = Monitor("IP", "192.168.0.1", 15, print, "Target is offline")
monitor.activate()
>> Target is offline
Documentation
def __init__(self, method, target, interval, callback, *args, retry=0,
offline=True, all=True, delay=None, **kwargs):
"""Init the monitor with appropriate parameters. Currently support
monitor device status with IP address and MAC address. Require the
target device to be within same network.
Parameters
----------
method : str
Takes "IP" or "MAC" as values. Used to specifies the ways to probe
target devices. Must match the type of `target` parameter. Currently
only check by IP address is supported.
target : str || [str]
The IP or MAC address of the target device(s). Must match the type
of `method` parameter. If multiple target passed in, then all of
them will be checked.
interval : int
The number of seconds until next check.
callback : callable
The callback function when device status change meets the required
criteria. Will be called with `args` and `kwargs`.
retry : int, optional
Number of times to retry with `interval` apart until the system
is considered triggered. Default is no retry.
offline : bool, optional
Triggers the callback function when device went offline or online.
Default to when device went offline.
all : bool, optional
Used when multiple targets are passed in. If true, then all targets
need to meet criteria before system triggered. Else, only one device
status is required. Default to True.
delay : int, optional
The number of seconds delay of execute callback after triggered.
Default is None.
*args : arguments
Used for callback function.
**kwargs : keyword arguments
Used for callback function.
Raises
------
ValueError
When method provided is incorrect, or target provided mismatch
with the method.
"""
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Perimetr-0.0.3.tar.gz
(15.7 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
Perimetr-0.0.3-py3-none-any.whl
(16.8 kB
view details)
File details
Details for the file Perimetr-0.0.3.tar.gz.
File metadata
- Download URL: Perimetr-0.0.3.tar.gz
- Upload date:
- Size: 15.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.5.0 importlib_metadata/4.8.2 pkginfo/1.7.1 requests/2.22.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2457a75e32a3e274f3d856210404daeb2c73baa45f6579c33a322e1ee76cbb65
|
|
| MD5 |
da45d474047897bfe75da348517ac1c6
|
|
| BLAKE2b-256 |
10bec669b86d95b9933f8b87a638e36821849e2c6b814789bbddbeccb7f98ca3
|
File details
Details for the file Perimetr-0.0.3-py3-none-any.whl.
File metadata
- Download URL: Perimetr-0.0.3-py3-none-any.whl
- Upload date:
- Size: 16.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.5.0 importlib_metadata/4.8.2 pkginfo/1.7.1 requests/2.22.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b884bbf28af191b9ccbc6f8f29049ace472216f86f1030c6efa7f12ea4798c66
|
|
| MD5 |
801f62674f52f2bf8794f9e29b2ea957
|
|
| BLAKE2b-256 |
85c7c295fafb389c5629831e2488f0dce3f641077049af6e927b8d931e26f1fe
|