Group definition


#1

Hello

I have the following definition in the hosts.cfg:

more hosts.cfg
define host{
host_name msuntec7
alias MSUNTEC7
address 192.168.2.199
}

define hostgroup {
hostgroup_name windows-servers
alias Windows Servers
members msuntec7
}

I don’t see the host group in the Nagios web interface!!

Why??

Thanks

Didier


#2
  1. Did you click the “Hostgroups” link?
  2. Did you restart Nagios after adding the hostgroup?
  3. Does the hostgroup member exist?
  4. Did you get any errors if/when you restarted Nagios?

**Not meant to be smartass questions. Top-down logic solves 99% of problems :wink:


#3

no error when I restart nagios:

/etc/init.d/nagios3 restart
Restarting nagios3 monitoring daemon: nagios3
.

I have created the hostgroup member in the hosts.cfg file (as the hosts group) but I don’t see the member neither the hosts group!!


#4

It looks like you may be missing some required info seeing as how your XP host isn’t attached to a template. Add this into your host definition and see if it make the host appear.

more hosts.cfg
define host{
use windows-server(you could also try generic-host in place of windows-server)
host_name msuntec7
alias MSUNTEC7
address 192.168.2.199
}


#5

with :

define host{
use windows-server
host_name msuntec7
alias MSUNTEC7
address 192.168.2.199
}

define hostgroup {
hostgroup_name windows-servers
alias Windows Servers
members msuntec7
}

I don’t see my member and my hosts group


#6

Hmmm. Luca may have to handle this one. I’m not sure off hand why it wouldn’t be showing up.


#7

I would like to be sure that Nagios use the right configuration files

My configuration files are under :/usr/local/nagios/etc/objects

In the localhost file, I see:

define host{
use linux-server ; Name of host template to use
; This host definition will inherit all variables that are defined
; in (or inherited by) the linux-server host template definition.
host_name localhost
alias localhost
address 127.0.0.1
}

define hostgroup{
hostgroup_name linux-servers ; The name of the hostgroup
alias Linux Servers ; Long name of the group
members localhost ; Comma separated list of hosts that belong to this group
}

But in the Web Nagios Interface, I don’t see the hots group linux-servers.

I see:

All Servers (all)
Debian GNU/Linux Servers (debian-servers)
HTTP servers (http-servers)
Pingable servers (ping-servers)
SSH servers (ssh-servers)

where are defined these groups??

Thanks

Didier


#8

I have found /etc/nagios3/conf.d/

so I have copie the configuration files from /usr/local/nagios/etc/objects to /etc/nagios3/conf.d/

but now I have this type of message:

/etc/init.d/nagios3 restart
Restarting nagios3 monitoring daemon: nagios3

Nagios 3.0.6
Copyright © 1999-2008 Ethan Galstad (nagios.org)
Last Modified: 12-01-2008
License: GPL

Reading configuration data…

Warning: Duplicate definition found for timeperiod ‘24x7’ (config file ‘/etc/nagios3/conf.d/timeperiods.cfg’, starting on line 28)
Error: Could not add object property in file ‘/etc/nagios3/conf.d/timeperiods.cfg’ on line 29.

***> 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.

errors in config! failed!
failed!

Any ideas???


#9

Go to the /etc/nagios3/conf.d/timeperiods.cfg file and remove the duplicate definition.

Did you install from the repositories or did you install from a .tar file?


#10

strange!

I have the same type of error with all the configuration files

I don’t have modified files like timeperiods.cfg or command.cfg !!

I have installed NAGIOS on my debian server with apt-get. So it should be a standard installation.


#11

I always install from .tar file. Much easier to administer. This may sound a bit extreme but it seems like your install is fairly new, so it may be worth reinstalling via .tar


#12

None of the RPM installations is standard, tehre isn’t even a standard. What is considered as a “standard” install is from source into /usr/local/nagios.

is your hosts.cfg files listed in the resource file sin nagios.cfg?