Page 1 of 1

Newly defined hosts are not displayed on web Interface

Posted: Wed Sep 07, 2011 10:00 am
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,

Re: Newly defined hosts are not displayed on web Interface

Posted: Wed Sep 07, 2011 4:55 pm
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.

Re: Newly defined hosts are not displayed on web Interface

Posted: Thu Sep 08, 2011 1:11 am
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.

Re: Newly defined hosts are not displayed on web Interface

Posted: Thu Sep 08, 2011 10:31 am
by broonu
Can you see the object in the configuration section of web interface?

http://yournagiosserver/nagios/cgi-bin/config.cgi

Re: Newly defined hosts are not displayed on web Interface

Posted: Thu Sep 08, 2011 2:40 pm
by caytos
Yes I can.
But I don't see the newly created host/switch...

Re: Newly defined hosts are not displayed on web Interface

Posted: Thu Sep 08, 2011 5:01 pm
by mguthrie
Can you verify that the nagios has read permission to the config file?

Re: Newly defined hosts are not displayed on web Interface

Posted: Fri Sep 09, 2011 4:52 am
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....

Re: Newly defined hosts are not displayed on web Interface

Posted: Fri Sep 16, 2011 2:55 am
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 !

++

Re: Newly defined hosts are not displayed on web Interface

Posted: Sat Sep 17, 2011 1:34 am
by marcoolio35
i am new to this and need help