As per a previous post, I've used a combination of services and hostgroups to configure my monitoring infrastructure. Basically, I have various hostgroups and these hostgroups have associated services. I'm running in to a situation where I'd like specific hosts to have different thresholds and was wondering if there was a method to override the hostgroup values.
Specifically, I'm trying to override the CPU usage thresholds. In general, I've set the hostgroup to warn at 80% and critical at 90%. The hostgroup contains about 60 machines and this setting works for all except for a few. These few systems hover around 75% to 82% CPU usage as as such frequently produce warnings. Is there a host specific override I could use to bump up these numbers or should I be creating a new hostgroup with a new service for these specific servers. I'm trying to no have any duplicate services definitions.
Please let me know if this is possible or if you have any other suggestions
Best regards,
Host specific overrides
-
scottwilkerson
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: Host specific overrides
This would be correct. You wouldn't have duplicate service definitions because if the thresholds are different, the service definition is different.rlacasse wrote: Is there a host specific override I could use to bump up these numbers or should I be creating a new hostgroup with a new service for these specific servers. I'm trying to no have any duplicate services definitions.
Re: Host specific overrides
If I have a host which is part of two hostgroups and each hostgroup has a service called "CPU Usage", how can I determine which service parameters are being used? Is it undetermined, the most restrictive, the least restrictive or is some other criteria used?
Thank you
Thank you
-
scottwilkerson
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: Host specific overrides
This sparked a good question, so I did some testing and it was as I suspected.
The last cfg file for the service read in wins.
So, if one of your config names is "CPU Usage" and another config name named "zzzCPU Usage", "zzzCPU Usage" will win and that is what is used.
The last cfg file for the service read in wins.
So, if one of your config names is "CPU Usage" and another config name named "zzzCPU Usage", "zzzCPU Usage" will win and that is what is used.
Re: Host specific overrides
Thank you, good to know.
As a follow-up question, short of going through each hostgroup and hosts to verify the host & hostgroup membership, is there a method to query or view the membership of a specific host?
Thanks,
René
As a follow-up question, short of going through each hostgroup and hosts to verify the host & hostgroup membership, is there a method to query or view the membership of a specific host?
Thanks,
René
Re: Host specific overrides
Nothing that's better than accessing the hostgroup in the UI and manually verifying.
There is an experimental workaround you could try to exclude a host from getting a service assigned via a hostgroup. If you don't have any individual hosts assigned in a service->hostgroup assignment, you can try adding a custom variable for that service that looks like the following:
variable name: host_name
variable definition: !host1,!host2,!host3
And the host names with exclamation points in front of them would be the excluded from the assignment. Again, this is an experimental workaround, and we don't promise it working, but it might be something to try.
There is an experimental workaround you could try to exclude a host from getting a service assigned via a hostgroup. If you don't have any individual hosts assigned in a service->hostgroup assignment, you can try adding a custom variable for that service that looks like the following:
variable name: host_name
variable definition: !host1,!host2,!host3
And the host names with exclamation points in front of them would be the excluded from the assignment. Again, this is an experimental workaround, and we don't promise it working, but it might be something to try.
Re: Host specific overrides
I'm trying to do as suggested and using to override a service by having the same service name but with a different config name. I'm using "NFP-Backend" and "NFP-Backend-Backup".
Basically I'm trying to see if a process is running, except on backup machines I want to check that it's not running.
You had suggested that "zzzCPU Usage" would win over "CPU Usage" for Config Name but it doesn't seem to be working for me. I also tried "xNFP-Backend" but that do anything either.
Has this behaviour changed in a recent release? I'm running 2012R1.3
Thank you
Basically I'm trying to see if a process is running, except on backup machines I want to check that it's not running.
You had suggested that "zzzCPU Usage" would win over "CPU Usage" for Config Name but it doesn't seem to be working for me. I also tried "xNFP-Backend" but that do anything either.
Has this behaviour changed in a recent release? I'm running 2012R1.3
Thank you
Re: Host specific overrides
I think what you're trying to do may be different than the previous thread. Can you elaborate on how you're trying to override a service?
As a rule, you should always try to avoid duplicate service definitions for a host. You should either have:
Service->Host relationship.
Service->Multiple hosts
Service->Hostgroup relationship
Service->Hostgroup + Multiple hosts
"Config Name" doesn't really mean anything to Nagios itself, it's mainly just a way to organize the service definition so you can identify where it is.
As a rule, you should always try to avoid duplicate service definitions for a host. You should either have:
Service->Host relationship.
Service->Multiple hosts
Service->Hostgroup relationship
Service->Hostgroup + Multiple hosts
"Config Name" doesn't really mean anything to Nagios itself, it's mainly just a way to organize the service definition so you can identify where it is.
Re: Host specific overrides
They way I've set it up is all of the systems I'm monitoring fall in to specific Hostgroups. All of my services are configured for these Hostgroups and when I create a new host, I add it to the appropriate hostgroups. This is all in a effort to prevent duplication.
In the systems I'm trying to configure now, out of 30 checks, the only difference between "live" and "backup" systems is the running of a single process. For examples sake, lets say that's httpd.
All of the systems belong to my "Backend" hostgroup and all 30 services are configured for that hostgroup. For the backup system, I want them to run all the same services except instead of checking if httpd is running, I want to ensure that it's not for the backup machines.
I've thought about creating 3 hostgroups, "common", "live" & "backup" but I was finding this cumbersome and it's that much more to manage. I'm open to suggestions thought.
Thank you,
In the systems I'm trying to configure now, out of 30 checks, the only difference between "live" and "backup" systems is the running of a single process. For examples sake, lets say that's httpd.
All of the systems belong to my "Backend" hostgroup and all 30 services are configured for that hostgroup. For the backup system, I want them to run all the same services except instead of checking if httpd is running, I want to ensure that it's not for the backup machines.
I've thought about creating 3 hostgroups, "common", "live" & "backup" but I was finding this cumbersome and it's that much more to manage. I'm open to suggestions thought.
Thank you,
-
scottwilkerson
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: Host specific overrides
This is exactly what I would do. I would haverlacasse wrote:I've thought about creating 3 hostgroups, "common", "live" & "backup" but I was finding this cumbersome and it's that much more to manage. I'm open to suggestions thought.
create common hostgroup and add the live and backup groups as members
add the common hostgroup to all of the services that are shared by all
add the live hostgroup to services specific to live
add the backup hostgroup to services specific to backup