snmp on devices via ssh

2.7k Views Asked by At

I have a device in network. I would like to use SNMP to get information. Is it possible for using SSH and then SNMP for messages over ssh session ? I am using Java for implementation. It seems snmp4j is not yet ready for the snmp via ssh.

Can you please give me some example, if its possible ?

2

There are 2 best solutions below

0
On

Normally, SNMP runs over UDP; the SNMP implementations I know cannot directly use SSH.

However, you can tunnel UDP over SSH, and thus tunnel SNMP traffic.

One possibility is to tunnel using socat.

See e.g. http://www.derkeiler.com/Newsgroups/comp.security.ssh/2007-01/msg00136.html for an explanation.

You could probably also configure SNMP to run over TCP instead of UDP, which makes tunneling easier.

0
On

Ideally, you should write your application software developers and ask them to support RFC5592, which is the standard for how to do "SNMP over SSH". Not every stack has support for it yet, but some do (like the most recent version of Net-SNMP).