SNMP4J: Which SNMP4J Jar should be used to write a SNMP agent? - snmp

I am new to SNMP agent implementation. A confusion regarding the usage of SNMP4J API is, which SNMP4J Api should be used to create the agent? Should it be SNMP4J or SNMP4J-Agent?

An agent is some kind of server: it mainly replies to requests (it may occasionally also send traps to managers).
A manager is a some kind of client: it mainly send requests to agents (it may occasionally also receive traps from managers).
SNMP4J is the library for managers to send requests to remote agents.
SNMP4J-Agent is the library for agents to reply to requests.
So, to write a SNMP agent, you need to use SNMP4J-Agent jar file.

Related

Exchange server mail interceptor (connector/delivery agents/mailflow)

My basic requirement is that I need to create "something" that is capable of intercepting emails incoming/outgoing from our mail server. It cannot be an extension to mail clients. Currently we consider only exchange server. In my research I found below resources that seems to be helpful.
Mail flow and the transport
Delivery agents and Delivery Agent connectors
Transport agents
From these transport agents seems to be quite old. Now I can't figure out what's the best from the remaining options(Mail flow and the transport or Delivery agents and Delivery Agent connectors).
Whatever I develop should be able to read email get some statistics (using mail header(s), amount of attachments etc...) and store it into a custom database. Additionally add some custom headers to incoming/outgoing mails.
Can anyone point me to right direction? Should it be some kind of a service that I can install in Exchange server? (admin center->mail flow-> connectors). For example, can I write it in c# and host it like an assembly? or may be a web hook to a hosted service where Exchange will forward emails in real time etc...
I couldn't find any examples/tutorials except this
If its OnPrem Exchange and you don't have or are considering Office365 then Transport Agents would be the right thing to use. They haven't change since 2013 but are still what is used for this type of thing the last SDK was 2010 but its still valid given the lack of change on the backend https://learn.microsoft.com/en-us/previous-versions/office/developer/exchange-server-2010/dd877026(v=exchg.140)
Delivery Agents are more for when you have an external gateway that you want to send and receive messages from.

Proxy snmp v3 request to snmp v2c supported servers

I am trying to configure Net-SNMP to accept incoming SNMP v3 requests at proxy agent and forward the requests to other internal application servers.
I have investigated and read tons of comments but I could not find how to query the proxy agent with SNMP v3 and enforce proxy agent to parse and forward this query as SNMP v2c request.
Your assistance would be highly appreciated. Thanks a lot

Can send SNMP requests from manager to multiple agents concurrently?

I require to send get requests to several snmp agents from a client process.
I have implemented client/agent based on below urls
http://www.jitendrazaa.com/blog/java/snmp/create-snmp-client-in-java-using-snmp4j/
http://www.jitendrazaa.com/blog/java/snmp/creating-snmp-agent-server-in-java-using-snmp4j/
I would like to know whether the client/manager can send requests to the agents concurrently? (e.g. using background threads within the process)
or whether it would be necessary to poll each agent individually?
From the samples,
CommunityTarget has address set as udp:127.0.0.1/161 - which is then used in the snmp 'get' request.
The agent has address set as 0.0.0.0/2001 - which is used when creating TransportMappings.
I don't understand how the addressing is working / how I would configure to handle agents at other/non local IP addresses?
Thank you
For question #1:
You are asking about synchronous vs. asynchronous API usage.
Google "snmp4j asynchronous" for examples.
This is orthogonal to single-thread vs. multi-thread.
Ie. you can have a single-thread application which asynchronously sends requests and handles multiple agents' responses.
As an example, the MIMIC Recorder is a single-threaded, asynchronous app.
Multi-thread is only needed for complicated applications which handle complicated management state machines.
For question #2:
It looks like the sample code only connects to the agent 127.0.0.1 on the local system. To connect remotely, you would have to use the IP address where the agent is running.

Send snmp trap message to net snmp

I am trying to send a trap message from my agent to net-snmp but in my agent it looks like it's fine, however net-snmp doesn't show the message.
I want to know if net-snmp knows how to handle a trap message?
Normally, you would use net-snmp as an Agent.
Agents generally send traps, and don't receive them. They need to be able to handle get-requests, set-requests and get-next-requests, but not traps.
The system which receives SNMP traps is known as a Manager. Net-snmp is not an SNMP manager, but it contains all the (C) programming libraries needed for you to create your own SNMP manager, should you want to. There is also snmptrapd, which can log incoming traps into a file, or pass them to a perl script for processing.
Perhaps you're indeed asking about snmptrapd?
If traps are not logged on the receiver, normal network troubleshooting procedures apply. Snoop the traffic using Wireshark, first on the receiving system, then if needed, on the sending side. This can verify whether the traffic is dropped by the network (firewalls etc).
If you want to study the basics of the protocol, this RFC is a good starting point: "Protocol Operations for Version 2 of the Simple Network Management Protocol" http://www.ietf.org/rfc/rfc1905.txt

How to send an snmp request to any computer on LAN?

I want to build an application using snmp for searching my LAN and exploring the devices which have shared some resources. I need some assistance to start with it, I have trying to do the same using net-snmp, but still no success.
SNMP is on UDP, so you can simply do a broadcast.
It is quite normal that net-snmp times out in such cases, as no SNMP agent would like to respond to you or no SNMP agent is there in the same LAN.

Resources