bhuvan

bhuvan

SNMP traps not processed by the custom snmpm_user behaviour

SETUP: I process SNMP traps using Erlang snmpm module. I have implemented the behavior snmpm_user and called it as snmpm_user1, so that the SNMP traps are processed by snmpm_user1 rather than by the default implementation snmpm_user_default.

I use net-snmp command to send the traps. The command sends traps, each time from a different ephemeral port (ex: 51773 during this run). This is expected as per SNMP standards.
sudo snmptrap -v 2c -c public 127.0.0.1:5000 "" .1.3.6.1.4.1.8072.2.3.0.1 .1.3.6.1.2.1.1.3.0 s "Trap 2"

ISSUE: SNMP traps are processed by snmpm_user_default rather than by snmpm_user1. However, SNMP GET responses are processed by snmpm_user1 as expected.

The code and the complete logs are uploaded in git

LOG ANALYSIS: snmpm expects the traps from 127.0.0.1:161 as evident from the logs “unknown agent: 127.0.0.1:51773. Known Agents: {{127,0,0,1},51773}”. snmpm does not find a snmpm_user for the agent “{{127,0,0,1},51773}” as evident from the logs “failed retrieving user id for agent {{127,0,0,1},51773}”.

FURTHER DEBUGGING: snmpm_user_table has two entries, one each for snmpm_user1 & snmpm_user_default. Both the entries have the agent address 127.0.0.1:161.

ERROR LOGS SUMMARY:

*** [2024-11-28 21:42:35.829] SNMP M-NET-IF MPD LOG *** 
   [agent engine max msg size lookup] unknown agent: 127.0.0.1:51773
      Known Agents: [{"Agent1",{{127,0,0,1},161}}]
      
*** [2024-11-28 21:42:35.834] SNMP M-SERVER LOG *** 
   [trap] failed retrieving user id for agent <snmpUDPDomain,{{127,0,0,1},
                                                              51773}>: 
      Error:  {error,
                  {target_name_not_found,snmpUDPDomain,{{127,0,0,1},51773}}}
   when
      Users:  [snmp_manager]
      Agents: ["Agent1"]

First Post!

bhuvan

bhuvan

I checked the Elixir based SNMP manager snmp-elixir. It uses Erlang snmpm module and the default behaviour snmpm_user_default. If anyone has used a custom snmpm_user behaviour, please clarify my query.

Where Next?

Popular in Questions Top

Darmani72
If I have a post route which an argument: post /my_post_route/:my_param1, MyController.my_post_handler How would get the post params ...
New
gshaw
What is the idiomatic way of matching for not nil in Elixir? E.g., First way: defp halt_if_not_signed_in(conn, signed_in_account) when...
New
JeremM34
Hello, how can I check the Phoenix version ? Thanks !
New
minhajuddin
I have seen a lot of code which picks the first element from a list using Enum.at(0) instead of List.first. Is there a reason why people ...
New
Fl4m3Ph03n1x
About me? ( if you have nothing better to do than reading about some random guy in the internet :stuck_out_tongue: ) Hello all, this is ...
New
vrod
I am using the Starship cross-shell prompt – it seems pretty nice, but I get some errors: [WARN] - (starship::utils): Executing command ...
New
sergio_101
I am VERY much an elixir newbie. I have taken one elixir course and one phoenix course on Udemy. During that course, I saw the instructor...
New
nsuchy
Hi. I’ve noticed that Windows Powershell has it’s own IEX command and you cannot access Elixir’s IEX due to the conflict. This isn’t a cr...
New
openscript
Hello! Sorry for this astonishing simple question, but I’m really stuck. I try to set up the intellij-elixir plugin, but I don’t know ho...
New
jononomo
For some reason my phoenix channels are working for me in my local dev environment, but as soon as I deploy via Docker, I get a 403 error...
New

Other popular topics Top

aadeshere1
I have a another noob question about loop. Since elixir is immutable, while loop is not directly possible. total = 10 while total != 0 ...
New
chrismccord
Phoenix 1.4.0 released Phoenix 1.4 is out! This release ships with exciting new features, most notably with HTTP2 support, improved deve...
688 31013 112
New
minhajuddin
I have seen a lot of code which picks the first element from a list using Enum.at(0) instead of List.first. Is there a reason why people ...
New
stefanchrobot
What’s the safe way to decode a JSON string into a struct? I want to avoid calling String.to_atom. Jason.decode can give me a map with st...
New
jay1
Why is it that the mnesia database isn’t the most preferred database for use in Elixir/Phoenix?
New
joeerl
Hello again - after a longish gap I’ve decided I really must dig into Elixir and see what’s been happening here - so I have a few questio...
New
RisingFromAshes
I’ve read in another post that it may be possible with a router helper - but I couldn’t find an appropriate one, and tbh, I’m still just ...
New
sergio_101
I am VERY much an elixir newbie. I have taken one elixir course and one phoenix course on Udemy. During that course, I saw the instructor...
New
KronicDeth
Elixir plugin for JetBrain’s IntelliJ Platform (including Rubymine) This is a plugin that adds support for Elixir to JetBrains IntelliJ...
289 36352 110
New
shijith.k
I am trying to start a new phoenix project with elixir 1.9, but mix phx.new does not work. It says that ** (Mix) The task "phx.new" could...
New

Latest on Elixir Forum

Elixir Forum

We're in Beta

About us Mission Statement