Arch LinuxをSNMPで監視できるようにしたいので、net-snmpを導入しました。
    設定は、Snmpd - ArchWikiを参照。

    インストール

    net-snmpのパッケージをインストール。

    [root@blackle0pard ~]# pacman -S net-snmp --noconfirm
    

    諸々の設定

    snmpd.confファイルを作成する。

    [root@blackle0pard ~]# mkdir /etc/snmp
    

    read_only_userをTESTで作成する。許可するIPアドレスは192.168.10.1に制限。

    [root@blackle0pard ~]# echo rocommunity TEST 192.168.10.1 >> /etc/snmp/snmpd.conf
    [root@blackle0pard ~]# echo rocommunity TEST localhost >> /etc/snmp/snmpd.conf
    
    [root@blackle0pard ~]# cat /etc/snmp/snmpd.conf
    rocommunity TEST 192.168.10.1
    rocommunity TEST localhost
    

    サービスを起動する。

    [root@blackle0pard ~]# systemctl start snmpd
    

    サービスを有効化する。

    [root@blackle0pard ~]# systemctl enable snmpd
    Created symlink /etc/systemd/system/multi-user.target.wants/snmpd.service → /usr/lib/systemd/system/snmpd.service.
    

    サービスの状態を確認する。

    [root@blackle0pard ~]# systemctl status snmpd
     snmpd.service - Simple Network Management Protocol (SNMP) Daemon
       Loaded: loaded (/usr/lib/systemd/system/snmpd.service; enabled; vendor preset: disabled)
       Active: active (running) since Sat 2017-10-28 20:19:17 JST; 11s ago
     Main PID: 3349 (snmpd)
        Tasks: 1 (limit: 4915)
       CGroup: /system.slice/snmpd.service
               └─3349 /usr/bin/snmpd -p /run/snmpd.pid
    
    Oct 28 20:19:17 blackle0pard.net systemd[1]: Starting Simple Network Management Protocol (SNMP) Daemon...
    Oct 28 20:19:17 blackle0pard.net systemd[1]: snmpd.service: PID file /run/snmpd.pid not readable (yet?) after start: No such file or directory
    Oct 28 20:19:17 blackle0pard.net systemd[1]: Started Simple Network Management Protocol (SNMP) Daemon.
    

    動作確認

    snmpwalkコマンドで情報が取得できることを確認する。

    [root@blackle0pard ~]# snmpwalk -v 2c -c TEST localhost | less
    

    OID情報

    使いそうなものを適当に追加していきます。

    System
    • a textual description of the entity
    [root@localhost ~]# snmpwalk -v 2c -c TEST localhost .1.3.6.1.2.1.1.1
    SNMPv2-MIB::sysDescr.0 = STRING: Linux blackle0pard.net 4.9.50-x86_64-linode86 #1 SMP Thu Sep 14 19:28:20 UTC 2017 x86_64
    
    [root@localhost ~]# snmpwalk -v 2c -c TEST localhost sysDescr
    
    • an administratively-assigned name for this managed node
    [root@localhost ~]# snmpwalk -v 2c -c TEST localhost .1.3.6.1.2.1.1.5
    SNMPv2-MIB::sysName.0 = STRING: blackle0pard.net
    
    [root@localhost ~]# snmpwalk -v 2c -c TEST localhost sysName
    
    Interfaces
    • The number of network interfaces
    [root@localhost ~]# snmpwalk -v 2c -c TEST localhost .1.3.6.1.2.1.2.1
    IF-MIB::ifNumber.0 = INTEGER: 12
    
    [root@localhost ~]# snmpwalk -v 2c -c TEST localhost .ifNumber
    
    • a textual string containing information about the interface
    [root@localhost ~]# snmpwalk -v 2c -c TEST localhost .1.3.6.1.2.1.2.2.1.2
    IF-MIB::ifDescr.1 = STRING: lo
    IF-MIB::ifDescr.2 = STRING: dummy0
    IF-MIB::ifDescr.3 = STRING: Red Hat, Inc Device 0001
    IF-MIB::ifDescr.4 = STRING: teql0
    IF-MIB::ifDescr.5 = STRING: tunl0
    IF-MIB::ifDescr.6 = STRING: gre0
    IF-MIB::ifDescr.7 = STRING: gretap0
    IF-MIB::ifDescr.8 = STRING: ip_vti0
    IF-MIB::ifDescr.9 = STRING: ip6_vti0
    IF-MIB::ifDescr.10 = STRING: sit0
    IF-MIB::ifDescr.11 = STRING: ip6tnl0
    IF-MIB::ifDescr.12 = STRING: ip6gre0
    
    [root@localhost ~]# snmpwalk -v 2c -c TEST localhost ifDescr
    
    • the type of interface, distinguished according to the physical/link protocol
    [root@localhost ~]# snmpwalk -v 2c -c TEST localhost .1.3.6.1.2.1.2.2.1.3
    IF-MIB::ifType.1 = INTEGER: softwareLoopback(24)
    IF-MIB::ifType.2 = INTEGER: ethernetCsmacd(6)
    IF-MIB::ifType.3 = INTEGER: ethernetCsmacd(6)
    IF-MIB::ifType.4 = INTEGER: other(1)
    IF-MIB::ifType.5 = INTEGER: tunnel(131)
    IF-MIB::ifType.6 = INTEGER: tunnel(131)
    IF-MIB::ifType.7 = INTEGER: ethernetCsmacd(6)
    IF-MIB::ifType.8 = INTEGER: tunnel(131)
    IF-MIB::ifType.9 = INTEGER: tunnel(131)
    IF-MIB::ifType.10 = INTEGER: tunnel(131)
    IF-MIB::ifType.11 = INTEGER: tunnel(131)
    IF-MIB::ifType.12 = INTEGER: other(1)
    
    root@localhost ~]# snmpwalk -v 2c -c TEST localhost ifType
    

    Env.

    [bee@blackle0pard ~]$ inxi -SM
    System:    Host: blackle0pard.net Kernel: 4.9.50-x86_64-linode86 x86_64 bits: 64 Console: tty 0
               Distro: Arch Linux
    Machine:   Device: kvm System: QEMU product: Standard PC (i440FX + PIIX 1996) v: pc-i440fx-2.6 serial: N/A
               Mobo: N/A model: N/A serial: N/A
               BIOS: SeaBIOS v: rel-1.9.1-0-gb3ef39f-prebuilt.qemu-project.org date: 04/01/2014