Net-SNMP: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
mNo edit summary |
||
| (One intermediate revision by the same user not shown) | |||
| Line 5: | Line 5: | ||
== USE-Flags == | == USE-Flags == | ||
{{ | {{File|/etc/portage/package.use| | ||
<pre> | <pre> | ||
net-analyzer/net-snmp -perl -python | net-analyzer/net-snmp -perl -python | ||
| Line 12: | Line 12: | ||
== Packages == | == Packages == | ||
{{ | {{Code|emerge mrtg -pv| | ||
<pre> | <pre> | ||
[ebuild N ] net-analyzer/net-snmp-5.4.1-r3 USE="ipv6 ssl tcpd -X -diskio -doc -elf -extensible -lm_sensors -mfd-rewrites -minimal -perl -python -rpm (-selinux) -sendmail -smux" 5,003 kB | [ebuild N ] net-analyzer/net-snmp-5.4.1-r3 USE="ipv6 ssl tcpd -X -diskio -doc -elf -extensible -lm_sensors -mfd-rewrites -minimal -perl -python -rpm (-selinux) -sendmail -smux" 5,003 kB | ||
| Line 19: | Line 19: | ||
== Installation == | == Installation == | ||
{{ | {{Root|emerge net-snmp}} | ||
== Configuration == | == Configuration == | ||
=== Allow localhost read-only queries === | === Allow localhost read-only queries === | ||
{{ | {{File|/etc/snmp/snmpd.conf| | ||
<pre> | <pre> | ||
# First, map the community name (COMMUNITY) into a security name | # First, map the community name (COMMUNITY) into a security name | ||
| Line 56: | Line 56: | ||
=== Allow localhost read-write and localnet read-only queries === | === Allow localhost read-write and localnet read-only queries === | ||
{{ | {{File|/etc/portage/package.use| | ||
<pre> | <pre> | ||
# First, map the community name (COMMUNITY) into a security name | # First, map the community name (COMMUNITY) into a security name | ||
| Line 94: | Line 94: | ||
== Finalize == | == Finalize == | ||
{{ | {{Root|/etc/init.d/snmpd start}} | ||
{{ | {{Root|rc-update add snmpd default}} | ||
== Testing == | == Testing == | ||
{{ | {{Root|snmpwalk -v 1 -c public localhost system}} | ||
== Further Reading == | == Further Reading == | ||
* [[Squid]] - Configure Squid for SNMP queries | * [[Squid]] - Configure Squid for SNMP queries | ||
* [[MRTG]] - Get nice graphs out of your SNMP data | * [[MRTG]] - Get nice graphs out of your SNMP data | ||
Latest revision as of 17:49, 13 January 2011
Description
Configure Net-SNMP to allow localhost/localnet queries.
Dependencies
USE-Flags
File: /etc/portage/package.use
net-analyzer/net-snmp -perl -python
Packages
| Code: emerge mrtg -pv |
[ebuild N ] net-analyzer/net-snmp-5.4.1-r3 USE="ipv6 ssl tcpd -X -diskio -doc -elf -extensible -lm_sensors -mfd-rewrites -minimal -perl -python -rpm (-selinux) -sendmail -smux" 5,003 kB |
Installation
# emerge net-snmp
Configuration
Allow localhost read-only queries
File: /etc/snmp/snmpd.conf
# First, map the community name (COMMUNITY) into a security name # (local and mynetwork, depending on where the request is coming # from): # sec.name source community com2sec local localhost public # Second, map the security names into group names: # sec.model sec.name group MyROGroup v1 local group MyROGroup v2c local group MyROGroup usm local # Third, create a view for us to let the groups have rights to: # incl/excl subtree mask view all included .1 80 # Finally, grant the 2 groups access to the 1 view with different # write permissions: # context sec.model sec.level match read write notif access MyROGroup "" any noauth exact all none none syslocation Right here, right now. syscontact Me <me@somewhere.org>
Allow localhost read-write and localnet read-only queries
File: /etc/portage/package.use
# First, map the community name (COMMUNITY) into a security name # (local and mynetwork, depending on where the request is coming # from): # sec.name source community com2sec local localhost public com2sec mynetwork 192.168.0.0/24 public # Second, map the security names into group names: # sec.model sec.name group MyRWGroup v1 local group MyRWGroup v2c local group MyRWGroup usm local group MyROGroup v1 mynetwork group MyROGroup v2c mynetwork group MyROGroup usm mynetwork # Third, create a view for us to let the groups have rights to: # incl/excl subtree mask view all included .1 80 # Finally, grant the 2 groups access to the 1 view with different # write permissions: # context sec.model sec.level match read write notif access MyROGroup "" any noauth exact all none none access MyRWGroup "" any noauth exact all all none syslocation Right here, right now. syscontact Me <me@somewhere.org>
Finalize
# /etc/init.d/snmpd start
# rc-update add snmpd default
Testing
# snmpwalk -v 1 -c public localhost system