Add more Host Groups Nagios

An open discussion forum for obtaining help with Nagios Core. Nagios Core users of all experience levels are welcome here. Subforum have been created for the discussion of Nagios Core and Nagios Plugin development.

NOTE: The SourceForge.net mailing lists have been deprecated in favor of this forum in order to expedite support and provide additional features not available on the old mailing list.

Add more Host Groups Nagios

Postby michaelpn » Wed Sep 06, 2017 3:02 am

Hi,
I would like to add more Host Groups on my Nagios Site. Right now I have one for Citrix Servers and would like to have one for Web Servers too. How it is possible to do that ? Right now as written I have crated a Config file for Citrix Servers "hostgroubs.cfg" then I would like to have one for my Web Servers. Why ? because then I have a better view on the Nagios interface.

michaelpn :)
Michael Pierre
Forenede Gruppeliv
2500 Valby
Copenhagen
michaelpn
 
Posts: 10
Joined: Fri Jul 14, 2017 12:12 am

Re: Add more Host Groups Nagios

Postby tacolover101 » Wed Sep 06, 2017 7:22 am

yes - just create a definition in any of your config files. (based on what config file or dirs you are picking up in your nagios.cfg)

https://assets.nagios.com/downloads/nag ... #hostgroup
User avatar
tacolover101
 
Posts: 252
Joined: Mon Apr 10, 2017 11:55 am

Re: Add more Host Groups Nagios

Postby dwhitfield » Wed Sep 06, 2017 11:42 am

Thanks @tacolover101!

You can put all of the hostgroups in the same config file, or you can separate them out. Since you already have a hostgroups.cfg (I'm assuming that's correct), I would just go with that.

Are all of your web servers already set up as hosts? If not, you'll need to do that too.
Be sure to check out our Knowledgebase for helpful articles and solutions!
User avatar
dwhitfield
The Doctor
 
Posts: 3756
Joined: Wed Sep 21, 2016 10:29 am
Location: Nagios Enterprises, LLC

Re: Add more Host Groups Nagios

Postby DiegoAnjos » Wed Sep 06, 2017 1:43 pm

Personally I prefer to have a file per host, so I define the hostgroup in each host file, as below:

Code: Select all
define host{
   use         windows-server
   host_name   SRVXXX
   alias         SRVXXX
   address         192.X.X.X
   icon_image_alt      Intranet Server
   icon_image      www_server.png
   statusmap_image   www_server.gd2
   hostgroups      G03
   parents         SW-XXXXXX
   }


On hostgroups.cfg I define the group:

Code: Select all
define hostgroup{
        hostgroup_name     G03
        alias                      WEB SERVERS
        }



TIP: I name my groups as G1, G2, G3, N1 and so on so Nagios Web Interface will sort them alphabetically.
The ALIAS I set with a friendly name to help myself and others to quickly find hosts/hostgroups.
DiegoAnjos
 
Posts: 47
Joined: Thu Feb 14, 2013 9:32 am

Re: Add more Host Groups Nagios

Postby dwhitfield » Wed Sep 06, 2017 1:48 pm

Thanks @DiegoAnjos! That's exactly what we do in XI by default. I'd quibble with saying you define the hostgroup in the host file. You are setting or associating the hostgroup in the host file. The definition is in hostgroups.cfg per your example. I know what you mean, but I'm just clarifying for people new to nagios.
Be sure to check out our Knowledgebase for helpful articles and solutions!
User avatar
dwhitfield
The Doctor
 
Posts: 3756
Joined: Wed Sep 21, 2016 10:29 am
Location: Nagios Enterprises, LLC

Re: Add more Host Groups Nagios

Postby DiegoAnjos » Wed Sep 06, 2017 2:54 pm

@dwhitfield

Sorry, I am not a native english speaker. Thanks for making my statement more understandable :D
DiegoAnjos
 
Posts: 47
Joined: Thu Feb 14, 2013 9:32 am

Re: Add more Host Groups Nagios

Postby dwhitfield » Wed Sep 06, 2017 3:00 pm

@DiegoAnjos, no problem!

FWIW, I think it's a fine English use of the word define, it's just that define has a very specific meaning in nagios config files. :)

OP, did you have any other questions?
Be sure to check out our Knowledgebase for helpful articles and solutions!
User avatar
dwhitfield
The Doctor
 
Posts: 3756
Joined: Wed Sep 21, 2016 10:29 am
Location: Nagios Enterprises, LLC

Re: Add more Host Groups Nagios

Postby michaelpn » Mon Sep 11, 2017 3:42 am

Hi,

many thanks for your answers. That is exactly what I have done. But if you look at my attachments you will see I only use "houstgroups.cfg" for my citrix- and web servers and nagiso shows that on the interface but what is nagging me is that Nagios shows me WSTEST1 on both host one for citrix-servers and web-servers. Why ?
Attachments
hostgroups nagios.JPG
hostgroup definition.JPG
Michael Pierre
Forenede Gruppeliv
2500 Valby
Copenhagen
michaelpn
 
Posts: 10
Joined: Fri Jul 14, 2017 12:12 am

Re: Add more Host Groups Nagios

Postby scottwilkerson » Mon Sep 11, 2017 9:12 am

Can you show the config for WSTEST1 and any templates that are applied?
User avatar
scottwilkerson
CTO
 
Posts: 7620
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises

Re: Add more Host Groups Nagios

Postby michaelpn » Wed Sep 13, 2017 6:44 am

Hi,
please :)
Attachments
windows.cfg
(7.27 KiB) Downloaded 6 times
templates.cfg
(10.35 KiB) Downloaded 6 times
hostgroups.cfg
(9.85 KiB) Downloaded 5 times
Michael Pierre
Forenede Gruppeliv
2500 Valby
Copenhagen
michaelpn
 
Posts: 10
Joined: Fri Jul 14, 2017 12:12 am

Next

Return to Nagios Core

Who is online

Users browsing this forum: No registered users and 28 guests