Skip to content

Commit 8e5b085

Browse files
committed
Merge branch 'develop' for release 1.15.0
2 parents 181f980 + 8aeed00 commit 8e5b085

38 files changed

Lines changed: 2643 additions & 1572 deletions

.github/dependabot.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,6 @@ updates:
3030
- dependency-name: flake8
3131
versions:
3232
- 3.9.0
33-
- dependency-name: ping3
34-
versions:
35-
- 2.7.0
3633
- dependency-name: arrow
3734
versions:
3835
- 1.0.3

.github/workflows/linting.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ jobs:
88
runs-on: ubuntu-latest
99
strategy:
1010
matrix:
11-
python-version: ['3.9', '3.10', '3.11', '3.12', '3.13']
11+
python-version: ['3.10', '3.11', '3.12', '3.13']
1212
name: Python ${{ matrix.python-version }}
1313

1414
steps:
@@ -26,10 +26,10 @@ jobs:
2626
run: pip install poetry
2727
- name: poetry install
2828
run: poetry install
29-
- name: check code style with black
30-
run: make black
31-
- name: flake8 tests
32-
run: make flake8
29+
- name: check code style with ruff
30+
run: make ruff-format-check
31+
- name: ruff check
32+
run: make ruff-check
3333
- name: bandit
3434
run: make bandit
3535
- name: mypy

.github/workflows/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ jobs:
88
runs-on: ubuntu-latest
99
strategy:
1010
matrix:
11-
python-version: ['3.9', '3.10', '3.11', '3.12', '3.13']
11+
python-version: ['3.10', '3.11', '3.12', '3.13']
1212
name: Python ${{ matrix.python-version }}
1313

1414
steps:

.github/workflows/windows.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ jobs:
88
runs-on: windows-latest
99
strategy:
1010
matrix:
11-
python-version: ['3.9', '3.10', '3.11', '3.12', '3.13']
11+
python-version: ['3.10', '3.11', '3.12', '3.13']
1212
name: Python ${{ matrix.python-version }} (Windows)
1313

1414
steps:

.pre-commit-config.yaml

Lines changed: 27 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,28 @@
1+
---
12
repos:
2-
- repo: https://github.com/pre-commit/pre-commit-hooks
3-
rev: v2.3.0
4-
hooks:
5-
- id: check-yaml
6-
- id: end-of-file-fixer
7-
exclude: |
8-
(?x)^(
9-
simplemonitor/html/dist/.*bundle.js
10-
)$
11-
- id: trailing-whitespace
12-
exclude: |
13-
(?x)^(
14-
tests/test_alerter.py|
15-
tests/html/.*
16-
)$
17-
- id: flake8
18-
- repo: https://github.com/psf/black
19-
rev: 25.1.0
20-
hooks:
21-
- id: black
22-
- repo: https://github.com/asottile/seed-isort-config
23-
rev: v2.2.0
24-
hooks:
25-
- id: seed-isort-config
26-
- repo: https://github.com/pre-commit/mirrors-isort
27-
rev: v5.9.2 # pick the isort version you'd like to use from https://github.com/pre-commit/mirrors-isort/releases
28-
hooks:
29-
- id: isort
30-
- repo: https://github.com/pre-commit/mirrors-mypy
31-
rev: v0.910
32-
hooks:
33-
- id: mypy
34-
args: ["--install-types", "--non-interactive"]
3+
- repo: https://github.com/pre-commit/pre-commit-hooks
4+
rev: v5.0.0
5+
hooks:
6+
- id: check-yaml
7+
- id: end-of-file-fixer
8+
exclude: |
9+
(?x)^(
10+
simplemonitor/html/dist/.*bundle.js
11+
)$
12+
- id: trailing-whitespace
13+
exclude: |
14+
(?x)^(
15+
tests/test_alerter.py|
16+
tests/html/.*
17+
)$
18+
- repo: https://github.com/astral-sh/ruff-pre-commit
19+
rev: v0.11.5
20+
hooks:
21+
- id: ruff
22+
args: [--fix]
23+
- id: ruff-format
24+
- repo: https://github.com/pre-commit/mirrors-mypy
25+
rev: v0.910
26+
hooks:
27+
- id: mypy
28+
args: ["--install-types", "--non-interactive"]

CHANGELOG

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,15 @@
1+
1.15.0:
2+
* Drop Python 3.9 support
3+
* Use regular text email, not MIME
4+
* Use America/Phoenix timezone not MST
5+
* Update MonitorPkgAudit to match new pkg behaviour
6+
* Add reminders to monitors/alerting
7+
* Add NUT monitor for UPSes
8+
* Bump dependencies
9+
10+
1.14.0:
11+
* ...
12+
113
1.13.0:
214
* Add ntfy alerter
315

Makefile

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.PHONY: flake8 dist twine twine-test integration-tests env-test network-test black mypy linting mypy-strict bandit bandit-strict
1+
.PHONY: dist twine twine-test integration-tests env-test network-test ruff-check ruff-format ruff-format-check mypy linting mypy-strict bandit bandit-strict
22

33
ifeq ($(OS),Windows_NT)
44
MOCKSPATH := tests\mocks;
@@ -9,9 +9,6 @@ INTEGRATION_CONFIG := tests/monitor.ini
99
endif
1010
PIPENV := $(shell which poetry)
1111

12-
flake8:
13-
poetry run ruff check monitor.py simplemonitor/
14-
1512
integration-tests:
1613
PATH="$(MOCKSPATH)$(PATH)" $(PIPENV) run coverage run monitor.py -1 -v -d -f $(INTEGRATION_CONFIG) -j 1
1714

@@ -39,8 +36,14 @@ twine-test:
3936
twine:
4037
poetry run python -m twine upload dist/*
4138

42-
black:
43-
poetry run black --check --diff *.py simplemonitor/
39+
ruff-check:
40+
poetry run ruff check monitor.py simplemonitor/
41+
42+
ruff-format:
43+
poetry run ruff format
44+
45+
ruff-format-check:
46+
poetry run ruff format --check --diff
4447

4548
mypy:
4649
poetry run mypy *.py simplemonitor/
@@ -54,7 +57,7 @@ bandit:
5457
bandit-strict:
5558
poetry run bandit -r -l *.py simplemonitor/
5659

57-
linting: black flake8 mypy bandit
60+
linting: ruff-format ruff-check mypy bandit
5861

5962
docker-build:
6063
docker build -f docker/monitor.Dockerfile .

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
![Tests (Windows)](https://github.com/jamesoff/simplemonitor/workflows/Tests%20(Windows)/badge.svg) ![Tests (Linux)](https://github.com/jamesoff/simplemonitor/workflows/Tests%20(Linux)/badge.svg) ![Linting](https://github.com/jamesoff/simplemonitor/workflows/Linting/badge.svg)
44

5-
[![codecov](https://codecov.io/gh/jamesoff/simplemonitor/branch/master/graph/badge.svg)](https://codecov.io/gh/jamesoff/simplemonitor) [![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
5+
[![codecov](https://codecov.io/gh/jamesoff/simplemonitor/branch/master/graph/badge.svg)](https://codecov.io/gh/jamesoff/simplemonitor) [![Code style: ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v0.json)](https://github.com/astral-sh/ruff)
66

77
SimpleMonitor is a Python script which monitors hosts and network connectivity. It is designed to be quick and easy to set up and lacks complex features that can make things like Nagios, OpenNMS and Zenoss overkill for a small business or home network. Remote monitor instances can send their results back to a central location.
88

docs/alerters.rst

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ These options are common to all alerter types.
9494
:required: false
9595
:default: false
9696

97-
fire this alerter (for a failed monitor) every iteration
97+
fire this alerter (for a failed monitor) every iteration. See also :confval:`allow_reminders`.
9898

9999
.. confval:: urgent
100100

@@ -115,6 +115,14 @@ These options are common to all alerter types.
115115

116116
Set to false to turn off the alerter
117117

118+
.. confval:: allow_reminders
119+
120+
:type: boolean
121+
:required: false
122+
:default: false
123+
124+
Set to true to allow this alerter to send reminders, for monitors configured for them (see :confval:`reminder`)
125+
118126
Time restrictions
119127
-----------------
120128

docs/monitors.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,13 @@ These options are common to all monitor types.
140140

141141
Set to false to turn off the monitor
142142

143+
.. confval:: remind
144+
145+
:type: int
146+
:required: false
147+
:default: none
148+
149+
Number of minutes between repeating alerts for this monitor (as though it had just failed). Note you will also need to enable :confval:`allow_reminders` on alerters for them to send reminders.
143150

144151
.. _monitors-list:
145152

0 commit comments

Comments
 (0)