Add more Host Groups Nagios
Add more Host Groups Nagios
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
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
Forenede Gruppeliv
2500 Valby
Copenhagen
- tacolover101
- Posts: 432
- Joined: Mon Apr 10, 2017 11:55 am
Re: Add more Host Groups Nagios
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
https://assets.nagios.com/downloads/nag ... #hostgroup
-
- Former Nagios Staff
- Posts: 4583
- Joined: Wed Sep 21, 2016 10:29 am
- Location: NoLo, Minneapolis, MN
- Contact:
Re: Add more Host Groups Nagios
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.
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.
-
- Posts: 49
- Joined: Thu Feb 14, 2013 9:32 am
Re: Add more Host Groups Nagios
Personally I prefer to have a file per host, so I define the hostgroup in each host file, as below:
On hostgroups.cfg I define the group:
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.
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
}
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.
-
- Former Nagios Staff
- Posts: 4583
- Joined: Wed Sep 21, 2016 10:29 am
- Location: NoLo, Minneapolis, MN
- Contact:
Re: Add more Host Groups Nagios
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.
-
- Posts: 49
- Joined: Thu Feb 14, 2013 9:32 am
Re: Add more Host Groups Nagios
@dwhitfield
Sorry, I am not a native english speaker. Thanks for making my statement more understandable
Sorry, I am not a native english speaker. Thanks for making my statement more understandable
-
- Former Nagios Staff
- Posts: 4583
- Joined: Wed Sep 21, 2016 10:29 am
- Location: NoLo, Minneapolis, MN
- Contact:
Re: Add more Host Groups Nagios
@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?
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?
Re: Add more Host Groups Nagios
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 ?
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 ?
Michael Pierre
Forenede Gruppeliv
2500 Valby
Copenhagen
Forenede Gruppeliv
2500 Valby
Copenhagen
-
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: Add more Host Groups Nagios
Can you show the config for WSTEST1 and any templates that are applied?
Re: Add more Host Groups Nagios
Hi,
please
please
- Attachments
-
- windows.cfg
- (7.27 KiB) Downloaded 473 times
-
- templates.cfg
- (10.35 KiB) Downloaded 305 times
-
- hostgroups.cfg
- (9.85 KiB) Downloaded 285 times
Michael Pierre
Forenede Gruppeliv
2500 Valby
Copenhagen
Forenede Gruppeliv
2500 Valby
Copenhagen