Verified Commit 72fe324a authored by Adrian Schollmeyer's avatar Adrian Schollmeyer
Browse files

generator/host: Add compatibiilty for NRPE checks with new remote_check_method var

parent 90ae49f7
......@@ -121,14 +121,10 @@ class Icinga2Host:
def add_nrpe_check(self, name):
if not self.nrpe:
self.enable_nrpe()
self.nrpe_checks.append(name)
def add_nrpe_disk(self, name):
if not self.nrpe:
self.enable_nrpe()
self.nrpe_disks.append(name)
......@@ -507,16 +503,21 @@ class NetBoxParser:
try:
if monitoring_config_context["nrpe_enabled"]:
self.host.enable_nrpe()
try:
for nrpe_check in monitoring_config_context["nrpe_checks"]:
self.host.add_nrpe_check(nrpe_check)
except KeyError:
pass
try:
for nrpe_disk in monitoring_config_context["nrpe_disks"]:
self.host.add_nrpe_disk(nrpe_disk)
except KeyError:
pass
except KeyError:
pass
try:
for nrpe_check in monitoring_config_context["nrpe_checks"]:
self.host.add_nrpe_check(nrpe_check)
except KeyError:
pass
try:
for nrpe_disk in monitoring_config_context["nrpe_disks"]:
self.host.add_nrpe_disk(nrpe_disk)
except KeyError:
pass
except KeyError:
pass
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment