|
|
@ -227,7 +227,7 @@ def main():
|
|
|
|
# 'minutes' and 'service' manually.
|
|
|
|
# 'minutes' and 'service' manually.
|
|
|
|
|
|
|
|
|
|
|
|
##################################################################
|
|
|
|
##################################################################
|
|
|
|
if action not in ['command', 'silence_nagios', 'unsilence_nagios', 'servicegroup_downtime']:
|
|
|
|
if action not in ['command', 'silence_nagios', 'unsilence_nagios']:
|
|
|
|
if not host:
|
|
|
|
if not host:
|
|
|
|
module.fail_json(msg='no host specified for action requiring one')
|
|
|
|
module.fail_json(msg='no host specified for action requiring one')
|
|
|
|
######################################################################
|
|
|
|
######################################################################
|
|
|
@ -300,7 +300,7 @@ class Nagios(object):
|
|
|
|
self.author = kwargs['author']
|
|
|
|
self.author = kwargs['author']
|
|
|
|
self.comment = kwargs['comment']
|
|
|
|
self.comment = kwargs['comment']
|
|
|
|
self.host = kwargs['host']
|
|
|
|
self.host = kwargs['host']
|
|
|
|
self.service_group = kwargs['servicegroup']
|
|
|
|
self.servicegroup = kwargs['servicegroup']
|
|
|
|
self.minutes = int(kwargs['minutes'])
|
|
|
|
self.minutes = int(kwargs['minutes'])
|
|
|
|
self.cmdfile = kwargs['cmdfile']
|
|
|
|
self.cmdfile = kwargs['cmdfile']
|
|
|
|
self.command = kwargs['command']
|
|
|
|
self.command = kwargs['command']
|
|
|
@ -893,11 +893,11 @@ class Nagios(object):
|
|
|
|
services=self.services,
|
|
|
|
services=self.services,
|
|
|
|
minutes=self.minutes)
|
|
|
|
minutes=self.minutes)
|
|
|
|
elif self.action == "servicegroup_host_downtime":
|
|
|
|
elif self.action == "servicegroup_host_downtime":
|
|
|
|
if self.services == 'servicegroup':
|
|
|
|
if self.servicegroup:
|
|
|
|
self.schedule_servicegroup_host_downtime(self, self.servicegroup, minutes=30)
|
|
|
|
self.schedule_servicegroup_host_downtime(servicegroup = self.servicegroup, minutes = self.minutes)
|
|
|
|
elif self.action == "servicegroup_service_downtime":
|
|
|
|
elif self.action == "servicegroup_service_downtime":
|
|
|
|
if self.services == 'servicegroup':
|
|
|
|
if self.servicegroup:
|
|
|
|
self.schedule_servicegroup_host_downtime(self, self.servicegroup, minutes=30)
|
|
|
|
self.schedule_servicegroup_svc_downtime(servicegroup = self.servicegroup, minutes = self.minutes)
|
|
|
|
|
|
|
|
|
|
|
|
# toggle the host AND service alerts
|
|
|
|
# toggle the host AND service alerts
|
|
|
|
elif self.action == 'silence':
|
|
|
|
elif self.action == 'silence':
|
|
|
|