いくつかのテストを実行するために、ubuntu-server 15.10でsnmpをセットアップしようとしています。私はsnmpを次のようにインストールしました:
Sudo apt-get install snmp snmpd snmp-mibs-downloader
インストール後、/etc/snmp/snmp.conf
の次の行にコメントしました。
#mibs :
私はubuntu-server 15.10でプロセスsnmpdを開始しようとしていますが、実行すると失敗します。
Sudo service snmpd start
次のエラーが発生します:
Job for snmpd.service failed because the control process exited with error code. See "systemctl status snmpd.service" and "journalctl -xe" for details.
ただし、$ Sudo /usr/sbin/snmpd -f
を実行すると、コマンドsnmpwalk
で機能することを確認したので、サービスを開始できます。ただし、いくつかのエラーも発生します。
$ Sudo /usr/sbin/snmpd -f
Cannot statfs /sys/fs/cgroup/systemd: No such file or directory
Cannot statfs /sys/fs/cgroup/cpu,cpuacct: No such file or directory
Cannot statfs /sys/fs/cgroup/freezer: No such file or directory
Cannot statfs /sys/fs/cgroup/net_cls,net_prio: No such file or directory
Cannot statfs /sys/fs/cgroup/cpuset: No such file or directory
Cannot statfs /sys/fs/cgroup/blkio: No such file or directory
Cannot statfs /sys/fs/cgroup/perf_event: No such file or directory
Cannot statfs /sys/fs/cgroup/hugetlb: No such file or directory
Cannot statfs /sys/fs/cgroup/memory: No such file or directory
Cannot statfs /sys/fs/cgroup/devices: No such file or directory
Turning on AgentX master support.
NET-SNMP version 5.7.3
解決策を探してみましたが、なかなか見つかりませんでした。誰かが助けることができますか?
また、前の2つのコマンドの出力をコピーして貼り付けます。
$ systemctl status snmpd.service
● snmpd.service - LSB: SNMP agents
Loaded: loaded (/etc/init.d/snmpd)
Active: failed (Result: exit-code) since Tue 2016-03-15 15:32:18 CET; 9min ago
Docs: man:systemd-sysv-generator(8)
Process: 15559 ExecStart=/etc/init.d/snmpd start (code=exited, status=219/CGROUP)
Mar 15 15:32:18 ubuntu-server systemd[1]: Starting LSB: SNMP agents...
Mar 15 15:32:18 ubuntu-server systemd[1]: snmpd.service: Control process exited, code=exited status=219
Mar 15 15:32:18 ubuntu-server systemd[1]: Failed to start LSB: SNMP agents.
Mar 15 15:32:18 ubuntu-server systemd[1]: snmpd.service: Unit entered failed state.
Mar 15 15:32:18 ubuntu-server systemd[1]: snmpd.service: Failed with result 'exit-code'.
$journalctl -xe
Mar 15 15:43:57 ubuntu-server systemd[1]: Failed to realize cgroups for queued unit system-getty.slice: No such file or directory
Mar 15 15:43:57 ubuntu-server systemd[1]: Failed to create cgroup : No such file or directory
Mar 15 15:43:57 ubuntu-server systemd[1]: Failed to realize cgroups for queued unit systemd-modules-load.service: No such file or directory
Mar 15 15:43:57 ubuntu-server systemd[1]: Failed to create cgroup : No such file or directory
Mar 15 15:43:57 ubuntu-server systemd[1]: Failed to realize cgroups for queued unit systemd-vconsole-setup.service: No such file or directory
Mar 15 15:43:57 ubuntu-server systemd[1]: Failed to create cgroup : No such file or directory
Mar 15 15:43:57 ubuntu-server systemd[1]: Failed to realize cgroups for queued unit apport.service: No such file or directory
Mar 15 15:43:57 ubuntu-server systemd[1]: Failed to create cgroup : No such file or directory
Mar 15 15:43:57 ubuntu-server systemd[1]: Failed to realize cgroups for queued unit samba-ad-dc.service: No such file or directory
Mar 15 15:43:57 ubuntu-server systemd[1]: Failed to create cgroup : No such file or directory
Mar 15 15:43:57 ubuntu-server systemd[1]: Failed to realize cgroups for queued unit dbus.service: No such file or directory
Mar 15 15:43:57 ubuntu-server systemd[1]: Failed to create cgroup : No such file or directory
Mar 15 15:43:57 ubuntu-server systemd[1]: Failed to realize cgroups for queued unit systemd-journald.service: No such file or directory
Mar 15 15:43:57 ubuntu-server systemd[1]: Failed to create cgroup : No such file or directory
Mar 15 15:43:57 ubuntu-server systemd[1]: Failed to realize cgroups for queued unit dev-mqueue.mount: No such file or directory
Mar 15 15:43:57 ubuntu-server systemd[1]: Failed to create cgroup : No such file or directory
Mar 15 15:43:57 ubuntu-server systemd[1]: Failed to realize cgroups for queued unit sys-fs-Fuse-connections.mount: No such file or directory
Mar 15 15:43:57 ubuntu-server systemd[1]: Failed to create cgroup : No such file or directory
Mar 15 15:43:57 ubuntu-server systemd[1]: Failed to realize cgroups for queued unit ifup-wait-all-auto.service: No such file or directory
Mar 15 15:43:57 ubuntu-server systemd[1]: Failed to create cgroup : No such file or directory
Mar 15 15:43:57 ubuntu-server systemd[1]: Failed to realize cgroups for queued unit dev-sda5.swap: No such file or directory
Mar 15 15:43:57 ubuntu-server systemd[1]: Failed to create cgroup : No such file or directory
Mar 15 15:43:57 ubuntu-server systemd[1]: Failed to realize cgroups for queued unit systemd-user-sessions.service: No such file or directory
Mar 15 15:43:57 ubuntu-server systemd[1]: Failed to create cgroup : No such file or directory
Mar 15 15:43:57 ubuntu-server systemd[1]: Failed to realize cgroups for queued unit resolvconf.service: No such file or directory
Mar 15 15:43:57 ubuntu-server systemd[1]: Failed to create cgroup : No such file or directory
Mar 15 15:43:57 ubuntu-server systemd[1]: Failed to realize cgroups for queued unit nmbd.service: No such file or directory
Mar 15 15:43:57 ubuntu-server systemd[1]: Failed to create cgroup : No such file or directory
Mar 15 15:43:57 ubuntu-server systemd[1]: Failed to realize cgroups for queued unit systemd-timesyncd.service: No such file or directory
Mar 15 15:43:57 ubuntu-server systemd[1]: Failed to create cgroup : No such file or directory
Mar 15 15:43:57 ubuntu-server systemd[1]: Failed to realize cgroups for queued unit dev-hugepages.mount: No such file or directory
Mar 15 15:43:57 ubuntu-server systemd[1]: Failed to create cgroup : No such file or directory
Mar 15 15:43:57 ubuntu-server systemd[1]: Failed to realize cgroups for queued unit Tomcat7.service: No such file or directory
Mar 15 15:43:57 ubuntu-server systemd[1]: Failed to create cgroup : No such file or directory
Mar 15 15:43:57 ubuntu-server systemd[1]: Failed to realize cgroups for queued unit dev-disk-by\x2duuid-e0924ced\x2deab6\x2d4590\x2d96e7\x2ddba3bba25688.swap: No such file or directory
Mar 15 15:43:57 ubuntu-server systemd[1]: Failed to create cgroup : No such file or directory
Mar 15 15:43:57 ubuntu-server systemd[1]: Failed to realize cgroups for queued unit rsyslog.service: No such file or directory
Mar 15 15:43:57 ubuntu-server systemd[1]: Failed to create cgroup : No such file or directory
Mar 15 15:43:57 ubuntu-server systemd[1]: Failed to realize cgroups for queued unit systemd-tmpfiles-setup.service: No such file or directory
Mar 15 15:43:57 ubuntu-server systemd[1]: Failed to create cgroup : No such file or directory
Mar 15 15:43:57 ubuntu-server systemd[1]: Failed to realize cgroups for queued unit dev-disk-by\x2did-ata\x2dWDC_WD10EZEX\x2d08M2NA0_WD\x2dWCC3F3528610\x2dpart5.swap: No such file or directory
Mar 15 15:43:57 ubuntu-server systemd[1]: Failed to create cgroup : No such file or directory
Mar 15 15:43:57 ubuntu-server systemd[1]: Failed to realize cgroups for queued unit cron.service: No such file or directory
Mar 15 15:43:57 ubuntu-server systemd[1]: Failed to create cgroup : No such file or directory
Mar 15 15:43:57 ubuntu-server systemd[1]: Failed to realize cgroups for queued unit winbind.service: No such file or directory
Mar 15 15:43:57 ubuntu-server systemd[1]: Failed to create cgroup : No such file or directory
Mar 15 15:43:57 ubuntu-server systemd[1]: Failed to realize cgroups for queued unit systemd-update-utmp.service: No such file or directory
Mar 15 15:43:57 ubuntu-server systemd[1]: Failed to create cgroup : No such file or directory
Mar 15 15:43:57 ubuntu-server systemd[1]: Failed to realize cgroups for queued unit Apache2.service: No such file or directory
Mar 15 15:43:57 ubuntu-server systemd[1]: Failed to create cgroup : No such file or directory
Mar 15 15:43:57 ubuntu-server systemd[1]: Failed to realize cgroups for queued unit networking.service: No such file or directory
Mar 15 15:43:57 ubuntu-server systemd[1]: Failed to create cgroup : No such file or directory
Mar 15 15:43:57 ubuntu-server systemd[1]: Failed to realize cgroups for queued unit dev-disk-by\x2did-wwn\x2d0x50014ee25f55a721\x2dpart5.swap: No such file or directory
Mar 15 15:43:57 ubuntu-server systemd[1]: Failed to create cgroup : No such file or directory
Mar 15 15:43:57 ubuntu-server systemd[1]: Failed to realize cgroups for queued unit system-postgresql.slice: No such file or directory
Mar 15 15:43:57 ubuntu-server systemd[1]: Failed to create cgroup : No such file or directory
Mar 15 15:43:57 ubuntu-server systemd[1]: Failed to realize cgroups for queued unit systemd-udev-trigger.service: No such file or directory
Mar 15 15:43:57 ubuntu-server systemd[1]: smbd.service: Control process exited, code=exited status=219
Mar 15 15:43:57 ubuntu-server systemd[1]: Reload failed for LSB: start Samba SMB/CIFS daemon (smbd).
-- Subject: Unit smbd.service has finished reloading its configuration
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit smbd.service has finished reloading its configuration
--
-- The result is failed.
Mar 15 15:43:57 ubuntu-server dhclient[712]: bound to 192.168.137.153 -- renewal in 291 seconds.
ありがとう!
このチュートリアル を使用して同じ問題を修正しました
ファイル/ etc/snmp/snmpd.confを編集して、agentAddressディレクティブを適宜変更する必要があります。次に、createUserおよびrwuserを使用して、ユーザーを作成し、適切なレベルのアクセス権をそれぞれ付与します。
は次のようになります。
# Listen for connections from the local system only
#agentAddress udp:127.0.0.1:161 # <= comment this line
# Listen for connections on all interfaces (both IPv4 *and* IPv6)
agentAddress udp:161,udp6:[::1]:161
createUser bootstrap MD5 temp_password DES
rwuser bootstrap priv
rwuser demo priv
挨拶、CV