Page 2 of 3
Re: Setting up monitoring using templates
Posted: Wed Aug 30, 2017 4:43 pm
by dwhitfield
chelch wrote:I have a service template named "Check Host Alive".
Is this applied to any services? That seems to be the missing step in what you've outlined above.
Re: Setting up monitoring using templates
Posted: Wed Aug 30, 2017 5:18 pm
by chelch
When in that service template....
Under common settings, manage host groups, I have the host group added. Check command is populated with "check-host-alive"
Under check settings i have active checks enabled.
Under alert settings, manage contact groups, i have my contact group added. Notifications options enabled are warning,critical, recovery. Notification enabled "on".
I am not sure what you mean by is it applied to any services.
Re: Setting up monitoring using templates
Posted: Thu Aug 31, 2017 8:58 am
by scottwilkerson
chelch wrote:I am not sure what you mean by is it applied to any services.
Service templates do not become active until you have a Service that the template is applied to.
Re: Setting up monitoring using templates
Posted: Thu Aug 31, 2017 12:18 pm
by chelch
Sounds good.
Next question is then where do I manage the "check settings", "alert settings" and "manage host groups" from? The template or the service? Both the service template and the service have those settings. What takes precedence?
Why does the service template and the service both have a check command dropdown box?
Re: Setting up monitoring using templates
Posted: Thu Aug 31, 2017 3:26 pm
by tmcdonald
A service that uses a template and defines a value itself will take precedence over that value defined in the template. You can think of it like a stack of transparent sheets - the top-most stack will be entirely visible, and anything underneath it will be covered by the layers above. So to answer your first question, you would make this change wherever it makes sense to - if many services are using the template and you want them all to use a given value, then you set that value in the template and not on the service. If a service using that template needs to have a special value for just itself, then you set it on the service.
Re: Setting up monitoring using templates
Posted: Thu Aug 31, 2017 3:54 pm
by chelch
Thanks. I believe I am making progress because now I see my host showing the "Host Alive Check" in service status but everything has been pending for quite a while. I assume this is why still not getting alerts? Not sure what I missed.
1.JPG
2.JPG
Re: Setting up monitoring using templates
Posted: Fri Sep 01, 2017 11:58 am
by tgriep
The Grey Host that says that the check is pending is usually caused by that host not having a check command defined to it or that the check interval is not set.
If you did add a template to the host but the host template does not have a check command or the interval set, that would cause what you are seeing.
Re: Setting up monitoring using templates
Posted: Fri Sep 01, 2017 12:59 pm
by chelch
I am not using a host check on the individual host because I am trying to accomplish that with a service template. The service template has a check command populated in the drop down window and has a host group added.
Check settings in template are 5,1,5 and active checks enabled. Check period is 24x7
Re: Setting up monitoring using templates
Posted: Fri Sep 01, 2017 1:38 pm
by tgriep
What you posted sounds right but we would have to see the how the services are configured to be sure.
Can you open this file up on the server
Code: Select all
/usr/local/nagios/var/objects.cache
Find the services that are not running and post the settings here to we can view them?
Re: Setting up monitoring using templates
Posted: Fri Sep 01, 2017 1:52 pm
by chelch
Not experienced with Linux. Is there anyway I can get that for you from the xi web ui?