Problem with Check_Snmp

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.
kyang

Re: Problem with Check_Snmp

Post by kyang »

Glad to hear that it works now!

Are you talking about adding this check_snmp in that file?

These are the object definitions.

https://assets.nagios.com/downloads/nag ... tions.html

A host and service require different derivatives in order to not produce any Nagios errors.
itf009
Posts: 9
Joined: Sun Feb 04, 2018 6:04 am

Re: Problem with Check_Snmp

Post by itf009 »

kyang wrote:Glad to hear that it works now!

Are you talking about adding this check_snmp in that file?

These are the object definitions.

https://assets.nagios.com/downloads/nag ... tions.html

A host and service require different derivatives in order to not produce any Nagios errors.
I meant this:

define service{
use generic-service ; Inherit values from a template
host_name GM-PS
service_description Name ID
check_command check_snmp!-C public -o .1.3.6.1.2.1.1.1.0 -m all

}

I still get an Timeout
kyang

Re: Problem with Check_Snmp

Post by kyang »

Do you have the define host field with IP address and other fields in that switch.cfg?

Is this the host with the same IP address that you were checking before?
itf009
Posts: 9
Joined: Sun Feb 04, 2018 6:04 am

Re: Problem with Check_Snmp

Post by itf009 »

kyang wrote:Do you have the define host field with IP address and other fields in that switch.cfg?

Is this the host with the same IP address that you were checking before?
My Switch.cfg File :

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	GM-PS	                ; The name we're giving to this switch
	alias		Lancom_1781AW	        ; A longer name associated with the switch
	address		192.168.172.1	        ; 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		GM-PS	        ; 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
	check_interval	5		        ; Check the service every 5 minutes under normal conditions
	retry_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		GM-PS
	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		GM-PS
	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		GM-PS
	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
	}



# STATUS

define service{
	use                             generic-service ; Inherit values from a template
        host_name                       GM-PS
        service_description             Name
        check_command                   check_snmp!-C public -o .1.3.6.1.2.1.1.1.0 -m all

}
Last edited by tmcdonald on Mon Feb 19, 2018 10:41 am, edited 1 time in total.
Reason: Please use [code][/code] tags around long output
kyang

Re: Problem with Check_Snmp

Post by kyang »

That is strange. Before we did use check_snmp towards your router correct?

Code: Select all

/usr/local/nagios/libexec/check_snmp -H 192.168.172.1 -C public -o .1.3.6.1.2.1.1.1.0
I have mine set up like this and it works.

Code: Select all

# Monitor uptime via SNMP

define service{
        use                     generic-service ; Inherit values from a template
        host_name               Nagios Linux SNMP
        service_description     OID check1
        check_command           check_snmp!-C StrOngCOmmunity -o .1.3.6.1.2.1.1.1.0
        }
itf009
Posts: 9
Joined: Sun Feb 04, 2018 6:04 am

Re: Problem with Check_Snmp

Post by itf009 »

kyang wrote:That is strange. Before we did use check_snmp towards your router correct?

Code: Select all

/usr/local/nagios/libexec/check_snmp -H 192.168.172.1 -C public -o .1.3.6.1.2.1.1.1.0
I have mine set up like this and it works.

Code: Select all

# Monitor uptime via SNMP

define service{
        use                     generic-service ; Inherit values from a template
        host_name               Nagios Linux SNMP
        service_description     OID check1
        check_command           check_snmp!-C StrOngCOmmunity -o .1.3.6.1.2.1.1.1.0
        }

Works now
kyang

Re: Problem with Check_Snmp

Post by kyang »

Perfect!

Did you have any more questions on this or are we okay to lock this up?
Locked