{"id":142,"date":"2019-05-14T20:40:27","date_gmt":"2019-05-14T18:40:27","guid":{"rendered":"http:\/\/www.underealm.com\/tech\/?p=142"},"modified":"2019-05-14T20:40:27","modified_gmt":"2019-05-14T18:40:27","slug":"ossec-troubleshooting","status":"publish","type":"post","link":"https:\/\/www.underealm.com\/tech\/2019\/05\/ossec-troubleshooting\/","title":{"rendered":"OSSEC troubleshooting"},"content":{"rendered":"<p>Today we continue the saga of things I was supposed to write down but didn\u2019t, for reasons unknown. Suppose you migrated your OSSEC management server, or freshly installed what will be the new manager on a new OS. You import the keys, <a href=\"https:\/\/www.underealm.com\/tech\/2014\/09\/ossec-splunk-installation\/\">as described in my previous post<\/a>, but the connection fails for one or both of these reasons:<\/p>\n<ul>\n<li><code>ossec-remoted(1403): ERROR: Incorrectly formatted message from '&lt;client_ip&gt;'.<\/code> \u2013 Pick your own adventure-style error message.<\/li>\n<li><code><span class=\"crayon-v\">ossec<\/span><span class=\"crayon-o\">-<\/span><span class=\"crayon-e\">agentd<\/span><span class=\"crayon-sy\">(<\/span><span class=\"crayon-cn\">1407<\/span><span class=\"crayon-sy\">)<\/span><span class=\"crayon-v\">: ERROR<\/span><span class=\"crayon-v\">: Duplicated<\/span> <span class=\"crayon-e\">counter <\/span><span class=\"crayon-v\">for<\/span> <span class=\"crayon-s\">'&lt;server_name&gt;'<\/span><span class=\"crayon-sy\">.<\/span><\/code> \u2013 Incorrect serials.<\/li>\n<\/ul>\n<p>This has happened several times over the course of the last decade, due to client\/server version mismatch, drive failures, and what have you. There\u2019s a pretty brute-force way to solve these problems, though:<\/p>\n<ul>\n<li>stop both server and client;<\/li>\n<li>on the client, delete everything inside <code>\/var\/ossec\/queue\/rids<\/code>;<\/li>\n<li>reimport the key on the client (unsure if this step is really needed);<\/li>\n<li>start the server;<\/li>\n<li>test that the client is working, via <code>ossec-agentd -d -f<\/code>.<\/li>\n<li>if the client is working, start the service.<\/li>\n<\/ul>\n<p>That\u2019s it. There\u2019s nothing that a good ol\u2019 <code>rm -rf *<\/code> can\u2019t solve.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Today we continue the saga of things I was supposed to write down but didn\u2019t, for reasons unknown. Suppose you migrated your OSSEC management server, or freshly installed what will be the new manager on a new OS. You import the keys, as described in my previous post, but the connection fails for one or [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[32,4],"tags":[33,60,78],"class_list":["post-142","post","type-post","status-publish","format-standard","hentry","category-antifud","category-ossec","tag-antifud-2","tag-ossec","tag-troubleshooting"],"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/www.underealm.com\/tech\/wp-json\/wp\/v2\/posts\/142"}],"collection":[{"href":"https:\/\/www.underealm.com\/tech\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.underealm.com\/tech\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.underealm.com\/tech\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.underealm.com\/tech\/wp-json\/wp\/v2\/comments?post=142"}],"version-history":[{"count":1,"href":"https:\/\/www.underealm.com\/tech\/wp-json\/wp\/v2\/posts\/142\/revisions"}],"predecessor-version":[{"id":143,"href":"https:\/\/www.underealm.com\/tech\/wp-json\/wp\/v2\/posts\/142\/revisions\/143"}],"wp:attachment":[{"href":"https:\/\/www.underealm.com\/tech\/wp-json\/wp\/v2\/media?parent=142"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.underealm.com\/tech\/wp-json\/wp\/v2\/categories?post=142"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.underealm.com\/tech\/wp-json\/wp\/v2\/tags?post=142"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}