add cmd need help!!!

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
conlala
Posts: 1
Joined: Mon Aug 05, 2013 3:37 am

add cmd need help!!!

Post by conlala »

Hi everybody,

my names conlala.

i was install nagios 4.0 and plugin 1.4 that is working.

to day add news switch Cisco 3560 with information :

1. files : switch.cfg

Code: Select all

###############################################################################
# SWITCH.CFG - SAMPLE CONFIG FILE FOR MONITORING A SWITCH
#
#
# 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	Cisco-C3560		; The name we're giving to this switch
	alias		Cisco C3560 Switch	; A longer name associated with the switch
	address		172.16.251.4		; 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		Cisco-C3560	; 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		Cisco-C3560
	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		Cisco-C3560
	service_description	Port 1 Link Status
	check_command		check_snmp!-C public -o ifOperStatus.1 -r 1 -m RFC1213-MIB
	}



define service{
	use			generic-service	; Inherit values from a template
	host_name		Cisco-C3560
	service_description	CPU Load
	check_command		check_cisco
	}

and files commands.cfg is :

Code: Select all


# 'check_cisco' command definition
define command{
	command_name	check_cisco
	command_line	/usr/local/nagios/libexec/check_cisco -H 172.16.251.4 -C public -t cpu
	}

files check_cisco download link : http://exchange.nagios.org/directory/Pl ... st/details

when check config see errors :

Code: Select all

/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg

Nagios Core 4.0.0-beta1
Copyright (c) 2009-present Nagios Core Development Team and Community Contributors
Copyright (c) 1999-2009 Ethan Galstad
Last Modified: 05-24-2013
License: GPL

Website: http://www.nagios.org
Reading configuration data...
   Read main config file okay...
   Read object config files okay...

Running pre-flight check on configuration data...

Checking services...
Error: Service check command 'check_cisco' specified in service 'CPU Load' for host 'Cisco-C3560' not defined anywhere!
        Checked 4 services.
Checking hosts...
        Checked 1 hosts.
Checking host groups...
        Checked 1 host groups.
Checking service groups...
        Checked 0 service groups.
Checking contacts...
        Checked 1 contacts.
Checking contact groups...
        Checked 1 contact groups.
Checking commands...
        Checked 26 commands.
Checking time periods...
        Checked 5 time periods.
Checking for circular paths...
        Checked 1 hosts
        Checked 0 service dependencies
        Checked 0 host dependencies
        Checked 5 timeperiods
Checking global event handlers...
Checking obsessive compulsive processor commands...
Checking misc settings...

Total Warnings: 0
Total Errors:   1

***> One or more problems was encountered while running the pre-flight check...

     Check your configuration file(s) to ensure that they contain valid
     directives and data defintions.  If you are upgrading from a previous
     version of Nagios, you should be aware that some variables/definitions
     may have been removed or modified in this version.  Make sure to read
     the HTML documentation regarding the config files, as well as the
     'Whats New' section to find out what has changed.
Please help me how to fix it.

Thank you read and support.
--------------------------------------------------------
conlala
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: add cmd need help!!!

Post by scottwilkerson »

does your nagios.cfg load in commands.cfg with a line like

Code: Select all

cfg_file=/usr/local/nagios/etc/commands.cfg
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
Locked