Page 1 of 1

hostgroup.cfg at nagios-core 4.0.4

Posted: Tue Sep 20, 2016 11:15 am
by katya
Hi,

i found that hostgroup.cfg can help me and to create groups for me. (BTW im using nagios-core 4.0.4 on redhat machine)

but from some reson i can't find this file under /usr/local/nagios/etc
bash-4.1# pwd
/usr/local/nagios/etc
-bash-4.1# ls -la
total 236
drwxrwxr-x. 3 nagios nagios 4096 Sep 20 11:15 .
drwxr-xr-x. 9 nagios nagios 4096 May 21 2015 ..
-rw-rw-r-- 1 nagios nagios 12012 Sep 20 10:56 cgi.cfg
-rw-rw-r--. 1 nagios nagios 12015 Oct 23 2014 cgi.cfg~
-rw-r--r-- 1 root root 44782 Sep 20 11:14 hostgroup.cfg
-rw-r--r-- 1 nagios nagios 2008 Sep 20 11:01 hosts.cfg
-rw-r--r--. 1 nagios nagios 26 Dec 1 2014 htpasswd.users
-rw-rw-r-- 1 nagios nagios 44782 Sep 7 10:58 nagios.cfg
-rw-rw-r--. 1 nagios nagios 44474 Nov 30 2014 nagios.cfg~
-rw-r--r-- 1 nagios nagios 9853 Sep 7 11:02 nrpe.cfg
-rw-r--r-- 1 root root 9862 Sep 7 11:00 nrpe.cfg.bck07092016
-rw-r--r-- 1 nagios nagios 1850 Dec 29 2014 nrpe_ssbtech02.cfg
drwxrwxr-x. 2 nagios nagios 4096 Sep 20 10:50 objects
-rw-rw---- 1 nagios nagios 1312 Dec 1 2014 resource.cfg
-rwxrwxrwx. 1 nagios nagios 1312 Oct 23 2014 resource.cfg~
-rw-r--r-- 1 nagios nagios 15945 Sep 6 06:25 services.cfg
-rw-r--r-- 1 nagios nagios 5473 Jul 23 2015 services.cfg.bck

where i can find this? under object i also dont have it

Re: hostgroup.cfg at nagios-core 4.0.4

Posted: Tue Sep 20, 2016 11:33 am
by katya
Hi,
any updates? as we work in europe time :)

Re: hostgroup.cfg at nagios-core 4.0.4

Posted: Tue Sep 20, 2016 1:37 pm
by rkennedy
katya wrote:Hi,
any updates? as we work in europe time :)
Please do not bump threads, especially after only 18 minutes. You will just push yourself to the bottom of our queue.

There is a hostgroup.cfg file in the directory you specified already.

Code: Select all

-rw-r--r-- 1 root root 44782 Sep 20 11:14 hostgroup.cfg
Please look at this file for information on setting up a hostgroup -
https://assets.nagios.com/downloads/nag ... #hostgroup

It may be in your /usr/local/nagios/etc/objects/ folder as well which I see you have.

Re: hostgroup.cfg at nagios-core 4.0.4

Posted: Tue Sep 20, 2016 2:10 pm
by katya
Hi,

no i dont have.

what you see is what i have created by myself--> it is not correct.

also under objects i dont have it.

-rw-r--r-- 1 root root 1280 Dec 30 2014 ~
drwxrwxr-x. 2 nagios nagios 4096 Sep 20 10:50 .
drwxrwxr-x. 3 nagios nagios 4096 Sep 20 15:08 ..
-rw-rw-r-- 1 nagios nagios 8766 Jan 27 2016 commands.cfg
-rw-rw-r--. 1 nagios nagios 7794 Nov 27 2014 commands.cfg~
-rw------- 1 nagios nagios 0 Nov 27 2014 commands.cfg.save
-rw------- 1 nagios nagios 7734 Nov 27 2014 commands.cfg.save.1
-rw-rw-r-- 1 nagios nagios 2550 Jan 7 2016 contacts.cfg
-rw-rw-r--. 1 nagios nagios 2138 Oct 23 2014 contacts.cfg~
-rw-rw-r-- 1 nagios nagios 5236 Jan 12 2016 localhost.cfg
-rw-rw-r--. 1 nagios nagios 5701 Jan 12 2015 localhost.cfg~
-rw-r--r-- 1 nagios nagios 180 Jul 28 2015 mint04.cfg
-rw-rw-r-- 1 nagios nagios 3096 Dec 1 2014 printer.cfg
-rw-rw-r--. 1 nagios nagios 3096 Oct 23 2014 printer.cfg~
-rw-r--r-- 1 nagios nagios 186 Jan 24 2016 ssbpech03.cfg
-rw-r--r-- 1 nagios nagios 183 Mar 4 2015 ssbtech01.cfg
-rw-r--r-- 1 nagios app 183 Jan 12 2015 ssbtech02.cfg
-rw-r--r-- 1 root root 5256 Jan 12 2015 ssbtech02.cfg_old
-rw-r--r-- 1 nagios nagios 5234 Sep 20 10:44 ssbtech03.cfg
-rw-r--r-- 1 nagios nagios 182 Mar 4 2015 ssbtmutu.cfg
-rw-rw-r-- 1 nagios nagios 3265 Dec 1 2014 switch.cfg
-rw-rw-r--. 1 nagios nagios 3265 Oct 23 2014 switch.cfg~
-rw-rw-r-- 1 nagios nagios 10621 Dec 1 2014 templates.cfg
-rw-rw-r--. 1 nagios nagios 10621 Oct 23 2014 templates.cfg~
-rw-rw-r-- 1 nagios nagios 3751 Jan 30 2015 timeperiods.cfg
-rw-rw-r--. 1 nagios nagios 3180 Oct 23 2014 timeperiods.cfg~
-rw-rw-r-- 1 nagios nagios 3991 Dec 2 2014 windows.cfg
-rw-rw-r--. 1 nagios nagios 3991 Oct 23 2014 windows.cfg~
-bash-4.1# pwd
/usr/local/nagios/etc/objects
-bash-4.1#

As you see i dont have this file, maybe i removed him by mistake.

The question is how can i created hostgroup.cfg again?

Re: hostgroup.cfg at nagios-core 4.0.4

Posted: Tue Sep 20, 2016 2:43 pm
by rkennedy
You can create hostgroup.cfg your own by using vi, vim, or nano. Then just enter the definition you want to apply as stated in the documentation page I linked you -

Code: Select all

define hostgroup{
	hostgroup_name		novell-servers
	alias			Novell Servers
	members			netware1,netware2,netware3,netware4
	}

Re: hostgroup.cfg at nagios-core 4.0.4

Posted: Wed Sep 21, 2016 7:34 am
by katya
Hi,

Basically what I want to add is that on dashboard under current status  Host groups I will be able to see all my servers grouped the same as I see localhost (please see the attached screenshot )

So I have few quires about this:

1) Why I see only local host?
2) On which file I need to configure to see it in dashboard  current status  Host groups ?

Re: hostgroup.cfg at nagios-core 4.0.4

Posted: Wed Sep 21, 2016 9:47 am
by rkennedy
You need to modify the file that contains the hostgroup to add other members. This depends how you setup your directory structure. Assuming it's standard, what is the output of the following?

Code: Select all

grep -R 'define hostgroup' /usr/local/nagios/etc/ -A 10