I have some problem with nagios adding remote host in my localhost.cfg(/etc/nagios/objects/localhost.cfg) file
I installed nagios & nrpe properly i checked nagios configuration file it is working well. But i cann't able to add multiple hosts please guide me.
I followed these setps.
I installed nagios,nagios-plugins,nrpe,xinetd & openssl-devel
#yum install nagios nagios-plugins* nrpe xinted openssl-devel -y
I have edited /etc/nagios/objects/localhost.cfg file in that i have changed
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 192.168.0.28
}
i checked the configuration file
#nagios -v /etc/nagios/nagios.cfg
i got below output
##################
Nagios Core 3.2.3
Copyright (c) 2009-2010 Nagios Core Development Team and Community Contributors
Copyright (c) 1999-2009 Ethan Galstad
Last Modified: 10-03-2010
License: GPL
Website:
http://www.nagios.org
Reading configuration data...
Read main config file okay...
Processing object config file '/etc/nagios/objects/commands.cfg'...
Processing object config file '/etc/nagios/objects/contacts.cfg'...
Processing object config file '/etc/nagios/objects/timeperiods.cfg'...
Processing object config file '/etc/nagios/objects/templates.cfg'...
Processing object config file '/etc/nagios/objects/localhost.cfg'...
Read object config files okay...
Running pre-flight check on configuration data...
Checking services...
Checked 8 services.
Checking hosts...
Checked 1 hosts.
Checking host groups...
Checked 1 host groups.
Checking service groups...
Checked 0 service groups.
Checking contacts...
Checked 1 contacts.
Checking contact groups...
Checked 1 contact groups.
Checking service escalations...
Checked 0 service escalations.
Checking service dependencies...
Checked 0 service dependencies.
Checking host escalations...
Checked 0 host escalations.
Checking host dependencies...
Checked 0 host dependencies.
Checking commands...
Checked 25 commands.
Checking time periods...
Checked 5 time periods.
Checking for circular paths between hosts...
Checking for circular host and service dependencies...
Checking global event handlers...
Checking obsessive compulsive processor commands...
Checking misc settings...
Total Warnings: 0
Total Errors: 0
Things look okay - No serious problems were detected during the pre-flight check
#################
after that i have checked the nrpe
#/usr/local/nagios/libexec/check_nrpe -H <server ip>
#/usr/local/nagios/libexec/check_nrpe -H <remote host ip>
I got NRPE v2.12 this output
In remote host i have installed nrpe through yum
#yum install nrpe
#vi /etc/nagios/nrpe.cfg file
i have edited allow_hosts=<nagios serverip>
# nrpe -c /etc/nagios/nrpe.cfg -d
above the command excuted well because i didn't get any error
if it is only one remote host it is working very well if i have added multiple hosts in loacalhost.cfg file i am getting below error
i have excuted below command
#nagios -v /etc/nagios/nagios.cfg
###################################
Nagios Core 3.2.3
Copyright (c) 2009-2010 Nagios Core Development Team and Community Contributors
Copyright (c) 1999-2009 Ethan Galstad
Last Modified: 10-03-2010
License: GPL
Website:
http://www.nagios.org
Reading configuration data...
Read main config file okay...
Processing object config file '/etc/nagios/objects/commands.cfg'...
Processing object config file '/etc/nagios/objects/contacts.cfg'...
Processing object config file '/etc/nagios/objects/timeperiods.cfg'...
Processing object config file '/etc/nagios/objects/templates.cfg'...
Processing object config file '/etc/nagios/objects/localhost.cfg'...
Warning: Duplicate definition found for host 'localhost' (config file '/etc/nagios/objects/localhost.cfg', starting on line 34)
Error: Could not add object property in file '/etc/nagios/objects/localhost.cfg' on line 38.
Error processing object config files!
***> 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.
###############################
i got above output.
please any one can help me how to add multiple remote hosts in my nagios server.
Thanks in advanced..........