Não é possível iniciar o snmpd corretamente

1

Eu estou tentando configurar o snmp em um servidor do Ubuntu 15.10 para executar alguns testes. Eu instalei o snmp como:

sudo apt-get install snmp snmpd snmp-mibs-downloader

Após a instalação, comentei a seguinte linha em /etc/snmp/snmp.conf :

#mibs :

Estou tentando iniciar o processo snmpd no ubuntu-server 15.10, mas ele falha se eu fizer isso:

sudo service snmpd start

Estou com o seguinte erro:

Job for snmpd.service failed because the control process exited with error code. See "systemctl status snmpd.service" and "journalctl -xe" for details.

No entanto, se eu fizer $ sudo /usr/sbin/snmpd -f , posso iniciar o serviço quando verifiquei se ele funciona com o comando snmpwalk . No entanto, também gera alguns erros:

$ 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

Eu tentei procurar uma solução, mas não consegui encontrar absolutamente nada. Alguém pode ajudar?

Também copio e colo a saída dos dois comandos anteriores:

$ 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.

Obrigado!

    
por KoTy 15.03.2016 / 15:55

1 resposta

2

Eu consertei o mesmo problema usando este tutorial

Você precisa editar o arquivo /etc/snmp/snmpd.conf alterando a diretiva agentAddress de acordo. Em seguida, use createUser e rwuser , criando um usuário e fornecendo o nível adequado de acesso, respectivamente.

O deve ser assim.

#  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

Saudações, CV

    
por 08.02.2017 / 08:46