Voila mon souci:
J'ai installe nagios-3.2.0 et dans /usr/local/nagios/etc/objects j'ai les fichiers suivants:
commands.cfg printer.cfg templates.cfg windows.cfg localhost.cfg switch.cfg contacts.cfg timeperiods.cfg.
J'ai configure switch.cfg et en lançant la commande: /usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg
ça me donne:
Nagios 3.0.2
Copyright (c) 1999-2008 Ethan Galstad (http://www.nagios.org)
Last Modified: 05-19-2008
License: GPL
Reading configuration data...
Running pre-flight check on configuration data...
Checking services...
Checked 31 services.
Checking hosts...
Checked 5 hosts.
Checking host groups...
Checked 5 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 24 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
Lorsque je me connecte a l'interface web de nagios, je n'ai que le group linux-server qui fonctionne.
Le groupe switches ca met:
0 Matching Service Entries Displayed
Je ne comprends pas comment les host sont bien configurer ainsi que les services mais je ne parviens pas a voir les statuts sous nagios seul localhost qui vient par defaut qui fonctionne.
voici mon fichier switch.cfg:
###############################################################################
# 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 linksys-srw224p ; The name we're giving to this switch
alias Linksys SRW224P Switch ; A longer name associated with the switch
address 192.168.1.253 ; 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 Routeur-DGSI ; The name we're giving to this switch
alias Cisco catalyst ; A longer name associated with the switch
address 172.17.0.1 ; IP address of the switch
hostgroups rdgsi
}
###############################################################################
###############################################################################
#
# 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
}
define hostgroup{
hostgroup_name rdgsi ; The name of the hostgroup
alias DGSI Router ; 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 linksys-srw224p,Routeur-DGSI ; 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 linksys-srw224p,Routeur-DGSI
service_description Uptime
check_command check_snmp!-C public -o sysUpTime.0
}
# Monitor Port 1 status via SNMP
define service{
use generic-service ; Inherit values from a template
host_name linksys-srw224p,Routeur-DGSI
service_description Port 1 Link Status
check_command check_snmp!-C public -o ifOperStatus.1 -r 1 -m RFC1213-MIB
}
# Monitor bandwidth via MRTG logs
define service{
use generic-service ; Inherit values from a template
host_name linksys-srw224p
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
}
# Monitor bandwidth via MRTG logs
define service{
use generic-service ; Inherit values from a template
host_name Routeur-DGSI
service_description Port 1 Bandwidth Usage
check_command check_local_mrtgtraf!/var/lib/mrtg/172.17.0.1_1.log!AVG!1000000,1000000!5000000,5000000!10
}