Nagios Helper Objects for Python Check Scripts
Project description
NagiosCheckHelper
This library helps with the boilerplate nagios check formating/status information when writing a Python check
NagErrors Object
An object to hold the Errors that have occured.
Generally you can call it with obj.addCritical(error text) or obj.addWarning(error text) to accumulate your errors
Then call obj.printStatus() to print the formatted Errors
Then call obj.doExit() to exit your program with the proper result code.
2cent example:
import NagErrors from NagiosCheckHelper
nerr = NagErrors()
nerr.addCritical("This is a Critical Event")
nerr.addWarning("This is a Warning Event")
nerr.printStatus()
nerr.doExit()
NagEval Object
An object with common subroutines to evaluate data and cause error events based on the comparisons.
Be sure to initite it with an NagErrors Object.
evalEnum
Evaluate a value and see if it matches with an array of values
obj.evalEnum("ALL OK", defaultStatus="CRITICAL", okValues=["ALL OK"], unknownValues=["Don't Know"])
evalNumberAsc
Evaluate a number and see if it is above a certain value
obj.evalNumberAsc(50, warningAbove=80, criticalAbove=95, numberUnits=" degrees F")
evalNumberDesc
Evaluate a number and see if it is below a certain value
obj.evalNumberDesc(50, warningBelow=32, criticalBelow=10, numberUnits=" degrees F")
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for NagiosCheckHelper-0.1.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6080911c8484ba03d2dcf6956f8d24176e4a118699b2eeeb621446dadc44f0e8 |
|
MD5 | a78470e73f47d4ee2c268b3db00ed0ee |
|
BLAKE2b-256 | 9f527f2dad4ff870239c40de14837a22c90fa0fab15cb98f465f68858b769bc1 |