HostGroups and Configuring Services
-
rbizzell39
- Posts: 112
- Joined: Thu Dec 17, 2015 1:24 pm
HostGroups and Configuring Services
Hello,
I created a hostgroups.cfg made the changes in the nagios.cfg and then went into the windows.cfg and under service for checking disk usage I changed the directive to host_groups and put in the windows servers which is the group name.
When I do a config check and I get an error in the hostgroups.cfg and contacts. I would like to know if there is a way to add all my windows servers etc in the hostgroups.cfg and then in windows.cfg where all the services I want to monitor can I just add the hostgroup or do I still have to add each individual server name and IP address.
I created a hostgroups.cfg made the changes in the nagios.cfg and then went into the windows.cfg and under service for checking disk usage I changed the directive to host_groups and put in the windows servers which is the group name.
When I do a config check and I get an error in the hostgroups.cfg and contacts. I would like to know if there is a way to add all my windows servers etc in the hostgroups.cfg and then in windows.cfg where all the services I want to monitor can I just add the hostgroup or do I still have to add each individual server name and IP address.
- Box293
- Too Basu
- Posts: 5126
- Joined: Sun Feb 07, 2010 10:55 pm
- Location: Deniliquin, Australia
- Contact:
Re: HostGroups and Configuring Services
What you are trying to do is a good practice. Before trying to troubleshoot your issue, have a look at this page which should make it clear how to do it:
http://sites.box293.com/nagios/guides/c ... n-services
If you're still having issues can you please post you configs for your hostgroup, hosts and service.
http://sites.box293.com/nagios/guides/c ... n-services
If you're still having issues can you please post you configs for your hostgroup, hosts and service.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
-
rbizzell39
- Posts: 112
- Joined: Thu Dec 17, 2015 1:24 pm
Re: HostGroups and Configuring Services
When I create the hostgroups.cfg do I need to add the service directive into that cfg file as well just like the windows.cfg file that has the service directives.
-
rbizzell39
- Posts: 112
- Joined: Thu Dec 17, 2015 1:24 pm
Re: HostGroups and Configuring Services
Here is what I did in the hostgroups.cfg added the hostgroup_name and then added a service within that same config just the like windows.cfg
I get
Read main config file okay...
Error: Invalid hostgroup object directive 'contact_groups'.
Error: Could not add object property in file '/usr/local/nagios/etc/objects/hostgroups.cfg' on line 8.
Error processing object config files!
***> One or more problems was encountered while processing the config files...
Check your configuration file(s) to ensure that they contain valid
directives and data defintions. If you are upgrading from a previous
version of Nagios, you should be aware that some variables/definitions
may have been removed or modified in this version. Make sure to read
the HTML documentation regarding the config files, as well as the
'Whats New' section to find out what has changed.
hostgroups.cfg
# 'Windows' host group definition
define hostgroup{
hostgroup_name Windows Servers
alias Windows Servers
contact_groups nt-admins
members Win-BUILD001,
}
# define service
define service{
use generic-service
hostgroup_name Windows Servers
service_description NSClient++ 0.4.1.73 Version
check_command check_nt!CLIENTVERSION
}
I made the changes in the nagios config for the hostgroup directive.
I get
Read main config file okay...
Error: Invalid hostgroup object directive 'contact_groups'.
Error: Could not add object property in file '/usr/local/nagios/etc/objects/hostgroups.cfg' on line 8.
Error processing object config files!
***> One or more problems was encountered while processing the config files...
Check your configuration file(s) to ensure that they contain valid
directives and data defintions. If you are upgrading from a previous
version of Nagios, you should be aware that some variables/definitions
may have been removed or modified in this version. Make sure to read
the HTML documentation regarding the config files, as well as the
'Whats New' section to find out what has changed.
hostgroups.cfg
# 'Windows' host group definition
define hostgroup{
hostgroup_name Windows Servers
alias Windows Servers
contact_groups nt-admins
members Win-BUILD001,
}
# define service
define service{
use generic-service
hostgroup_name Windows Servers
service_description NSClient++ 0.4.1.73 Version
check_command check_nt!CLIENTVERSION
}
I made the changes in the nagios config for the hostgroup directive.
Re: HostGroups and Configuring Services
So, the contact_groups can only be defined for hosts/services and no longer works on hostgroups. You need to manipulate the hosts in the hostgroup to use a contact group instead of defining it in the hostgroup itself.
Here's a doc about object inheritance for you to peruse: https://assets.nagios.com/downloads/nag ... tance.html
Let us know if the config applies with the change, thanks!
Here's a doc about object inheritance for you to peruse: https://assets.nagios.com/downloads/nag ... tance.html
Let us know if the config applies with the change, thanks!
/Luke
-
rbizzell39
- Posts: 112
- Joined: Thu Dec 17, 2015 1:24 pm
Re: HostGroups and Configuring Services
Does everything else look okay
Re: HostGroups and Configuring Services
Yes! I think if you just remove the contact_groups from the hostgroup, add the hostgroup to the host and create a contact group for the host you should be able achieve what you are after. Let us know if this works out!
/Luke
-
rbizzell39
- Posts: 112
- Joined: Thu Dec 17, 2015 1:24 pm
Re: HostGroups and Configuring Services
okay thanks!
-
dwhitfield
- Former Nagios Staff
- Posts: 4583
- Joined: Wed Sep 21, 2016 10:29 am
- Location: NoLo, Minneapolis, MN
- Contact:
Re: HostGroups and Configuring Services
If it ends up not working, we'll be here until 5pm US Central today.
If it does work, if you could let us know so we can lock the thread, that would be super-duper.
If it does work, if you could let us know so we can lock the thread, that would be super-duper.
-
rbizzell39
- Posts: 112
- Joined: Thu Dec 17, 2015 1:24 pm
Re: HostGroups and Configuring Services
Great will do.