Skip to content

Commit f164a82

Browse files
Merge pull request #5 from NETWAYS/maintenance
- General refactoring - Hopefully improve code quality - Update to use newer versions of `pysnmp`
2 parents 40adcc3 + 8bc4f9c commit f164a82

14 files changed

Lines changed: 550 additions & 238 deletions
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Bug Report
2+
description: File a bug report
3+
title: "[Bug]: "
4+
labels: ["bug", "needs-triage"]
5+
body:
6+
- type: checkboxes
7+
id: terms
8+
attributes:
9+
label: Please try to fill out as much of the information below as you can. Thank you!
10+
options:
11+
- label: Yes, I've searched similar issues on GitHub and didn't find any.
12+
required: true
13+
- type: input
14+
id: app_version
15+
attributes:
16+
label: Which version contains the bug?
17+
placeholder: 1.0.0
18+
- type: textarea
19+
id: description
20+
attributes:
21+
label: Describe the bug
22+
description: Please provide a concise description of the bug, add any relevant output or error messages. You can use markdown.
23+
- type: textarea
24+
id: recreate
25+
attributes:
26+
label: How to recreate the bug?
27+
description: Please provide the steps to recreate the issue.
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
name: Documentation
2+
description: Suggest documentation improvements
3+
title: "[Documentation]: "
4+
labels: ["documentation"]
5+
body:
6+
- type: textarea
7+
id: description
8+
attributes:
9+
label: Describe the improvements you'd like.
10+
description: Please provide as much context as possible. You can use markdown.
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
name: Feature Request
2+
description: Request a feature or enhancement
3+
title: "[Feature]: "
4+
labels: ["feature", "needs-triage"]
5+
body:
6+
- type: markdown
7+
attributes:
8+
value: |
9+
Please try to fill out as much of the information below as you can. Thank you!
10+
**Note:** If you want to sponsor new features, contact us at info@netways.de
11+
- type: textarea
12+
id: description
13+
attributes:
14+
label: Describe the feature request
15+
description: Please provide a concise description of the feature. You can use markdown.
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
name: Question
2+
description: Ask a question
3+
title: "[Question]: "
4+
labels: ["question"]
5+
body:
6+
- type: textarea
7+
id: description
8+
attributes:
9+
label: Ask a question
10+
description: Please provide as much context as possible. You can use markdown.

.github/dependabot.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: "github-actions"
4+
directory: "/"
5+
schedule:
6+
interval: monthly

.github/workflows/unittest.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: CI
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
gitHubActionForPytest:
7+
runs-on: ubuntu-latest
8+
strategy:
9+
matrix:
10+
python-version: [3.10, 3.11, 3.12, 3.13, 3.14]
11+
name: GitHub Action
12+
steps:
13+
- name: Checkout
14+
uses: actions/checkout@v6
15+
- name: Install dependencies
16+
run: |
17+
python -m pip install -r requirements.txt -r requirements-dev.txt
18+
- name: Lint
19+
run: |
20+
make lint
21+
- name: Test
22+
run: |
23+
make coverage

.gitignore

Lines changed: 63 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,65 @@
1-
.idea
2-
.venv
1+
# Byte-compiled / optimized / DLL files
32
__pycache__/
3+
*.py[cod]
4+
5+
# C extensions
6+
*.so
7+
8+
# Distribution / packaging
9+
.Python
10+
env/
11+
venv/
12+
.venv/
13+
build/
14+
develop-eggs/
15+
dist/
16+
downloads/
17+
eggs/
18+
.eggs/
19+
lib/
20+
lib64/
21+
parts/
22+
sdist/
23+
var/
24+
*.egg-info/
25+
.installed.cfg
26+
*.egg
27+
28+
# PyInstaller
29+
# Usually these files are written by a python script from a template
30+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
31+
*.manifest
32+
*.spec
33+
34+
# Installer logs
35+
pip-log.txt
36+
pip-delete-this-directory.txt
37+
38+
# Unit test / coverage reports
39+
htmlcov/
40+
.tox/
41+
.coverage
42+
.coverage.*
43+
.cache
44+
nosetests.xml
45+
coverage.xml
46+
*,cover
47+
48+
# Translations
49+
*.mo
50+
*.pot
51+
52+
# Django stuff:
53+
*.log
54+
55+
# Sphinx documentation
56+
docs/_build/
57+
58+
# PyBuilder
59+
target/
60+
61+
# Editors
62+
\#*
63+
.\#*
64+
.idea
465
*.bak

.pylintrc

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# pylint config
2+
[FORMAT]
3+
good-names=s,r,e
4+
[MESSAGES CONTROL]
5+
disable=fixme,
6+
invalid-name,
7+
consider-using-f-string,
8+
missing-module-docstring,
9+
too-many-instance-attributes,
10+
too-many-arguments,
11+
too-many-branches,
12+
too-many-locals,
13+
too-many-statements,
14+
redefined-outer-name,
15+
no-member,

Makefile

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
.PHONY: lint test coverage
2+
3+
lint:
4+
python -m pylint check_sensorProbe2plus.py
5+
test:
6+
python -m unittest -v test_check_sensorProbe2plus.py
7+
coverage:
8+
python -m coverage run -m unittest -b test_check_sensorProbe2plus.py
9+
python -m coverage report -m --include check_sensorProbe2plus.py

README.md

Lines changed: 16 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,27 @@
1-
## check_sensorProbe2plus ##
2-
3-
### Description ###
1+
# check_sensorProbe2plus
42

53
This plugin serves the purpose of receiving data from the SensorProbe2+ and checking its state.
64

7-
8-
### Dependencies ###
5+
## Dependencies
96

107
+ [PySNMP](https://github.com/etingof/pysnmp)
11-
+ [enum34](https://pypi.org/project/enum34)
128

13-
### Usage ###
9+
## Usage
1410

1511
```
16-
check_sensorProbe2plus.py -H -C [-p] [-V] [-v] [-h]
17-
```
12+
usage: check_sensorProbe2plus.py [-h] [-V] [-v] [-p PORT] -H HOSTNAME -C COMMUNITY
1813
19-
#### required arguments: ####
14+
Check plugin for AKCP SensorProbe2+
2015
21-
+ **HOSTNAME:** host of the SensorProbe2+
22-
`` -H, --hostname ``
23-
+ **COMMUNITY:** read community of the SensorProbe2+
24-
`` -C, --community ``
16+
options:
17+
-h, --help show this help message and exit
18+
-V, --version
19+
-v, --verbose increase output verbosity (-v or -vv)
20+
-p, --port PORT port of the sensors to check (shows all if not set)
2521
26-
#### optional arguments: ####
27-
28-
+ **HELP** show the help message and exit
29-
`` -h, --help ``
30-
+ **VERSION** shows the current version of the check plugin
31-
`` -V, --version ``
32-
+ **VERBOSE** increases output verbosity (-v or -vv)
33-
`` -v, --verbose ``
34-
+ **PORT** port of the sensor to check (shows all if not set)
35-
`` -p, --port ``
22+
required arguments:
23+
-H, --hostname HOSTNAME
24+
host of the sensor probe
25+
-C, --community COMMUNITY
26+
read community of the sensor probe
27+
```

0 commit comments

Comments
 (0)