Metadata-Version: 2.4
Name: elenchos_check_nftables
Version: 1.0.1
Summary: A Élenchos command for checking the number of lines in the ruleset of nftables.
License: MIT
License-File: LICENSE.md
Keywords: Élenchos,Elenchos,nftables
Author: Set Based IT Consultancy
Author-email: info@setbased.nl
Requires-Python: >=3.12.0,<4.0.0
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: System Administrators
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Topic :: System :: Systems Administration
Requires-Dist: elenchos (>=1.2.0,<2.0.0)
Project-URL: Documentation, https://github.com/NagiosElenchos/check_nftables
Project-URL: Repository, https://github.com/NagiosElenchos/check_nftables
Description-Content-Type: text/markdown

# Élenchos: Check nftables

A Élenchos command for checking the number of lines in the ruleset of nftables.

## Installation and Configuration

Install Élenchos if not already installed:

```shell
cd /opt

mkdir elenchos
cd elenchos

python -m venv .venv
. .venv/bin/activate
pip install elenchos

mkdir bin
ln -s ../.venv/bin/elenchos bin/elenchos
```

Install the `check:nftables` plugin:

```shell
cd /opt/elenchos
. .venv/bin/activate

pip install elenchos_check_nftables
./bin/elenchos gather-commands
```

Create a configuration file `/etc/nrpe.d/check_nftables.cfg` for `nrpe`:

```
command[check_nftables]=/opt/elenchos/bin/elenchos check:nftables <arguments>
```

Possible arguments are:

* `-w`, `--warning[=WARNING]` The warning level for the number of lines in the ruleset.
* `-c`, `--critical[=CRITICAL]` The critical level for the number of lines in the ruleset.

Allow Élenchos to list the ruleset of nftables by creating the config file `/etc/sudoers.d/enlenchos_check_nftables`:

```
Defaults !requiretty
 
nrpe ALL = (root) NOPASSWD: /usr/bin/nft list ruleset
```

Finally, restart the `nrpe` daemon:

```shell
systemctl reload nrpe
```

## License

This project is licensed under the terms of the MIT license.

