SNMP: Difference between revisions

From Edgar BV Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
 
Line 1: Line 1:
apt-get install snmp-mibs-downloader
/etc/snmp/snmpd.conf should have at least the following:
/etc/snmp/snmpd.conf should have at least the following:
<pre>
<pre>
Line 24: Line 27:
<pre>
<pre>
snmpwalk -v1 -c euhostro IPADRESS
snmpwalk -v1 -c euhostro IPADRESS
snmpwalk -v2c -c public 192.168.0.1
snmpget -v2c -c public -mALL 192.168.0.1 sysName.0 sysObjectID.0
</pre>
</pre>
[https://docs.oracle.com/cd/E19469-01/820-6413-13/SNMP_commands_reference_appendix.html some good commands]

Latest revision as of 12:18, 5 July 2019

apt-get install snmp-mibs-downloader


/etc/snmp/snmpd.conf should have at least the following:

#  Listen for connections from the local system only
#agentAddress  udp:127.0.0.1:161
#  Listen for connections on all interfaces (both IPv4 *and* IPv6)
agentAddress udp:161,udp6:[::1]:161

in order to allow the daemon to listen to all IP adresses instead of only localhost (nb you can't bind to an IP address that the machine doesn't have here!)


Also (for v1) community names should be changed from 'public' to 'whatever'

rocommunity public  default    -V systemonly
rocommunity  euhostro  192.168.0.11


test with (requires snmp package installed)

snmpwalk -v1 -c euhostro localhost

then from another server:

snmpwalk -v1 -c euhostro IPADRESS
snmpwalk -v2c -c public 192.168.0.1
snmpget -v2c -c public -mALL 192.168.0.1 sysName.0 sysObjectID.0

some good commands