Forum Discussion
Making SNMP queries in iRules
- Feb 08, 2023
Running an periodic iCall Job in the Config-Plane to query SNMP and write results to a DG would be a much easier and elegant alternative. No? Dealing with ASN1-BER in iRules isn't much fun... 🙂
Cheers, Kai
LiefZimmerman : Good to see that the ordering in DevCentral has finally been changed, so that we can see if something gets added to rather old questions. Thanks!
For those wondering, I got this working. It took a bit of work, but I can query for one or more snmp OIDs in my irule now and get the correct responses back. It is as Vernon was saying I get nothing back unless the snmp packet is exactly correct.
In doing this, I found out that the ASN1::encode and ASN1::decode iRule functions don't work to expectation at all. I was using them thinking they would do the right thing but then found out they don't encode/decode properly, so I ended up doing the raw encoding/decoding myself. For example, you would think the below would give you a sequence with two integers inside:
ASN1::encode "(ii)" $firstInteger $secondInteger
but it doesn't. It doesn't put the correct sequence header and length into the encoded bytes. I had trouble with encoding/decoding other things with it too, and there is no way to encode an OID which is needed for SNMP.
Thanks!
- JRahmJan 11, 2023Admin
would be curious to see your final result wilcdr, working on a similar problem.
- Kai_WilkeFeb 08, 2023MVP
Running an periodic iCall Job in the Config-Plane to query SNMP and write results to a DG would be a much easier and elegant alternative. No? Dealing with ASN1-BER in iRules isn't much fun... 🙂
Cheers, Kai
LiefZimmerman : Good to see that the ordering in DevCentral has finally been changed, so that we can see if something gets added to rather old questions. Thanks!
- LiefZimmermanFeb 07, 2023Admin
This member has not been back on-site since before we moved (over 1 year) - so maybe an opportunity for an enterprising community member to help JRahm out of a bind?
JRahm wrote to me offline:I have an ASN irule I'm working on that does discovery of BER/DER attributes independent of SNMP protocol.
What say ye‽
Recent Discussions
Related Content
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com