Skip to content

Conversation

@abdulkaderf
Copy link

Add support for custom checks

Hi! I came across the project and I really like how simple and straightforward it is. I needed a tool to watch a few processes and that made me think of a potential addition that would help me achieve what I need.
In my case, I needed to have a check that didn't fall into the supported categories, so I thought I would add a type for user-defined checks where a user can run any python method that returns a boolean. This can cover a wide range of checks without having a very tailored solution to different use cases.

Further details

The new check type accepts a module and a method name, as well as a dictionary of variables. The script calls the defined method with those variables and displays "operational" if the check passed, and "down" if it didn't. I added an example in the readme file to make it easy to configure.

One sample use case of this would be performing a simple processing on the response of an API. The user can define a function where they check for an expected value, and return True / False accordingly.

Looking forward to seeing your review!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant