Unix/Linux Go Back    

Programming Post questions about C, C++, Java, SQL, and other programming languages here.

Getattr use wildcard as name parameter python


python, snmp

Thread Tools Search this Thread Display Modes
Old Unix and Linux 03-08-2013
kar_333 kar_333 is offline
Registered User
Join Date: Aug 2011
Last Activity: 26 August 2016, 2:42 AM EDT
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Lightbulb Getattr use wildcard as name parameter python

I am trying to extract value from snmp trap oid got from mib, using getattr function in python.


)when i started testing the using real trap OID is having two additional values at the end.


so is there a way i can use


I don't want to use the correct OID. it should work in all cases so i wanted to use a wild card. i tried it. but it's not working. If you know any alternatives please help.

Last edited by Scrutinizer; 03-08-2013 at 02:50 AM.. Reason: code tags
Sponsored Links
Old Unix and Linux 03-08-2013
DGPickett DGPickett is offline Forum Advisor  
Registered User
Join Date: Oct 2010
Last Activity: 1 February 2016, 3:35 PM EST
Location: Southern NJ, USA (Nord)
Posts: 4,673
Thanks: 8
Thanked 587 Times in 560 Posts
Since getattr requires an exact name string, you may have to iterate a dir() and compare each to your pattern.
Sponsored Links

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Linux More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Passing parameter to script, and split the parameter only4satish Shell Programming and Scripting 5 11-01-2012 05:37 AM
Command that takes one parameter and then searches for the passed in parameter pankaj80 Shell Programming and Scripting 3 04-05-2012 06:05 AM
how do I make dynamic parameter names? Or get the value of a parameter evaluated twi Awanka Shell Programming and Scripting 2 04-19-2007 09:37 PM
Find wildcard .shtml files in wildcard directories and removing them- How's it done? Neko UNIX for Dummies Questions & Answers 1 06-27-2001 09:06 AM

All times are GMT -4. The time now is 03:32 AM.