Page 1 of 1
service templates woes
Posted: Tue Oct 13, 2015 4:44 pm
by pkarr
We have 3 service checks assigned to a Service Template. That Service Template is in turn assigned to a Host.
After successfully running an apply config only one service is displayed. Is there anything we can do to get this to
work for us?
thanks,
Penny
Penny Karr | IT Infrastructure Monitoring
Harvard Vanguard Medical Associates, an Affiliate of Atrius Health
254 Second Avenue | Needham, MA 02494
P (781) 292-1853 | F (781 292-1980 |
http://www.harvardvanguard.org
Email:
[email protected]
Re: service templates woes
Posted: Tue Oct 13, 2015 6:52 pm
by SteveBeauchemin
I have many service templates and host templates. They are the foundation used for all my checks.
In order to get services to show up under hosts in the Nagios Service Status page, here is what I do.
I create service template with all the settings I use at my site. These are all the common items
such as everything under the Misc Settings, Alert Settings, and Check settings tabs.
Then I make a service and have it use that template to establish all those defaults.
In this new service I only use the Common Settings tab, and add the check command
and all the ARG that it needs. I also assign a hostgroup, but read on for that.
The Service template is for all the common mundane settings.
The Service itself is for running the test on the proper group of hosts.
To glue the service test to hosts, I make a hostgroup using an appropriate name.
I find that naming conventions can save you much grief over time.
The host goes in the hostgroup, the hostgroup goes in the service.
So the Service uses a template and gets a hostgroup.
Then, as more hosts come on line that need the same test, add them to the group.
For example, you can have one service template, and 30 services using the template.
Maybe all 30 tests are specifically designed to test many different pieces of MS2012 server.
But all the tests run every 5 minutes, contact the same email for alerts,
and so on. Common items from the template...
Then you could create a hostgroup, maybe named hg-MS2012-Server.
Add that host group to each service test (not to the service template).
So, from this point forward, every 2012 server
gets added to one host group, but ends up with 30 service tests in the GUI.
That is the basic idea that I use.
Make hostgroups and glue them to services.
Then add and remove hosts from the hostgroups.
I am sure there are many other methods used. Everyone has their own trick.
Basically I try to never assign a host directly to a service.
I think you are on the right track but need to make one small change in methodology.
Good Luck
Steve B
Re: service templates woes
Posted: Tue Oct 13, 2015 6:59 pm
by jdalrymple
This could be tricky to troubleshoot. First I'll say that's a pretty unorthodox way of using service templates, can you describe your use case and maybe we can describe a more proper way to achieve your goal.
Actually troubleshooting your problem - it may be necessary in the services themselves to go in and choose "NULL" for the host selection so that the nothingness doesn't override your template. I have a hunch that's not it though... I have a hunch that there is some external force at play that we're not privy to.