Newly defined hosts are not displayed on web Interface

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
caytos
Posts: 7
Joined: Wed Sep 07, 2011 7:38 am

Newly defined hosts are not displayed on web Interface

Post by caytos »

Dear Nagios User,

I'm fighting with an issue for long hours.
I'm using Nagios 3.3.1 installed on an Ubuntu Server (10.04.3 LTS).

I began with Nagios for 2 weeks, please be indulgent.

I was able at the beggining to add printer monitoring, switch, windows server etc...

Then I had trouble with permissions, and tried to change permission on the /usr/local/nagios/var. That's probably the main mistake I made because troubles begun from here...

NOW, I wanted to add our Firewall in the switch.cfg definition file. Here the cfg file:

Code: Select all

###############################################################################
# SWITCH.CFG - SAMPLE CONFIG FILE FOR MONITORING A SWITCH
#
# Last Modified: 10-03-2007
#
# NOTES: This config file assumes that you are using the sample configuration
#	 files that get installed with the Nagios quickstart guide.
#
###############################################################################




###############################################################################
###############################################################################
#
# HOST DEFINITIONS
#
###############################################################################
###############################################################################

# Define the switch that we'll be monitoring

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


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


###############################################################################
###############################################################################
#
# HOST GROUP DEFINITIONS
#
###############################################################################
###############################################################################

# Create a new hostgroup for switches

define hostgroup{
	hostgroup_name	switches		; The name of the hostgroup
	alias		Network Switches	; Long name of the group
	}




###############################################################################
###############################################################################
#
# SERVICE DEFINITIONS
#
###############################################################################
###############################################################################

# Create a service to PING to switch

define service{
	use			generic-service	; Inherit values from a template
	host_name		chmus001,chmufw001	; The name of the host the service is associated with
	service_description	PING		; The service description
	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
	}


# Monitor uptime via SNMP

define service{
	use			generic-service	; Inherit values from a template
	host_name		chmus001
	service_description	Uptime	
	check_command		check_snmp!-C codex_snmp -o sysUpTime.0
	}



# Monitor Port 8 status via SNMP

define service{
	use			generic-service	; Inherit values from a template
	host_name		chmus001
	service_description	Port 8 Link Status
	check_command		check_snmp!-C codex_snmp -o ifOperStatus.8 -r 1 -m RFC1213-MIB
	}



# Monitor bandwidth via MRTG logs

#define service{
#	use			generic-service	; Inherit values from a template
#	host_name		hostname
#	service_description	Port 1 Bandwidth Usage
#	check_command		check_local_mrtgtraf!/var/lib/mrtg/192.168.1.253_1.log!AVG!1000000,1000000!5000000,5000000!10
#	}

(I voluntary changed the IP Number in x.x.x.x)

Then I checked the Nagios config , no error/warning and I restarted it. But my Firewall doesen't appear on the Web Interface.

Where am I doing a mystake ? How to correct this...
When I make change on an existing windows server or on the only switch I monitore for the moment, no problem on the web interface, my changes appear...

Many thanks in advance for your help.

Kind regards,
Last edited by caytos on Fri Sep 16, 2011 2:56 am, edited 1 time in total.
mguthrie
Posts: 4380
Joined: Mon Jun 14, 2010 10:21 am

Re: Newly defined hosts are not displayed on web Interface

Post by mguthrie »

Make sure the new config files are included in the main nagios.cfg file. You can either include the file individually or the directory in which it's located.
caytos
Posts: 7
Joined: Wed Sep 07, 2011 7:38 am

Re: Newly defined hosts are not displayed on web Interface

Post by caytos »

Hello,

Many thanks for your reply.

Yes, the switch.cfg is included in the nagios.cfg as I can allready monitore a Core Switch and this one appears on the web Interface.
I tried to comment all the .cfg file in the main nagios.cfg and just declare the objects directory. The problem stays the same.

Can you (or somebody else of course) give me the rights to be assigned in the /usr/local/nagios, /usr/local/nagios/var and in the /usr/local/nagios/share.
I think that the problem resides here ...

Many thanks in advance.
broonu
Posts: 3
Joined: Thu Sep 08, 2011 7:17 am

Re: Newly defined hosts are not displayed on web Interface

Post by broonu »

Can you see the object in the configuration section of web interface?

http://yournagiosserver/nagios/cgi-bin/config.cgi
caytos
Posts: 7
Joined: Wed Sep 07, 2011 7:38 am

Re: Newly defined hosts are not displayed on web Interface

Post by caytos »

Yes I can.
But I don't see the newly created host/switch...
mguthrie
Posts: 4380
Joined: Mon Jun 14, 2010 10:21 am

Re: Newly defined hosts are not displayed on web Interface

Post by mguthrie »

Can you verify that the nagios has read permission to the config file?
caytos
Posts: 7
Joined: Wed Sep 07, 2011 7:38 am

Re: Newly defined hosts are not displayed on web Interface

Post by caytos »

Hi,

Code: Select all

root@srvbamon01:/usr/local/nagios/etc# ls -l
total 68
-rw-rw-r-- 1 nagios nagios 11408 2011-07-19 14:10 cgi.cfg
-rw-r--r-- 1 nagios nagios    26 2011-09-08 15:38 htpasswd.users
-rw-rw-r-- 1 nagios nagios 43771 2011-09-08 15:25 nagios.cfg
drwxrwxr-x 2 nagios nagios  4096 2011-09-08 15:27 objects
-rw-rw---- 1 nagios nagios  1340 2011-07-19 14:10 resource.cfg
root@srvbamon01:/usr/local/nagios/etc#
root@srvbamon01:/usr/local/nagios/etc/objects# ls -l
total 60
-rw-rw-r-- 1 nagios nagios  7724 2011-07-19 14:10 commands.cfg
-rw-rw-r-- 1 nagios nagios  2166 2011-07-19 14:28 contacts.cfg
-rw-rw-r-- 1 nagios nagios  5403 2011-07-19 14:10 localhost.cfg
-rw-rw-r-- 1 nagios nagios  4171 2011-07-26 13:48 printer.cfg
-rw-rw-r-- 1 nagios nagios  3612 2011-09-07 14:28 switch.cfg
-rw-rw-r-- 1 nagios nagios 10812 2011-07-19 14:10 templates.cfg
-rw-rw-r-- 1 nagios nagios  3209 2011-07-19 14:10 timeperiods.cfg
-rw-rw-r-- 1 nagios nagios  8681 2011-09-08 15:27 windows.cfg
Do you think it's good ?
I thought that I should have nagios nagioscmd in the result, but there is just nagios nagios....
caytos
Posts: 7
Joined: Wed Sep 07, 2011 7:38 am

Re: Newly defined hosts are not displayed on web Interface

Post by caytos »

Hello,

You can close this topic.
I didn't find a solution but reinstalled the server.

Now I make snapshot before main changes ;)

Thanks for your help !

++
marcoolio35
Posts: 1
Joined: Sat Sep 17, 2011 1:33 am

Re: Newly defined hosts are not displayed on web Interface

Post by marcoolio35 »

i am new to this and need help
Locked