Hey all, now that I've figured out my server email issue I'm getting my alerting figured out. I do have one question though -- where do you keep your object definitions? I was going to keep them in my templates.cfg file but then I dont' know which other .cfg files are using those definitions. I think I'm also going to split some of the alerting so important alerts go to my cell phone and less important alerts go to my email address so one definition could have two (or possibly three) different contacts. Then I thought I'd just put that definition in the top of my .cfg files but that seems like a lot of duplication for some things. I tried to find some hints and tips for alerting but I can't find anything along these lines. Any help here would be greatly appreciated.
Thanks,
Joe B
Where do you have your object defitions
-
slansing
- Posts: 7698
- Joined: Mon Apr 23, 2012 4:28 pm
- Location: Travelling through time and space...
Re: Where do you have your object defitions
Hey jbruyet,
Which object definitions do you mean? Objects are typically Hosts, Services, groups, etc. These are commonly split into their own .cfg files so you do not have to go on a wild game hunt trying to track down a single service definition. On the note of alerting, your alert definitions are generally on a host/service basis, or a template applied to your hosts/services.
Which object definitions do you mean? Objects are typically Hosts, Services, groups, etc. These are commonly split into their own .cfg files so you do not have to go on a wild game hunt trying to track down a single service definition. On the note of alerting, your alert definitions are generally on a host/service basis, or a template applied to your hosts/services.
Re: Where do you have your object defitions
Ok, I guess I didn't know what they were called. I had copied some of the definitions that are listed in the templates.cfg file over to some of my .cfg files in Objects. My question is do people think it better to have those definitions in the .cfg files (printer.cfg, routers.cfg, etc.) along with the host definitions or or do people think it better to keep them in one file like the templates.cfg file.
Thanks,
Joe B
Thanks,
Joe B
-
slansing
- Posts: 7698
- Joined: Mon Apr 23, 2012 4:28 pm
- Location: Travelling through time and space...
Re: Where do you have your object defitions
We'll keep this open to see if there is any community feedback, generally we see people (including ourselves) use separate configuration files, e.g "switch1.cfg holding the host and service definitions for this switch, etc."
Re: Where do you have your object definitions
Ok, maybe I'm explaining it wrong. Here's one of the "Host Definitions" that I'm talking about:
Then in my Service and Process checks I include the line:
I have some of these definitions sitting in the templates.cfg file and I have some of them sitting in the device config files. I see advantages and disadvantages to both ways so before I go all in I wanted to see what other admins have done, and maybe why they did it that way.
Thanks,
Joe B
Code: Select all
define host {
name WinServer
use generic-host
check_period 24x7
check_interval 5
retry_interval 1
max_check_attempts 10
check_command check-host-alive
notification_period 24x7
notification_interval 30
notification_options d,u,s
contact_groups PhoneContacts
register 1
}
Code: Select all
use WinServerThanks,
Joe B
Re: Where do you have your object defitions
I think you might be a bit confused about the "use" directive. "use" includes a template in your host/service/whatever definition. If you try to "use" the name of a host, weird things will happen if it works at all. One exception to this is incomplete object definitions, but you are not using these here.
As for keeping things organized, I usually keep all related services in one config when using Core since the editing is mainly done by hand in this case. That way you only have to open one file when removing a lot of services of the same type from hosts.
As for keeping things organized, I usually keep all related services in one config when using Core since the editing is mainly done by hand in this case. That way you only have to open one file when removing a lot of services of the same type from hosts.
Former Nagios employee