SNMP Cisco Problem

Wengrzik, Andreas Wengrzik at ewr.de
Tue Nov 9 10:03:43 CET 2004


I stuck at this problem...

The output is always this string:

snmpwalk -v 1 -c nagios 172.16.0.23 .1.3.6.1.2.1.2.2.1.8.4

IF-MIB::ifOperStatus.4 = INTEGER: up(1)

And if i need check_snmp it fails.

So i need to write a script which cuts onyl the    1    or     2 out of the ( ).
I search antoher script and the do it with this syntax:

FREE=`snmpwalk $HOST2CHK $COMMUNITY .1.3.6.1.4.1.9.9.48.1.1.1.6.1 | cut -d ":" -f 2`


but, i can´t use this i think... Becaus cut needs a delimiter, and here i have two brackets around my value.
Does anyone know better to play with scripting??

Thanks a lot!!!

Bye



> -----Original Message-----
> From: Robert Nelson [mailto:rnelson at windchannel.com]
> Sent: Monday, November 08, 2004 10:34 PM
> To: Wengrzik, Andreas; nagios-users at lists.sourceforge.net
> Subject: RE: [Nagios-users] SNMP Cisco Problem
> 
> 
> Try using the check_snmp plugin on the command line. I believe it
> responds with a number, i.e. "1" , "2", or "3". So your check 
> should be
> "check_snmp!interfaces.ifTable.ifEntry.ifAdminStatus.34!1!2!2"
> 
> Rob Nelson
> Network Engineer
> Windchannel Communications
> 919-538-6326 
> 
> > -----Original Message-----
> > From: Wengrzik, Andreas [mailto:Wengrzik at ewr.de] 
> > Sent: Monday, November 08, 2004 8:51 AM
> > To: nagios-users at lists.sourceforge.net
> > Subject: [Nagios-users] SNMP Cisco Problem
> > 
> > 
> > Hi!
> > 
> > I currently try to check a Cisco Catalyst 3550.
> > So i got this result with snmpget
> > 
> > #snmpwalk -v 1 -c nagios 172.16.0.23 
> > interfaces.ifTable.ifEntry.ifAdminStatus.1
> > IF-MIB::ifAdminStatus.1 = INTEGER: up(1)
> > 
> > and this is my service descr for nagios
> > 
> > define service {
> > 	host_name		SW_NOT_UG
> > 	service_description	SNMP_TEST
> > 	check_command		
> > check_snmp!interfaces.ifTable.ifEntry.ifAdminStatus.34!"INTEGE
> > R: up(1)"!"INTEGER: down(2)"!"INTEGER: down(2)"
> > 	max_check_attempts	3
> > 	normal_check_interval	1
> > 	retry_check_interval	3
> > 	check_period    	24x7
> >         notification_interval   20
> >         notification_period     24x7
> >         notification_options    w,c,u,r
> >         contact_groups          SMS
> > 	}
> > 
> > 
> > With this description i got only this message in Nagios:
> > 	Invalid warning threshold: INTEGER: up(1)  
> > 
> > I also tried to change " to '  - no result.
> > So, what can i do else to get informations in a correct way?
> > 
> > Sorry for this question its the first time i use snmp.
> > 
> > Thanks for your help!
> > 
> > Bye
> > 
> > 
> > -------------------------------------------------------
> > This SF.Net email is sponsored by:
> > Sybase ASE Linux Express Edition - download now for FREE
> > LinuxWorld Reader's Choice Award Winner for best database on Linux.
> > http://ads.osdn.com/?ad_idU88&alloc_id065&op=ick
> > _______________________________________________
> > 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
> > 
> 


-------------------------------------------------------
This SF.Net email is sponsored by:
Sybase ASE Linux Express Edition - download now for FREE
LinuxWorld Reader's Choice Award Winner for best database on Linux.
http://ads.osdn.com/?ad_idU88&alloc_id065&op=click
_______________________________________________
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