{"id":318,"date":"2013-01-11T18:18:14","date_gmt":"2013-01-11T17:18:14","guid":{"rendered":"http:\/\/www.nax.cz\/?p=318"},"modified":"2013-01-11T18:18:14","modified_gmt":"2013-01-11T17:18:14","slug":"quick-export-of-data-metrics-from-zabbix-server-to-csv","status":"publish","type":"post","link":"https:\/\/nax.cz\/?p=318","title":{"rendered":"quick export of data metrics from zabbix server to CSV"},"content":{"rendered":"<p>In Zabbix you easily navigate to Latest Data tab and select Values in small combo box and then click &#8222;Plain text&#8220;. This way you can export 1 metrics at a time. But what if you want to export all metrics for particular host? We are using Postgresql and there isn&#8217;t anything easier:<\/p>\n<p><code><br \/>\ncopy (<br \/>\nselect h.host,<br \/>\n         i.description,<br \/>\n         TIMESTAMP WITH TIME ZONE 'epoch' + v.clock * INTERVAL '1 second' as clock,<br \/>\n         v.value<br \/>\nfrom hosts h, items i, history_uint v<br \/>\nwhere h.hostid = i.hostid<br \/>\nand i.itemid=v.itemid<br \/>\nand h.host like 'slaves%' and clock > 1356080228<br \/>\n) to '\/var\/tmp\/export\/slaves.csv' with csv header;<br \/>\n<\/code><\/p>\n","protected":false},"excerpt":{"rendered":"<p>In Zabbix you easily navigate to Latest Data tab and select Values in small combo box and then click &#8222;Plain text&#8220;. This way you can export 1 metrics at a time. But what if you want to export all metrics for particular host? We are using Postgresql and there isn&#8217;t anything easier: copy ( select [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-318","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/nax.cz\/index.php?rest_route=\/wp\/v2\/posts\/318","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/nax.cz\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/nax.cz\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/nax.cz\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/nax.cz\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=318"}],"version-history":[{"count":0,"href":"https:\/\/nax.cz\/index.php?rest_route=\/wp\/v2\/posts\/318\/revisions"}],"wp:attachment":[{"href":"https:\/\/nax.cz\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=318"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/nax.cz\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=318"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/nax.cz\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=318"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}