Commit f375f837 by JR Dalrymple

0.1 version

parent 9c3aa7c5
#!/usr/bin/python
#################################################################################
#
# NAME: check_passive_autocreate.py
#
# COMMENT: Python program that will compare nagios.log unconfigured services
# with objects.cache file configured objects. If the host matches it
# will create the new service using a template FILE you specify.
# Requires that the nagios user has sudo access to restart nagios.
# Also this iteration assumes systemd, for older Linux you'll have to
# adjust.
#
# TODO: - Make it so that the template file can have register 0 and the new
# services still get registerd.
# - Add init system support.
#
#
# Release Hitory:
#
# 0.1 - 10/28/2015 - Initial Release. It totally works.
#################################################################################
import os
import sys
import getopt
......@@ -129,4 +151,7 @@ for newService in servicesToCreate:
for line in outLines:
f.write(line)
f.close
outLines = []
if len(servicesToCreate) > 0:
os.system("/usr/bin/sudo /usr/bin/systemctl restart nagios")
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment