Skip to main content

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

NagiosCheckHelper-0.1.2.tar.gz (2.8 kB view hashes)

Uploaded Source

Built Distribution

NagiosCheckHelper-0.1.2-py3-none-any.whl (15.2 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page