KS-Soft. Network Management Solutions
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister    ProfileProfile    Log inLog in 

Help Parsing SNMP Trap

 
Post new topic   Reply to topic    KS-Soft Forum Index -> Configuration, Maintenance, Troubleshooting
View previous topic :: View next topic  
Author Message
RRing



Joined: 16 Aug 2006
Posts: 39

PostPosted: Mon Sep 15, 2014 2:38 pm    Post subject: Help Parsing SNMP Trap Reply with quote

I am trying to format the tune up reply value of a received Trap and grab the Details and IP address of the sent trap, but cannot get the format correct. when I set the SNMP Tune UP Reply to %TrapAllValues% I receive the following format
1.3.6.1.4.1.2879.2.8.1.1.1.1.1.0 = 4272488803<cr> 1.3.6.1.4.1.2879.2.8.1.1.1.1.2.0 = 2<cr> 1.3.6.1.4.1.2879.2.8.1.1.1.1.3.0 = 9495<cr> 1.3.6.1.4.1.2879.2.8.1.1.1.1.4.0 = 9/15/2014 8:31:57 PM<cr> 1.3.6.1.4.1.2879.2.8.1.1.1.1.5.0 = Event log type DBG is filling up in less than 3 hours, please check content of file and logging level<cr> 1.3.6.1.4.1.2879.2.8.1.2.1.4.1.7.0 = DBG<cr> 1.3.6.1.4.1.2879.2.1.7.2.2.4.1.0 = 10.10.10.10<cr> 1.3.6.1.4.1.2879.2.1.7.2.2.4.3.0 = 1<cr> 1.3.6.1.4.1.2879.2.1.7.2.2.4.4.0 = <cr> <cr> <
is it Possible to extract the string values for lets say the Event and IP address ?
such as
"Event log type DBG is filling up in less than 3 hours, please check content of file and logging level"
and
"10.10.10.10"
Back to top
View user's profile Send private message
KS-Soft Europe



Joined: 16 May 2006
Posts: 2832

PostPosted: Mon Sep 15, 2014 3:59 pm    Post subject: Reply with quote

Not sure what exactly do you mean by "extract the string values".
If you need Reply like:
IP=10.10.10.10 MSG=Event log type DBG is....
Then you may try "Tune up Reply value" option with expression like the following:
Code:
IP=[
substr('%TrapAllValues%',indexof('%TrapAllValues%','1.3.6.1.4.1.2879.2.1.7.2.2.4.1.0 = ')+35 ,indexof('%TrapAllValues%','1.3.6.1.4.1.2879.2.1.7.2.2.4.3.0')-indexof('%TrapAllValues%','1.3.6.1.4.1.2879.2.1.7.2.2.4.1.0')-40)
]
 MSG=[
substr('%TrapAllValues%',indexof('%TrapAllValues%','1.3.6.1.4.1.2879.2.8.1.1.1.1.5.0 = ')+35 ,indexof('%TrapAllValues%','1.3.6.1.4.1.2879.2.8.1.2.1.4.1.7.0')-indexof('%TrapAllValues%','1.3.6.1.4.1.2879.2.8.1.1.1.1.5.0')-40)
]
Back to top
View user's profile Send private message Send e-mail Visit poster's website
RRing



Joined: 16 Aug 2006
Posts: 39

PostPosted: Tue Sep 16, 2014 7:33 am    Post subject: Tune Up Reply Reply with quote

Thank You- The Tune up reply in your provided example works great.
Back to top
View user's profile Send private message
KS-Soft Europe



Joined: 16 May 2006
Posts: 2832

PostPosted: Tue Sep 16, 2014 8:12 am    Post subject: Reply with quote

You are welcome.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    KS-Soft Forum Index -> Configuration, Maintenance, Troubleshooting All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group

KS-Soft Forum Index