SNMP: Difference between revisions

From Edgar BV Wiki
Jump to navigation Jump to search
Created page with "run snmpconf /etc/default/snmpd get rid of 127.0.0.1 /etc/snmp/snmpd.conf should have at least the following: <pre> rocommunity public default -V systemonly rocommunity..."
 
No edit summary
Line 1: Line 1:
run snmpconf
/etc/default/snmpd get rid of 127.0.0.1
/etc/snmp/snmpd.conf should have at least the following:
/etc/snmp/snmpd.conf should have at least the following:
<pre>
<pre>
  rocommunity public default    -V systemonly
# Listen for connections from the local system only
rocommunity euhostro
#agentAddress udp:127.0.0.1:161
# Listen for connections on all interfaces (both IPv4 *and* IPv6)
agentAddress udp:161,udp6:[::1]:161
</pre>
</pre>
to define the community and
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'
<pre>
<pre>
agentAddress
rocommunity public  default    -V systemonly
agentaddress
rocommunity  euhostro  default    -V systemonly
</pre>
</pre>
in order to allow the daemon to listen to all IP adresses instead of only localhost


test with
 
test with (requires snmp package installed)
<pre>
<pre>
snmpwalk -v1 -c euhostro localhost
snmpwalk -v1 -c euhostro localhost

Revision as of 09:44, 9 April 2019

/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  default    -V systemonly


test with (requires snmp package installed)

snmpwalk -v1 -c euhostro localhost

then from another server:

snmpwalk -v1 -c euhostro IPADRESS