Skip to content
This repository was archived by the owner on Oct 26, 2025. It is now read-only.

maduck/libnagios

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

51 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Travis Coveralls Codacy grade Maintainability

Nagios plugin helper library. It is now easy to write Nagios plugins in python without bothering with details.

An example:

import sys
from libnagios import Nagios

nagios_check = Nagios('Asset')

asset = CheckVariable('asset', float, 'EUR')
asset.ok_condition = lambda x: x > 10
asset.warn_condition = lambda x: 5 < x <= 10
asset.crit_condition = lambda x: x <= 5
self.inst.add_check_variable(asset)

nagios_check.add_check_variable(asset)

nagios_check.add_check_result('asset', 12)
code, output = nagios_check.generate_output()

print(output)
sys.exit(code)

this should print 'Asset OK - 12.00 EUR | asset=12.00', and exit with code '0'.

About

Python Helper Library for Nagios plugins

Topics

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages