{"id":282,"date":"2026-04-06T14:46:04","date_gmt":"2026-04-06T05:46:04","guid":{"rendered":"https:\/\/falcon21.space\/kazuya\/work\/?page_id=282"},"modified":"2026-04-06T14:46:04","modified_gmt":"2026-04-06T05:46:04","slug":"snmp-%e3%83%8d%e3%83%83%e3%83%88%e3%83%af%e3%83%bc%e3%82%af%e6%a9%9f%e5%99%a8%e3%82%84%e3%82%b5%e3%83%bc%e3%83%90%e3%81%ae%e3%83%aa%e3%82%bd%e3%83%bc%e3%82%b9%e7%9b%a3%e8%a6%96","status":"publish","type":"page","link":"https:\/\/falcon21.space\/kazuya\/work\/?page_id=282","title":{"rendered":"SNMP \u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u6a5f\u5668\u3084\u30b5\u30fc\u30d0\u306e\u30ea\u30bd\u30fc\u30b9\u76e3\u8996"},"content":{"rendered":"\n<p>**********************************************************************<\/p>\n\n\n\n<p>root@falcon21:~#&nbsp;<strong>yum install net-snmp net-snmp-utils<\/strong><\/p>\n\n\n\n<p>\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u6e08\u307f:<br>net-snmp-1:5.9.4-15.el10_1.2.x86_64 net-snmp-agent-libs-1:5.9.4-15.el10_1.2.x86_64 net-snmp-utils-1:5.9.4-15.el10_1.2.x86_64<\/p>\n\n\n\n<p>\u5b8c\u4e86\u3057\u307e\u3057\u305f<\/p>\n\n\n\n<p>***********************************************************************<\/p>\n\n\n\n<p>\u76e3\u8996\u304c\u3067\u304d\u308b\u9805\u76ee\u306f\u3001\u5177\u4f53\u7684\u306b\u306fCPU\u4f7f\u7528\u7387\u3001\u30e1\u30e2\u30ea\u4f7f\u7528\u7387\u3001DISK\u4f7f\u7528\u7387\u3001\u30c8\u30e9\u30d5\u30a3\u30c3\u30af\u91cf\u306a\u3069\u3067\u3059\u3002<\/p>\n\n\n\n<p><strong>snmp.conf\u306e\u8a2d\u5b9a<\/strong><\/p>\n\n\n\n<p><strong>#conf\u30d5\u30a1\u30a4\u30eb\u306e\u30d0\u30c3\u30af\u30a2\u30c3\u30d7<\/strong><br>[root@AlmaLinux ~]#&nbsp;<strong>cp -ivp \/etc\/snmp\/snmpd.conf \/etc\/snmp\/snmpd.conf.org<\/strong><br>&#8216;\/etc\/snmp\/snmpd.conf&#8217; -&gt; &#8216;\/etc\/snmp\/snmpd.conf.org&#8217;<\/p>\n\n\n\n<p>#<strong>\u30d0\u30c3\u30af\u30a2\u30c3\u30d7\u306e\u78ba\u8a8d<\/strong><br>[root@AlmaLinux ~]#&nbsp;<strong>ls -la \/etc\/snmp\/<\/strong><br>\u5408\u8a08 56<br>drwxr-xr-x 2 root root 68 2\u6708 16 14:15 .<br>drwxr-xr-x. 88 root root 8192 2\u6708 3 11:40 ..<br>-rw&#8212;&#8212;- 1 root root 18853 2\u6708 1 17:00 snmpd.conf<br>-rw&#8212;&#8212;- 1 root root 18861 10\u6708 9 07:04 snmpd.conf.org<br>-rw&#8212;&#8212;- 1 root root 220 10\u6708 9 07:04 snmptrapd.conf<\/p>\n\n\n\n<p>snmpd.conf\u7de8\u96c6<br>[root@AlmaLinux ~]#&nbsp;<strong>vim \/etc\/snmp\/snmpd.conf<\/strong><\/p>\n\n\n\n<p>#41\u884c\u76ee\u306esec.name\u3068community\u3092\u7de8\u96c6\u3057\u307e\u3059\u3002<br># sec.name source community<\/p>\n\n\n\n<p>com2sec MyUser default SecuAvail# 47\u30fb48\u884c\u76ee\u3092\u7de8\u96c6\u3057\u307e\u3059\u3002<br># groupName securityModel securityName<br>group MyGroup v1 MyUser<\/p>\n\n\n\n<p>group MyGroup v2c MyUser#55\u884c\u76ee\u3092\u7de8\u96c6\u3057\u300156\u884c\u76ee\u3092\u30b3\u30e1\u30f3\u30c8\u30a2\u30a6\u30c8\u3057\u307e\u3059<br># view NAME TYPE SUBTREE [MASK]<br>view view_all included .1<br>#view systemview included .1.3.6.1.2.1.25.1.1<\/p>\n\n\n\n<p>#62\u884c\u76ee\u3092\u7de8\u96c6\u3057\u307e\u3059\u3002<br># access NAME CONTEXT MODEL LEVEL PREFX READ WRITE NOTIFY<br>access MyGroup &#8220;&#8221; any noauth exact view_all none none<\/p>\n\n\n\n<p>diff\u30b3\u30de\u30f3\u30c9\u3067<strong>\u7de8\u96c6\u5185\u5bb9\u3092\u78ba\u8a8d<\/strong>\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<p>[root@AlmaLinux ~]#&nbsp;<strong>diff \/etc\/snmp\/snmpd.conf.org \/etc\/snmp\/snmpd.conf<\/strong><br>41c41<br>&lt; com2sec notConfigUser default public<br>&#8212;<br>&gt; com2sec notConfigUser default SecuAvail<br>55,56c55,56<br>&lt; view systemview included .1.3.6.1.2.1.1<br>&lt; view systemview included .1.3.6.1.2.1.25.1.1<br>&#8212;<br>&gt; view systemview included .1<br>&gt; #view systemview included .1.3.6.1.2.1.25.1.1<\/p>\n\n\n\n<p>Firewalld\u3067SNMP\u3092\u8a31\u53ef<\/p>\n\n\n\n<p>#<strong>\u30a4\u30f3\u30bf\u30fc\u30d5\u30a7\u30fc\u30b9\u306b\u5272\u308a\u5f53\u3066\u3089\u308c\u3066\u3044\u308b\u30be\u30fc\u30f3\u306e\u78ba\u8a8d<\/strong><br>[root@AlmaLinux ~]#&nbsp;<strong>firewall-cmd &#8211;get-active-zones<\/strong><br>public<br>interfaces: ens192<\/p>\n\n\n\n<p>#SNMP\u306e\u6c38\u7d9a\u7684\u306a\u8ffd\u52a0<br>[root@AlmaLinux ~]#&nbsp;<strong>firewall-cmd &#8211;add-service=snmp &#8211;zone=public &#8211;permanent<\/strong><\/p>\n\n\n\n<p>\uff03FW\u8a2d\u5b9a\u306e\u53cd\u6620<br>[root@AlmaLinux ~]#&nbsp;<strong>firewall-cmd &#8211;reload<\/strong><\/p>\n\n\n\n<p>#\u53cd\u6620\u3055\u308c\u3066\u3044\u308b\u304b\u306e\u78ba\u8a8d<br>[root@AlmaLinux ~]#&nbsp;<strong>firewall-cmd &#8211;list-services<\/strong><br>cockpit dhcpv6-client snmp ssh<\/p>\n\n\n\n<p>SNMP\u30b5\u30fc\u30d3\u30b9\u306e\u8d77\u52d5\u3068\u81ea\u52d5\u8d77\u52d5\u8a2d\u5b9a<\/p>\n\n\n\n<p>#<strong>SNMP\u306e\u8d77\u52d5<\/strong><br>[root@AlmaLinux ~]#&nbsp;<strong>systemctl start snmpd<\/strong><\/p>\n\n\n\n<p>#SNMP\u306e\u81ea\u52d5\u8d77\u52d5\u8a2d\u5b9a<br>[root@AlmaLinux ~]#&nbsp;<strong>systemctl enable snmpd<\/strong><br>Created symlink \/etc\/systemd\/system\/multi-user.target.wants\/snmpd.service \u2192 \/usr\/lib\/systemd\/system\/snmpd.service.<\/p>\n\n\n\n<p>SNMP\u30b5\u30fc\u30d3\u30b9\u306e\u72b6\u614b\u78ba\u8a8d<\/p>\n\n\n\n<p>#<strong>\u30c7\u30fc\u30e2\u30f3\u304c\u8d77\u52d5\u3057\u3066\u3044\u308b\u304b\u306e\u78ba\u8a8d<\/strong><br>[root@AlmaLinux ~]#&nbsp;<strong>systemctl status snmpd<\/strong><br>\u25cf snmpd.service &#8211; Simple Network Management Protocol (SNMP) Daemon.<br>Loaded: loaded (\/usr\/lib\/systemd\/system\/snmpd.service; enabled; vendor preset: disabled)<br>Active: active (running) since Tue 2022-02-01 16:44:02 JST; 1min 3s ago<br>Main PID: 4355 (snmpd)<br>Tasks: 1 (limit: 101061)<br>Memory: 4.9M<br>CGroup: \/system.slice\/snmpd.service<br>mq4355 \/usr\/sbin\/snmpd -LS0-6d -f2\u6708 01 16:44:01 AlmaLinux systemd[1]: Starting Simple Network Management Protocol (SNMP) Daemon&#8230;.<br>2\u6708 01 16:44:02 AlmaLinux snmpd[4355]: NET-SNMP version 5.8<br>2\u6708 01 16:44:02 AlmaLinux systemd[1]: Started Simple Network Management Protocol (SNMP) Daemon..<\/p>\n\n\n\n<p>#<strong>\u81ea\u52d5\u8d77\u52d5\u8a2d\u5b9a\u306e\u6709\u52b9\u78ba\u8a8d<\/strong><br>[root@AlmaLinux ~]#<strong>systemctl is-enabled snmpd<\/strong><br>enabled<\/p>\n\n\n\n<p>UDP\u306e161\u756a\u30dd\u30fc\u30c8\u304c\u7a7a\u3044\u3066\u3044\u308b\u3053\u3068\u3092\u78ba\u8a8d\u3057\u307e\u3059\u3002<br><strong>\u30dd\u30fc\u30c8\u958b\u653e\u306e\u78ba\u8a8d<\/strong><br>[root@AlmaLinux ~]#&nbsp;<strong>ss -una<\/strong><br>State Recv-Q Send-Q Local Address:Port Peer Address:Port Process<br>UNCONN 0 0 0.0.0.0:161 0.0.0.0:*<br>UNCONN 0 0 127.0.0.1:323 0.0.0.0:*<br>UNCONN 0 0 [::1]:323 [::]:*<\/p>\n\n\n\n<p><strong>snmpwalk\u30b3\u30de\u30f3\u30c9\u3067\u5024\u304c\u53d6\u308c\u308b\u304b\u3092\u78ba\u8a8d<\/strong><br>\u3053\u3053\u3067\u306fCPU\u4f7f\u7528\u7387\u306eOID\u3092\u6307\u5b9a\u3057\u3066\u3044\u307e\u3059\u3002<br>[root@AlmaLinux ~]#&nbsp;<strong>snmpwalk -v 2c -c SecuAvail localhost .1.3.6.1.4.1.2021.11.51.0<\/strong><br>UCD-SNMP-MIB::ssCpuRawNice.0 = Counter32: 14277<\/p>\n\n\n\n<p>\u30ed\u30b0\u3092\u53ce\u96c6\u3059\u308b\u8a2d\u5b9a\uff5cLSC\u8a2d\u5b9a<\/p>\n\n\n\n<p>**********************************************************************<\/p>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>********************************************************************** root@falcon21:~#&nbsp;yum install net-s [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-282","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/falcon21.space\/kazuya\/work\/index.php?rest_route=\/wp\/v2\/pages\/282","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/falcon21.space\/kazuya\/work\/index.php?rest_route=\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/falcon21.space\/kazuya\/work\/index.php?rest_route=\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/falcon21.space\/kazuya\/work\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/falcon21.space\/kazuya\/work\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=282"}],"version-history":[{"count":1,"href":"https:\/\/falcon21.space\/kazuya\/work\/index.php?rest_route=\/wp\/v2\/pages\/282\/revisions"}],"predecessor-version":[{"id":283,"href":"https:\/\/falcon21.space\/kazuya\/work\/index.php?rest_route=\/wp\/v2\/pages\/282\/revisions\/283"}],"wp:attachment":[{"href":"https:\/\/falcon21.space\/kazuya\/work\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=282"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}