<html><head><style type='text/css'>p { margin: 0; }</style></head><body><div style='font-family: Arial; font-size: 10pt; color: #000000'>Is it possible that the name 'cisco2811' has already defined as a host_name? <br><br>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. <br><br>nelson<br><hr id="zwchr"><b>From: </b>"Joel Roberts" <Joel.Roberts@pinkardcc.com><br><b>To: </b>nagios-users@lists.sourceforge.net<br><b>Sent: </b>Wednesday, May 15, 2013 4:24:29 PM<br><b>Subject: </b>[Nagios-users] Nagios3 switch.cfg<br><br>
<style><!--
/* Font Definitions */
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:Tahoma;
panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
p.MsoAcetate, li.MsoAcetate, div.MsoAcetate
{mso-style-priority:99;
mso-style-link:"Balloon Text Char";
margin:0in;
margin-bottom:.0001pt;
font-size:8.0pt;
font-family:"Tahoma","sans-serif";}
span.EmailStyle17
{mso-style-type:personal-compose;
font-family:"Calibri","sans-serif";
color:windowtext;}
span.BalloonTextChar
{mso-style-name:"Balloon Text Char";
mso-style-priority:99;
mso-style-link:"Balloon Text";
font-family:"Tahoma","sans-serif";}
.MsoChpDefault
{mso-style-type:export-only;
font-family:"Calibri","sans-serif";}
@page WordSection1
{size:8.5in 11.0in;
margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
<div class="WordSection1">
<p class="MsoNormal">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:</p>
<p class="MsoNormal"> </p>
<p class="MsoNormal">Error: Could not add property in file ‘/etc/nagios3/conf.d/switch_nagios2.cfg on line 3. Error processing object config files.</p>
<p class="MsoNormal"> </p>
<p class="MsoNormal">I’ve created the file from scratch, but pretty basic stuff, line 3 is just the host_name entry:</p>
<p class="MsoNormal"> </p>
<p class="MsoNormal">Define host{</p>
<p class="MsoNormal"> use generic-host</p>
<p class="MsoNormal"> host-name cisco2811</p>
<p class="MsoNormal"> alias Cisco 2811 Router</p>
<p class="MsoNormal"> address xxx.xxx.xxx.xxx</p>
<p class="MsoNormal"> hostgroups allhosts,network-switches</p>
<p class="MsoNormal">}</p>
<p class="MsoNormal"> </p>
<p class="MsoNormal">The documentation I’ve found still lists host-name as a valid entry, not sure what’s going on, any help would be appreciated.</p>
<p class="MsoNormal"> </p>
<p class="MsoNormal">Thanks in advance,</p>
<p class="MsoNormal"> </p>
<p class="MsoNormal">Joel</p>
</div>
<br>------------------------------------------------------------------------------<br>AlienVault Unified Security Management (USM) platform delivers complete<br>security visibility with the essential security capabilities. Easily and<br>efficiently configure, manage, and operate all of your security controls<br>from a single console and one unified framework. Download a free trial.<br>http://p.sf.net/sfu/alienvault_d2d<br>_______________________________________________<br>Nagios-users mailing list<br>Nagios-users@lists.sourceforge.net<br>https://lists.sourceforge.net/lists/listinfo/nagios-users<br>::: Please include Nagios version, plugin version (-v) and OS when reporting any issue. <br>::: Messages without supporting info will risk being sent to /dev/null<br><br>---------------------------------------------------------------------------------------------------------------------------------<br>Sample switch.cfg:<br><br><br>###############################################################################<br># SWITCH.CFG - SAMPLE CONFIG FILE FOR MONITORING A SWITCH<br>#<br># Last Modified: 10-03-2007<br>#<br># NOTES: This config file assumes that you are using the sample configuration<br># files that get installed with the Nagios quickstart guide.<br>#<br>###############################################################################<br><br><br><br><br>###############################################################################<br>###############################################################################<br>#<br># HOST DEFINITIONS<br>#<br>###############################################################################<br>###############################################################################<br><br># Define the switch that we'll be monitoring<br><br>define host{<br> use generic-switch ; Inherit default values from a template<br> host_name linksys-srw224p ; The name we're giving to this switch<br> alias Linksys SRW224P Switch ; A longer name associated with the switch<br> address 192.168.1.253 ; IP address of the switch<br> hostgroups switches ; Host groups this switch is associated with<br> }<br><br><br><br><br>###############################################################################<br>###############################################################################<br>#<br># HOST GROUP DEFINITIONS<br>#<br>###############################################################################<br>###############################################################################<br><br># Create a new hostgroup for switches<br><br>define hostgroup{<br> hostgroup_name switches ; The name of the hostgroup<br> alias Network Switches ; Long name of the group<br> }<br><br><br><br><br>###############################################################################<br>###############################################################################<br>#<br># SERVICE DEFINITIONS<br>#<br>###############################################################################<br>###############################################################################<br><br># Create a service to PING to switch<br><br>define service{<br> use generic-service ; Inherit values from a template<br> host_name linksys-srw224p ; The name of the host the service is associated with<br> service_description PING ; The service description<br> check_command check_ping!200.0,20%!600.0,60% ; The command used to monitor the service<br> normal_check_interval 5 ; Check the service every 5 minutes under normal conditions<br> retry_check_interval 1 ; Re-check the service every minute until its final/hard state is determined<br> }<br><br><br># Monitor uptime via SNMP<br><br>define service{<br> use generic-service ; Inherit values from a template<br> host_name linksys-srw224p<br> service_description Uptime <br> check_command check_snmp!-C public -o sysUpTime.0<br> }<br><br><br><br># Monitor Port 1 status via SNMP<br><br>define service{<br> use generic-service ; Inherit values from a template<br> host_name linksys-srw224p<br> service_description Port 1 Link Status<br> check_command check_snmp!-C public -o ifOperStatus.1 -r 1 -m RFC1213-MIB<br> }<br><br><br><br># Monitor bandwidth via MRTG logs<br><br>define service{<br> use generic-service ; Inherit values from a template<br> host_name linksys-srw224p<br> service_description Port 1 Bandwidth Usage<br> check_command check_local_mrtgtraf!/var/lib/mrtg/192.168.1.253_1.log!AVG!1000000,1000000!5000000,5000000!10<br> }<br><br><br>###############################################################################<br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br></div></body></html>