Installation of an SNMP server providing access to management data
such as networking activities, memory use, processes status, … Data
will be shared read-only and protected by a simple password (aka:
community string).
[x] IPV6 IPv6 protocol support
[x] MFD_REWRITES Use new MFD rewrites of mib modules
[x] PERL Perl scripting language support
[x] PERL_EMBEDDED Build embedded perl
[x] SMUX Build with SNMP multiplexing (SMUX) support
Configuration
The SNMP daemon is configured for a read-only access from the
community community-string, only the
MIBs which are used will be exported.
It’s possible to split the configuration in two separate files, the
first one holding a generic configuration (snmpd.conf), the
second one holding a configuration specific to the computer
(snmpd.local.conf).
snmpd.conf
The information is shared read-only and is only protected by a
password: community-string.
The 2c version of the protocol is used.
The version 3 would have allowed a stronger security with the
integration of confidentiality, integrity and authentication.
snmp.conf
1
2
3
4
5
6
7
8
9
10
11
# Access control
######################################################################
# sec.name source community
com2secreadonlydefaultcommunity-string# name sec.model sec.name
groupROSystemv2creadonlygroupROSystemusmreadonly# context sec.model sec.level match read write notif
accessROSystem""anynoauthexactsystemnonenone
Set the different level of visibility for the MIBs, the information
which will be published are about the network interfaces, resources
(memory, process, disk), system status (temperature) and imap.
snmp.conf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
# Views
######################################################################
# name incl/excl subtree mask
viewsystemincludedSNMPv2-MIB::systemviewsystemincludedIF-MIB::interfacesviewsystemincludedIP-MIB::ipAddrTableviewsystemincludedIPV6-MIB::ipv6MIBviewsystemincludedHOST-RESOURCES-MIB::hrSystemviewsystemincludedHOST-RESOURCES-MIB::hrStorageviewsystemincludedHOST-RESOURCES-MIB::hrProcessorTableviewsystemincludedUCD-SNMP-MIB::memoryviewsystemincludedUCD-SNMP-MIB::laTableviewsystemincludedUCD-SNMP-MIB::systemStatsviewsystemincludedenterprises.3.6
AgentX (RFC 2741) is a protocol allowing external programs
to extend the SNMP agent with their own management information,
communication is done through the use of a UNIX socket. This will be
used, for example, by Cyrus IMAP with the OID
enterprises.3.6.
If the agentx group is not present on the system,
another appropriate group can be used (wheel, …). Or
the group can be created using a free id number, here we use the
arbitrary value of 1025:
It is also possible to extend net-snmp with a perl script thank to the
embedded interpreter. Adding CPU temperature and frequency is done
through this script, in the UCD-SNMP-MIB::systemStats branch.
Making available (one time usage, globaly, or localy):
Notify of new MIBs to use
1
2
3
export MIBS=+MY-MIB# One time usageecho"mibs +MY-MIB">> /usr/local/etc/snmp/snmpd.conf # Global usageecho"mibs +MY-MIB">>$HOME/.snmp/snmp.conf # Local usage