Page 2 of 2

Re: Problem with Check_Snmp

Posted: Thu Feb 15, 2018 5:28 pm
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.

Re: Problem with Check_Snmp

Posted: Fri Feb 16, 2018 4:57 am
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

Re: Problem with Check_Snmp

Posted: Fri Feb 16, 2018 4:40 pm
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?

Re: Problem with Check_Snmp

Posted: Sat Feb 17, 2018 3:49 am
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

}

Re: Problem with Check_Snmp

Posted: Mon Feb 19, 2018 2:19 pm
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
        }

Re: Problem with Check_Snmp

Posted: Mon Feb 26, 2018 12:02 pm
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

Re: Problem with Check_Snmp

Posted: Mon Feb 26, 2018 12:39 pm
by kyang
Perfect!

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