Nagios3 switch.cfg
tnelsonp at comcast.net
tnelsonp at comcast.net
Thu May 16 02:20:14 CEST 2013
Is it possible that the name 'cisco2811' has already defined as a host_name?
Below is a copy of a vanilla switch.cfg file I pulled from one on my machines. It may help as you build out the configuration.
nelson
----- Original Message -----
From: "Joel Roberts" <Joel.Roberts at pinkardcc.com>
To: nagios-users at lists.sourceforge.net
Sent: Wednesday, May 15, 2013 4:24:29 PM
Subject: [Nagios-users] Nagios3 switch.cfg
I’m deploying a new Nagios server on Debian Linux 6. Have installed the Nagios3 packages, am able to log into the web interface. I’m trying to monitor our network switches and routers, the nagios3.cfg file points to /etc/nagios3/objects/switch.cfg. That folder doesn’t exist, the .cfg files are all under /etc/nagios3/conf.d/, but there is no switch.cfg file. So I’ve created one from scratch, just trying to get the first switch in, but when I try to verify the config files I get the following error:
Error: Could not add property in file ‘/etc/nagios3/conf.d/switch_nagios2.cfg on line 3. Error processing object config files.
I’ve created the file from scratch, but pretty basic stuff, line 3 is just the host_name entry:
Define host{
use generic-host
host-name cisco2811
alias Cisco 2811 Router
address xxx.xxx.xxx.xxx
hostgroups allhosts,network-switches
}
The documentation I’ve found still lists host-name as a valid entry, not sure what’s going on, any help would be appreciated.
Thanks in advance,
Joel
------------------------------------------------------------------------------
AlienVault Unified Security Management (USM) platform delivers complete
security visibility with the essential security capabilities. Easily and
efficiently configure, manage, and operate all of your security controls
from a single console and one unified framework. Download a free trial.
http://p.sf.net/sfu/alienvault_d2d
_______________________________________________
Nagios-users mailing list
Nagios-users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue.
::: Messages without supporting info will risk being sent to /dev/null
---------------------------------------------------------------------------------------------------------------------------------
Sample 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
}
###############################################################################
###############################################################################
#
# 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 linksys-srw224p ; 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
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
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
}
###############################################################################
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.monitoring-lists.org/archive/users/attachments/20130516/63e72f07/attachment.html>
-------------- next part --------------
------------------------------------------------------------------------------
AlienVault Unified Security Management (USM) platform delivers complete
security visibility with the essential security capabilities. Easily and
efficiently configure, manage, and operate all of your security controls
from a single console and one unified framework. Download a free trial.
http://p.sf.net/sfu/alienvault_d2d
-------------- next part --------------
_______________________________________________
Nagios-users mailing list
Nagios-users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue.
::: Messages without supporting info will risk being sent to /dev/null
More information about the Users
mailing list