Skip to content

nigelhanlon/nagiostemplate

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

Nagios Plugin Template

check_service.py is simple Nagios plugin template written in python. Just add your own check logic and then call one of the four state functions to alert Nagios.

Example: Monitor 5 minute load average and alert when greater than 1

if __name__ == "__main__":
    import os
    load = os.getloadavg()
    if load[1] < 1:
        ok("Load - %f" % load[1] )
    else:
        critical("Load - %f" % load[1] )

Installation

Like most Nagios plugins you can either add it to nrpe.cfg if you are using the NRPE daemon or call it via sendnsca:

$ # vim /etc/nagios/nrpe.cfg
 .
 ..
 ...
 command[myservice]=/usr/lib/nagios/plugins/check_service.py
 ...
 ..
 .
$

Version

  • Version 1.0.0

About

A simple python based Nagios template for writing your own plugins

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages