Howto disable service notification for a specific host, while the service is associated via the host group?

63 views
Skip to first unread message

Armin Gruner

unread,
Mar 24, 2014, 12:53:55 PM3/24/14
to pynag-...@googlegroups.com
Hi,

first of all, thanks for your good work. pynag makes is so much easier to work with NAGIOS.
Last week, I've finally installed adagios, which is even more beautiful. Very impressed!

While trying to automate some more stuff here, I'm searching for a way to disable notification for a specific service on a specific host, while the service is associated to the host through it's host group membership and not a single service object definition.

So, the problem is,

Model.Service.objects.filter(host_name="...")

gives no object to update.

Actually this is true, because there is no real single configuration item for the service on the host.

Is it possible to disable service notification for a specific host through pynag then?

Thanks & Greetings from Munich

Armin




Páll Sigurðsson

unread,
Mar 24, 2014, 1:12:46 PM3/24/14
to pynag-...@googlegroups.com
Hey Armin,

In latest adagios from the testing repo, we are cooking up something that helps with your exact use case.

* Click on your host/service in the status view
* Click edit button
* You should get a dialog which asks if you want to edit the service for the whole hostgroup or edit just the single host


Behind the scenes what happens is something on the lines of:
* Copy the service
* Remove hostgroup_name field on the new service
* Add host_name = 'yourhost' to the new service
* Save the new service


To be precise:
```
service = pynag.Model.Service.filter(hostgroup_name=x, service_description=y)
new_service = service.copy(hostgroup_name=None, host_name=z) 
new_service.save()
```

Good luck with the automation efforts!


--
You received this message because you are subscribed to the Google Groups "pynag-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pynag-discus...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages