A YAML config centric tool to act on your service status
Project description
About Janch
Janch is a utility that can be customized for checking anything. It reads what it needs to check from a YAML file.
Features
I just started the tool so the features are limited.
- Run a linux command and inspect its output
- Run a grep command and inspect its output
- Gather content of a web address (http/https) and inspect the response
Installation
Install from PyPi
.. code-block:: bash
pip install janch
Run Help
.. code-block:: bash
janch --help
Run a sample file
.. code-block:: bash
janch run tests/samples/0.sample.yml
Quick Start
- Create a YAML such as the following
.. code-block:: bash
touch sample.yml
vim sample.yml
.. code-block:: yaml
command-example:
gather:
type: command
command_str: python --version
inspect:
result: ^Python 3\.(.*)$
grep-example:
gather:
type: grep
filepath: test.env
search: '='
inspect:
result: (.*)=(.*)
line_count: 1
webservice-example:
gather:
type: http
url: http://www.example.com
inspect:
status: 200
- Create a sample file for checking
.. code-block:: bash
touch test.env
vim test.env
.. code-block::
# File Content
Hello=world
- Run Janch
.. code-block:: bash
janch run sample.yml
- You should get an output that looks as follows
.. code-block:: text
item type field expected actual match error
grep-example grep result (.*)=(.*) Hello=world True False
grep-example grep line_count 1 1 True False
grep-example grep error NOERROR NOERROR True False
command-example command result ^Python 3\.(.*)$ Python 3.8.2 True False
command-example command error NOERROR NOERROR True False
webservice-example http status 200 200 True False
webservice-example http error NOERROR NOERROR True False
- The match column shows which of the items from the yaml behaved as expected
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 Distributions
No source distribution files available for this release.See tutorial on generating distribution archives.
Built Distribution
janch-0.0.2-py3-none-any.whl
(14.9 kB
view details)
File details
Details for the file janch-0.0.2-py3-none-any.whl
.
File metadata
- Download URL: janch-0.0.2-py3-none-any.whl
- Upload date:
- Size: 14.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/4.0.1 pkginfo/1.4.2 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.57.0 CPython/3.9.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1331173643a1c905983e65ce2ea0315da8bec382acf42a41bb8aa12afd338b2d |
|
MD5 | d7b055e347deb9fbe58028a4639ee6a7 |
|
BLAKE2b-256 | 72f6820c9425039e38fe8518b1e576575e67872eb8ee0a667f9481c22fbde155 |