LeaderN1
4Messages postés
14 mai 2009Date d'inscription
15 mai 2009 à 11:08
merci pour votre réponse
voilà le fichier contenant les swirch et les routers,:
###############################################################################
# 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 Switch-CISCO ; The name we're giving to this switch
alias Cisco Switch ; A longer name associated with the switch
address 192.168.170.1 ; IP address of the switch
hostgroups switches ; Host groups this switch is associated with
}
define host{
use generic-switch
host_name Switch-CISCO2
alias cisco switch 2
address 192.168.170.245
hostgroups switches
}
define host{
use generic-switch
host_name routeur-CISCO
alias routeur cisco xx
address 192.168.10.12
hostgroups routers
}
define host{
use generic-router <------
host_name routeur-cisco
alias Router
address 55.55.55.55
hostgroups routers
}
###############################################################################
###############################################################################
#
# 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 routers ; The name of the hostgroup
alias Network routers ; 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 Switch-CISCO,Switch-CISCO2 ; 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 15 ; 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
}
define service{
use generic-service ; Inherit values from a template
host_name Switch-CISCO,Switch-CISCO2
service_description Uptime
check_command check_snmp!-C public -o sysUpTime.0
}
define service{
use generic-service ; Inherit values from a template
host_name Switch-CISCO,Switch-CISCO2
service_description Port 1 Link Status
check_command check_snmp!-C public -o ifOperStatus.2 -r 1 -m RFC1213-MIB
}
define service{
use generic-service ; Inherit values from a template
host_name Switch-CISCO2
service_description Description General
check_command check_snmp!-C public -o system.sysDescr.0
}
define service{
use generic-service ; Inherit values from a template
host_name Switch-CISCO2
service_description Description General sur le port 1
check_command check_cisco!-C public -i 0/1
}
#######################################################################
quand j'ajoute le router ayant @IP: 55.55.55.55 le redemarage de nagios affiche:
[root@192 ~]# /etc/init.d/nagios restart
Running configuration check... CONFIG ERROR! Restart aborted. Check your Nagios configuration.