{"id":6289,"date":"2021-11-15T19:10:37","date_gmt":"2021-11-15T19:10:37","guid":{"rendered":"https:\/\/www.geekdecoder.com\/?p=6289"},"modified":"2021-11-15T19:10:37","modified_gmt":"2021-11-15T19:10:37","slug":"psk-in-zabbix","status":"publish","type":"post","link":"https:\/\/www.qbytes.cloud\/index.php\/2021\/11\/15\/psk-in-zabbix\/","title":{"rendered":"PSK in Zabbix"},"content":{"rendered":"<p>Generate a key:<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\n# openssl rand -hex 32\nc68a0164045a04ea2f1d821e3d3275e782d671a166613b3d81c07f99e3b92843\n<\/pre>\n<p>Configuring PSK for server-agent communication<br \/>\nOn the hos, edit the zabbix agent file<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\nnano \/etc\/zabbix\/zabbix_agentd.conf\n<\/pre>\n<p>Add:<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\n####### TLS-RELATED PARAMETERS #######\nTLSConnect=psk\nTLSAccept=psk\nTLSPSKIdentity=PSK 001\nTLSPSKFile=\/etc\/zabbix\/zabbix.psk\n<\/pre>\n<p>Create the \/etc\/zabbix\/zabbix.psk file:<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\necho c68a0164045a04ea2f1d821e3d3275e782d671a166613b3d81c07f99e3b92843 &gt; \/etc\/zabbix\/zabbix.psk\n<\/pre>\n<p> Restart the agent. <\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\nsystemctl restart  zabbix-agent.service\n<\/pre>\n<p>Now you can test the connection using zabbix_get, for example:<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\n$ zabbix_get -s 127.0.0.1 -k &quot;system.cpu.load&#x5B;all,avg1]&quot; --tls-connect=psk \\\n            --tls-psk-identity=&quot;PSK 001&quot; --tls-psk-file=\/etc\/zabbix\/zabbix.psk\n<\/pre>\n<p> Configure PSK encryption for this agent in Zabbix frontend:<\/p>\n<p>    Go to: Configuration \u2192 Hosts<br \/>\n    Select host and click on Encryption tab<br \/>\n<a href=\"https:\/\/qbytes.cloud\/wp-content\/uploads\/2021\/11\/Screenshot-2021-11-15-131010.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/qbytes.cloud\/wp-content\/uploads\/2021\/11\/Screenshot-2021-11-15-131010.png\" alt=\"\" width=\"839\" height=\"378\" class=\"alignnone size-full wp-image-6290\" srcset=\"https:\/\/www.qbytes.cloud\/wp-content\/uploads\/2021\/11\/Screenshot-2021-11-15-131010.png 839w, https:\/\/www.qbytes.cloud\/wp-content\/uploads\/2021\/11\/Screenshot-2021-11-15-131010-300x135.png 300w, https:\/\/www.qbytes.cloud\/wp-content\/uploads\/2021\/11\/Screenshot-2021-11-15-131010-768x346.png 768w\" sizes=\"auto, (max-width: 839px) 100vw, 839px\" \/><\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Generate a key: # openssl rand -hex 32 c68a0164045a04ea2f1d821e3d3275e782d671a166613b3d81c07f99e3b92843 Configuring PSK for server-agent communication On the hos, edit the zabbix agent file nano \/etc\/zabbix\/zabbix_agentd.conf Add: ####### TLS-RELATED PARAMETERS ####### TLSConnect=psk TLSAccept=psk TLSPSKIdentity=PSK 001 TLSPSKFile=\/etc\/zabbix\/zabbix.psk Create the \/etc\/zabbix\/zabbix.psk file: echo c68a0164045a04ea2f1d821e3d3275e782d671a166613b3d81c07f99e3b92843 &gt; \/etc\/zabbix\/zabbix.psk Restart the agent. systemctl restart zabbix-agent.service Now you can test the connection using &#8230; <a title=\"PSK in Zabbix\" class=\"read-more\" href=\"https:\/\/www.qbytes.cloud\/index.php\/2021\/11\/15\/psk-in-zabbix\/\" aria-label=\"Read more about PSK in Zabbix\">Read more<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[133],"tags":[],"class_list":["post-6289","post","type-post","status-publish","format-standard","hentry","category-zabbix"],"_links":{"self":[{"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/posts\/6289","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/comments?post=6289"}],"version-history":[{"count":0,"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/posts\/6289\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/media?parent=6289"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/categories?post=6289"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/tags?post=6289"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}