We're trying to get Wazuh running on a RaspberryPi with Raspbian OS. We have successfully compiled and run the Wazuh Server v3.6.1 and this is the output status that we get before connecting any agent:
As you can see, the "ossec-remoted" process is up and running. Then, we succesfully register a remote agent:
The problem comes when the agent is started. Taking a look at the /var/ossec/logs/ossec.log (on the agent host) file it seems that the connection is succesfully established but after a while some ERROR messages start to appear:
2018/10/31 16:45:00 ossec-execd: INFO: No option <ca_store> defined. Using Wazuh default CA (/var/ossec/etc/wpk_root.pem).
2018/10/31 16:45:00 ossec-execd: INFO: Started (pid: 20377).
2018/10/31 16:45:00 ossec-agentd: WARNING: The <server-ip> tag is deprecated, please use <server><address> instead.
2018/10/31 16:45:00 ossec-agentd: WARNING: The <protocol> tag is deprecated, please use <server><protocol> instead.
2018/10/31 16:45:00 ossec-agentd: WARNING: The <length> tag is deprecated for version newer than 2.1.1, please use <queue_size> instead.
2018/10/31 16:45:00 ossec-agentd: INFO: Using notify time: 10 and max time to reconnect: 60
2018/10/31 16:45:00 ossec-agentd: INFO: Version detected -> Linux |idilab |4.9.0-8-amd64 |#1 SMP Debian 4.9.110-3+deb9u4 (2018-08-21) |x86_64 [Debian GNU/Linux|debian: 9 (stretch)] - Wazuh v3.6.1
2018/10/31 16:45:00 ossec-agentd: INFO: (1410): Reading authentication keys file.
2018/10/31 16:45:00 ossec-agentd: INFO: Using AES as encryption method.
2018/10/31 16:45:00 ossec-agentd: INFO: Started (pid: 20383).
2018/10/31 16:45:00 ossec-agentd: INFO: Server IP Address: 192.168.20.2
2018/10/31 16:45:00 wazuh-modulesd: INFO: Process started.
2018/10/31 16:45:00 wazuh-modulesd:oscap: INFO: Module disabled. Exiting...
2018/10/31 16:45:03 ossec-syscheckd: INFO: Started (pid: 20390).
2018/10/31 16:45:03 ossec-syscheckd: INFO: Monitoring directory: '/etc', with options perm | size | owner | group | md5sum | sha1sum | sha256sum | mtime | inode.
2018/10/31 16:45:03 ossec-syscheckd: INFO: Monitoring directory: '/usr/bin', with options perm | size | owner | group | md5sum | sha1sum | sha256sum | mtime | inode.
2018/10/31 16:45:03 ossec-syscheckd: INFO: Monitoring directory: '/usr/sbin', with options perm | size | owner | group | md5sum | sha1sum | sha256sum | mtime | inode.
2018/10/31 16:45:03 ossec-syscheckd: INFO: Monitoring directory: '/bin', with options perm | size | owner | group | md5sum | sha1sum | sha256sum | mtime | inode.
2018/10/31 16:45:03 ossec-syscheckd: INFO: Monitoring directory: '/sbin', with options perm | size | owner | group | md5sum | sha1sum | sha256sum | mtime | inode.
2018/10/31 16:45:03 ossec-syscheckd: INFO: Monitoring directory: '/boot', with options perm | size | owner | group | md5sum | sha1sum | sha256sum | mtime | inode.
2018/10/31 16:45:03 ossec-syscheckd: INFO: Ignoring: '/etc/mtab'
2018/10/31 16:45:03 ossec-syscheckd: INFO: Ignoring: '/etc/hosts.deny'
2018/10/31 16:45:03 ossec-syscheckd: INFO: Ignoring: '/etc/mail/statistics'
2018/10/31 16:45:03 ossec-syscheckd: INFO: Ignoring: '/etc/random-seed'
2018/10/31 16:45:03 ossec-syscheckd: INFO: Ignoring: '/etc/random.seed'
2018/10/31 16:45:03 ossec-syscheckd: INFO: Ignoring: '/etc/adjtime'
2018/10/31 16:45:03 ossec-syscheckd: INFO: Ignoring: '/etc/httpd/logs'
2018/10/31 16:45:03 ossec-syscheckd: INFO: Ignoring: '/etc/utmpx'
2018/10/31 16:45:03 ossec-syscheckd: INFO: Ignoring: '/etc/wtmpx'
2018/10/31 16:45:03 ossec-syscheckd: INFO: Ignoring: '/etc/cups/certs'
2018/10/31 16:45:03 ossec-syscheckd: INFO: Ignoring: '/etc/dumpdates'
2018/10/31 16:45:03 ossec-syscheckd: INFO: Ignoring: '/etc/svc/volatile'
2018/10/31 16:45:03 ossec-syscheckd: INFO: No diff for file: '/etc/ssl/private.key'
2018/10/31 16:45:03 rootcheck: INFO: Started (pid: 20390).
2018/10/31 16:45:06 ossec-logcollector: INFO: Monitoring output of command(360): df -P
2018/10/31 16:45:06 ossec-logcollector: INFO: Monitoring full output of command(360): netstat -tulpen | sort
2018/10/31 16:45:06 ossec-logcollector: INFO: Monitoring full output of command(360): last -n 20
2018/10/31 16:45:06 ossec-logcollector: INFO: (1950): Analyzing file: '/var/ossec/logs/active-responses.log'.
2018/10/31 16:45:06 ossec-logcollector: INFO: (1950): Analyzing file: '/var/log/messages'.
2018/10/31 16:45:06 ossec-logcollector: INFO: (1950): Analyzing file: '/var/log/auth.log'.
2018/10/31 16:45:06 ossec-logcollector: INFO: (1950): Analyzing file: '/var/log/syslog'.
2018/10/31 16:45:06 ossec-logcollector: INFO: (1950): Analyzing file: '/var/log/dpkg.log'.
2018/10/31 16:45:06 ossec-logcollector: INFO: (1950): Analyzing file: '/var/log/kern.log'.
2018/10/31 16:45:06 ossec-logcollector: INFO: Started (pid: 20394).
2018/10/31 16:45:18 ossec-syscheckd: INFO: Syscheck scan frequency: 43200 seconds
2018/10/31 16:45:18 rootcheck: INFO: Starting rootcheck scan.
2018/10/31 16:45:33 ossec-syscheckd: INFO: Starting syscheck scan (forwarding database).
2018/10/31 16:45:33 ossec-syscheckd: INFO: Starting syscheck database (pre-scan).
2018/10/31 16:46:02 ossec-agentd: WARNING: Server unavailable. Setting lock.
2018/10/31 16:46:02 ossec-agentd: WARNING: Process locked due to agent is offline. Waiting for connection...
2018/10/31 16:46:02 ossec-syscheckd: WARNING: Process locked due to agent is offline. Waiting for connection...
2018/10/31 16:46:03 ossec-logcollector: WARNING: Process locked due to agent is offline. Waiting for connection...
2018/10/31 16:46:12 ossec-agentd: ERROR: (1218): Unable to send message to 'server': Connection refused
2018/10/31 16:46:16 ossec-syscheckd: WARNING: Process locked due to agent is offline. Waiting for connection...
2018/10/31 16:46:24 ossec-agentd: ERROR: (1218): Unable to send message to 'server': Connection refused
2018/10/31 16:46:25 ossec-agentd: WARNING: (4101): Waiting for server reply (not started). Tried: '192.168.20.2'.
2018/10/31 16:46:37 ossec-agentd: ERROR: (1218): Unable to send message to 'server': Connection refused
2018/10/31 16:46:49 ossec-agentd: ERROR: (1218): Unable to send message to 'server': Connection refused
2018/10/31 16:46:50 ossec-agentd: WARNING: (4101): Waiting for server reply (not started). Tried: '192.168.20.2'.
2018/10/31 16:47:11 ossec-agentd: ERROR: (1218): Unable to send message to 'server': Connection refused
2018/10/31 16:47:23 ossec-agentd: ERROR: (1218): Unable to send message to 'server': Connection refused
2018/10/31 16:47:24 ossec-agentd: WARNING: (4101): Waiting for server reply (not started). Tried: '192.168.20.2'.
2018/10/31 16:47:45 ossec-agentd: ERROR: (1218): Unable to send message to 'server': Connection refused
2018/10/31 16:47:57 ossec-agentd: ERROR: (1218): Unable to send message to 'server': Connection refused
Going back to the Wazuh-server host now we can see that the "ossec-remoted" process is not running anymore:
The Wazuh server (with all the processes) has been running successfuly for hours and only when the agent has been launched the "ossec-remoted" process has stopped.
Any ideas of what could be the problem? thanks in advance for your help.