Nagios3 configuration help needed

Dear experts,

I am trying to get Nagios3 working from scratch.

I have one client machine like this:
in
/etc/nagios$ ls
nrpe.cfg  nrpe.d  nrpe_local.cfg

this config file nrpe.cfg has the address of the server  

# ALLOWED HOST ADDRESSES
# This is an optional comma-delimited list of IP address or hostnames
# that are allowed to talk to the NRPE daemon. Network addresses with a bit mask
# (i.e. 192.168.1.0/24) are also supported. Hostname wildcards are not currently
# supported.
#
# Note: The daemon only does rudimentary checking of the client's IP
# address.  I would highly recommend adding entries in your /etc/hosts.allow
# file to allow only the specified host to connect to the port
# you are running this daemon on.
#
# NOTE: This option is ignored if NRPE is running under either inetd or xinetd

allowed_hosts=127.0.0.1, server IP address

The server address is commented out. Do I need to do something here?

# SERVER ADDRESS
# Address that nrpe should bind to in case there are more than one interface
# and you do not want nrpe to bind on all interfaces.
# NOTE: This option is ignored if NRPE is running under either inetd or xinetd

#server_address=127.0.0.1



nagios 3 SERVER

In the Server when I enter the server name in the config file hostgroups_nagios2.cfg. It did not like it all. I think I need to work with more config files to enter the client name in the server.

sudo /etc/init.d/nagios3 reload

Reading configuration data...
   Read main config file okay...
Processing object config file '/etc/nagios3/commands.cfg'...
Processing object config directory '/etc/nagios-plugins/config'...
Processing object config file '/etc/nagios-plugins/config/disk.cfg'...
Processing object config file '/etc/nagios-plugins/config/mysql.cfg'...
Processing object config file '/etc/nagios-plugins/config/news.cfg'...
Processing object config file '/etc/nagios-plugins/config/dns.cfg'...
Processing object config file '/etc/nagios-plugins/config/disk-smb.cfg'...
Processing object config file '/etc/nagios-plugins/config/http.cfg'...
Processing object config file '/etc/nagios-plugins/config/dummy.cfg'...
Processing object config file '/etc/nagios-plugins/config/netware.cfg'...
Processing object config file '/etc/nagios-plugins/config/dhcp.cfg'...
Processing object config file '/etc/nagios-plugins/config/mail.cfg'...
Processing object config file '/etc/nagios-plugins/config/pgsql.cfg'...
Processing object config file '/etc/nagios-plugins/config/nt.cfg'...
Processing object config file '/etc/nagios-plugins/config/real.cfg'...
Processing object config file '/etc/nagios-plugins/config/ping.cfg'...
Processing object config file '/etc/nagios-plugins/config/snmp.cfg'...
Processing object config file '/etc/nagios-plugins/config/hppjd.cfg'...
Processing object config file '/etc/nagios-plugins/config/mailq.cfg'...
Processing object config file '/etc/nagios-plugins/config/apt.cfg'...
Processing object config file '/etc/nagios-plugins/config/procs.cfg'...
Processing object config file '/etc/nagios-plugins/config/flexlm.cfg'...
Processing object config file '/etc/nagios-plugins/config/tcp_udp.cfg'...
Processing object config file '/etc/nagios-plugins/config/fping.cfg'...
Processing object config file '/etc/nagios-plugins/config/rpc-nfs.cfg'...
Processing object config file '/etc/nagios-plugins/config/mrtg.cfg'...
Processing object config file '/etc/nagios-plugins/config/breeze.cfg'...
Processing object config file '/etc/nagios-plugins/config/ldap.cfg'...
Processing object config file '/etc/nagios-plugins/config/users.cfg'...
Processing object config file '/etc/nagios-plugins/config/radius.cfg'...
Processing object config file '/etc/nagios-plugins/config/load.cfg'...
Processing object config file '/etc/nagios-plugins/config/ntp.cfg'...
Processing object config file '/etc/nagios-plugins/config/ssh.cfg'...
Processing object config file '/etc/nagios-plugins/config/ftp.cfg'...
Processing object config file '/etc/nagios-plugins/config/games.cfg'...
Processing object config file '/etc/nagios-plugins/config/telnet.cfg'...
Processing object config file '/etc/nagios-plugins/config/ifstatus.cfg'...
Processing object config directory '/etc/nagios3/conf.d'...
Processing object config file '/etc/nagios3/conf.d/extinfo_nagios2.cfg'...
Processing object config file '/etc/nagios3/conf.d/generic-service_nagios2.cfg'...
Processing object config file '/etc/nagios3/conf.d/generic-host_nagios2.cfg'...
Processing object config file '/etc/nagios3/conf.d/hostgroups_nagios2.cfg'...
Processing object config file '/etc/nagios3/conf.d/localhost_nagios2.cfg'...
Processing object config file '/etc/nagios3/conf.d/timeperiods_nagios2.cfg'...
Processing object config file '/etc/nagios3/conf.d/contacts_nagios2.cfg'...
Processing object config file '/etc/nagios3/conf.d/services_nagios2.cfg'...

Error: Could not find any host matching 'blah blah' (config file '/etc/nagios3/conf.d/hostgroups_nagios2.cfg', starting on line 18)
Error: Could not expand members specified in hostgroup (config file '/etc/nagios3/conf.d/hostgroups_nagios2.cfg', starting on line 18)


***> 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.
marceloNYCMiddle-Tier AdministratorAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Steven CarnahanNetwork ManagerCommented:
I run the windows version so my files a little different.

Basically you have to define the host and assign it to a host group and then define the services to monitor.

Here are the parts:

define host{
	use		generic-switch	; Inherit default values from a template
	host_name	2960-4	; The name we're giving to this switch
	alias		2960-4	; A longer name associated with the switch
	address		x.x.x.x	; IP address of the switch
	hostgroups	BR01		; Host groups this switch is associated with
	}

Open in new window


define hostgroup{
	hostgroup_name	BR01		; The name of the hostgroup
	alias			; Long name of the group
	}

Open in new window


define service{
	use			generic-service	; Inherit values from a template
	host_name		2960-4	; The name of the host the service is associated with
	service_description	PING		; The service description
	contact_groups          NWservices
	check_command		check_ping!200.0,20%!600.0,60%	; The command used to monitor the service
	normal_check_interval	5		; Check the service every 5 minutes under normal conditions
	retry_check_interval	1		; Re-check the service every minute until its final/hard state is determined
	}

Open in new window


Based on the error I would say that part 2 above belongs in your hostgroups_nagios2.cfg file

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Seth SimmonsSr. Systems AdministratorCommented:
The server address is commented out. Do I need to do something here?

read the comments right before it
if you have mutiple interfaces, specify the address for the service to bind to
if you have only one interface, leave it comment out; no need to use it

Could not find any host matching 'blah blah'

that tells me you have a hostgroup defined with a list of hosts but one of them isn't configured anywhere
in other words, you have a hostgroup with members Server1,Server2,Server3 but nowhere is Server2 defined; you need to create the host definition for Server2

Based on the error I would say that part 2 above...

i would say part 1 is missing.  part 2 defining the hostgroups has a server listed that isn't defined
part 1 (define host) is missing for that host

either that or there is a typo.  you need to look at line 18 and make sure that all the hosts are defined and they are spelled correctly there and in the host definition.
Steven CarnahanNetwork ManagerCommented:
Seth,

I agree that part 1 is possibly missing:
when I enter the server name in the config file hostgroups_nagios2.cfg
The server name doesn't belong in part 2. The hostgroup name belongs in part 1.
Determine the Perfect Price for Your IT Services

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden with our free interactive tool and use it to determine the right price for your IT services. Download your free eBook now!

marceloNYCMiddle-Tier AdministratorAuthor Commented:
Hello,

Am I missing a hosts.cfg  file here. This is all I have in the conf.d folder:

/etc/nagios3/conf.d$ ls
contacts_nagios2.cfg  generic-host_nagios2.cfg     hostgroups_nagios2.cfg  services_nagios2.cfg
extinfo_nagios2.cfg   generic-service_nagios2.cfg  localhost_nagios2.cfg   timeperiods_nagios2.cfg
marceloNYCMiddle-Tier AdministratorAuthor Commented:
I added the hosts.cfg and it worked

Thank you so much
Steven CarnahanNetwork ManagerCommented:
Glad that worked for you.  In windows (at least my copy) all three parts are combined in one file.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Linux

From novice to tech pro — start learning today.