{"id":26065,"date":"2023-06-20T09:05:16","date_gmt":"2023-06-20T07:05:16","guid":{"rendered":"https:\/\/www.dbi-services.com\/blog\/?p=26065"},"modified":"2024-09-11T10:18:34","modified_gmt":"2024-09-11T08:18:34","slug":"zabbix-automatic-item-creation","status":"publish","type":"post","link":"https:\/\/www.dbi-services.com\/blog\/zabbix-automatic-item-creation\/","title":{"rendered":"Zabbix Automatic Item Creation"},"content":{"rendered":"\n<p>In my previous Zabbix <a href=\"https:\/\/www.dbi-services.com\/blog\/zabbix-defining-custom-monitoring-metric\/\" target=\"_blank\" rel=\"noreferrer noopener\">blog post<\/a>, I wanted to monitor JVM garbage collection metrics. As there are 17 items to create, I looked for a way to automatically create them. I found it \ud83d\ude42 . In this blog, I will also demonstrate how to create:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>A template<\/li>\n\n\n\n<li>A discovery rule<\/li>\n\n\n\n<li>An item prototype<\/li>\n<\/ul>\n\n\n\n<p>Note that configuration created in previous blog was removed before creating the template.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Template<\/h2>\n\n\n\n<p>Create a template is easy. From left menu, select <em>Data collection<\/em>, click <em>Templates<\/em> and <em>Create template<\/em>:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"418\" src=\"http:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2023\/06\/2023-06-19-17_04_02-zabbix_-Configuration-of-templates-\u2014-Mozilla-Firefox-1024x418.png\" alt=\"\" class=\"wp-image-26071\" srcset=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2023\/06\/2023-06-19-17_04_02-zabbix_-Configuration-of-templates-\u2014-Mozilla-Firefox-1024x418.png 1024w, https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2023\/06\/2023-06-19-17_04_02-zabbix_-Configuration-of-templates-\u2014-Mozilla-Firefox-300x122.png 300w, https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2023\/06\/2023-06-19-17_04_02-zabbix_-Configuration-of-templates-\u2014-Mozilla-Firefox-768x313.png 768w, https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2023\/06\/2023-06-19-17_04_02-zabbix_-Configuration-of-templates-\u2014-Mozilla-Firefox-1536x627.png 1536w, https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2023\/06\/2023-06-19-17_04_02-zabbix_-Configuration-of-templates-\u2014-Mozilla-Firefox.png 1593w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Master Item<\/h2>\n\n\n\n<p>Creating the master item, which will be used for dependent items, is not different from previous <a href=\"https:\/\/www.dbi-services.com\/blog\/zabbix-defining-custom-monitoring-metric\/\" target=\"_blank\" rel=\"noreferrer noopener\">blog<\/a>:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Item definition:<\/li>\n<\/ul>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"719\" src=\"http:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2023\/06\/2023-06-19-17_18_28-zabbix_-Configuration-of-items-\u2014-Mozilla-Firefox-1024x719.png\" alt=\"\" class=\"wp-image-26075\" srcset=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2023\/06\/2023-06-19-17_18_28-zabbix_-Configuration-of-items-\u2014-Mozilla-Firefox-1024x719.png 1024w, https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2023\/06\/2023-06-19-17_18_28-zabbix_-Configuration-of-items-\u2014-Mozilla-Firefox-300x211.png 300w, https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2023\/06\/2023-06-19-17_18_28-zabbix_-Configuration-of-items-\u2014-Mozilla-Firefox-768x539.png 768w, https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2023\/06\/2023-06-19-17_18_28-zabbix_-Configuration-of-items-\u2014-Mozilla-Firefox-1536x1078.png 1536w, https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2023\/06\/2023-06-19-17_18_28-zabbix_-Configuration-of-items-\u2014-Mozilla-Firefox.png 1593w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>Preprocessing rules:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"196\" src=\"http:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2023\/06\/2023-06-19-17_18_42-zabbix_-Configuration-of-items-\u2014-Mozilla-Firefox-1024x196.png\" alt=\"\" class=\"wp-image-26076\" srcset=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2023\/06\/2023-06-19-17_18_42-zabbix_-Configuration-of-items-\u2014-Mozilla-Firefox-1024x196.png 1024w, https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2023\/06\/2023-06-19-17_18_42-zabbix_-Configuration-of-items-\u2014-Mozilla-Firefox-300x57.png 300w, https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2023\/06\/2023-06-19-17_18_42-zabbix_-Configuration-of-items-\u2014-Mozilla-Firefox-768x147.png 768w, https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2023\/06\/2023-06-19-17_18_42-zabbix_-Configuration-of-items-\u2014-Mozilla-Firefox-1536x294.png 1536w, https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2023\/06\/2023-06-19-17_18_42-zabbix_-Configuration-of-items-\u2014-Mozilla-Firefox-2048x392.png 2048w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>Final view once master item has been created:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"264\" src=\"http:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2023\/06\/2023-06-19-17_17_02-zabbix_-Configuration-of-items-\u2014-Mozilla-Firefox-1024x264.png\" alt=\"\" class=\"wp-image-26074\" srcset=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2023\/06\/2023-06-19-17_17_02-zabbix_-Configuration-of-items-\u2014-Mozilla-Firefox-1024x264.png 1024w, https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2023\/06\/2023-06-19-17_17_02-zabbix_-Configuration-of-items-\u2014-Mozilla-Firefox-300x77.png 300w, https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2023\/06\/2023-06-19-17_17_02-zabbix_-Configuration-of-items-\u2014-Mozilla-Firefox-768x198.png 768w, https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2023\/06\/2023-06-19-17_17_02-zabbix_-Configuration-of-items-\u2014-Mozilla-Firefox-1536x397.png 1536w, https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2023\/06\/2023-06-19-17_17_02-zabbix_-Configuration-of-items-\u2014-Mozilla-Firefox-2048x529.png 2048w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Discovery Rule<\/h2>\n\n\n\n<p>In template, select <em>Discovery rule<\/em> tab and click <em>Create discover rule<\/em>. Unfortunately, discover rule does not accept a static list of value, so I had to use a trick:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Create a JSON file on the target host<\/li>\n\n\n\n<li>Use <code>vfs.file.contents<\/code> to get file content<\/li>\n<\/ul>\n\n\n\n<p><code>jstat<\/code> columns are not changing so often, so it is fine like that.<\/p>\n\n\n\n<p>Let&#8217;s create the JSON file on the server with following content:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: jscript; title: ; notranslate\" title=\"\">\n&#x5B;\n  { &quot;{#JSTATCOUNTER}&quot;: &quot;S0C&quot; },\n  { &quot;{#JSTATCOUNTER}&quot;: &quot;S1C&quot;},\n  { &quot;{#JSTATCOUNTER}&quot;: &quot;S0U&quot;},\n  { &quot;{#JSTATCOUNTER}&quot;: &quot;S1U&quot;},\n  { &quot;{#JSTATCOUNTER}&quot;: &quot;EC&quot;},\n  { &quot;{#JSTATCOUNTER}&quot;: &quot;EU&quot;},\n  { &quot;{#JSTATCOUNTER}&quot;: &quot;OC&quot;},\n  { &quot;{#JSTATCOUNTER}&quot;: &quot;OU&quot;},\n  { &quot;{#JSTATCOUNTER}&quot;: &quot;MC&quot;},\n  { &quot;{#JSTATCOUNTER}&quot;: &quot;MC&quot;},\n  { &quot;{#JSTATCOUNTER}&quot;: &quot;CCSC&quot;},\n  { &quot;{#JSTATCOUNTER}&quot;: &quot;CCSU&quot;},\n  { &quot;{#JSTATCOUNTER}&quot;: &quot;YGC&quot;},\n  { &quot;{#JSTATCOUNTER}&quot;: &quot;YGCT&quot;},\n  { &quot;{#JSTATCOUNTER}&quot;: &quot;FGC&quot;},\n  { &quot;{#JSTATCOUNTER}&quot;: &quot;FGCT&quot;},\n  { &quot;{#JSTATCOUNTER}&quot;: &quot;GCT&quot;}\n]\n<\/pre><\/div>\n\n\n<p>It is also possible to create a script, in the language of your choice, that will return the same content based on the columns from jstat output.<\/p>\n\n\n\n<p><code>{#JSTATCOUNTER}<\/code> is a custom <a href=\"https:\/\/www.zabbix.com\/documentation\/current\/en\/manual\/config\/macros\" target=\"_blank\" rel=\"noreferrer noopener\">macro<\/a>. which I will be able to use in item prototype.<\/p>\n\n\n\n<p>Now, discover rule look like that:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"603\" src=\"http:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2023\/06\/2023-06-19-17_38_21-zabbix_-Configuration-of-discovery-rules-\u2014-Mozilla-Firefox-1024x603.png\" alt=\"\" class=\"wp-image-26081\" srcset=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2023\/06\/2023-06-19-17_38_21-zabbix_-Configuration-of-discovery-rules-\u2014-Mozilla-Firefox-1024x603.png 1024w, https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2023\/06\/2023-06-19-17_38_21-zabbix_-Configuration-of-discovery-rules-\u2014-Mozilla-Firefox-300x177.png 300w, https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2023\/06\/2023-06-19-17_38_21-zabbix_-Configuration-of-discovery-rules-\u2014-Mozilla-Firefox-768x452.png 768w, https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2023\/06\/2023-06-19-17_38_21-zabbix_-Configuration-of-discovery-rules-\u2014-Mozilla-Firefox-1536x905.png 1536w, https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2023\/06\/2023-06-19-17_38_21-zabbix_-Configuration-of-discovery-rules-\u2014-Mozilla-Firefox.png 1569w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Item Prototype<\/h2>\n\n\n\n<p>Finally coming to the interesting (ie. automated) part of this blog which will save me some time.<\/p>\n\n\n\n<p>Change Type to <em>Dependent item<\/em> (same as we did in previous blog).<\/p>\n\n\n\n<p>To do that, in the <em>Discovery rules<\/em> list, click <em>Item prototypes<\/em>. and click <em>Create item prototype<\/em>.<\/p>\n\n\n\n<p><code>{#JSTATCOUNTER}<\/code> will be usable in any field of the item. In my case, I am using it in:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Item name<\/li>\n\n\n\n<li>Item Key<\/li>\n\n\n\n<li>Preprocessing rule<\/li>\n<\/ul>\n\n\n\n<p>Remember that this prototype is a dependent item thus we have to change the type and select master item.<\/p>\n\n\n\n<p>Final item looks like this:<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"910\" height=\"572\" src=\"http:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2023\/06\/2023-06-19-17_50_52-zabbix_-Configuration-of-item-prototypes-\u2014-Mozilla-Firefox.png\" alt=\"\" class=\"wp-image-26084\" srcset=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2023\/06\/2023-06-19-17_50_52-zabbix_-Configuration-of-item-prototypes-\u2014-Mozilla-Firefox.png 910w, https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2023\/06\/2023-06-19-17_50_52-zabbix_-Configuration-of-item-prototypes-\u2014-Mozilla-Firefox-300x189.png 300w, https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2023\/06\/2023-06-19-17_50_52-zabbix_-Configuration-of-item-prototypes-\u2014-Mozilla-Firefox-768x483.png 768w\" sizes=\"auto, (max-width: 910px) 100vw, 910px\" \/><\/figure>\n\n\n\n<p>And the associated <em>Preprocessing<\/em> tab:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"143\" src=\"http:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2023\/06\/2023-06-19-17_55_42-zabbix_-Configuration-of-item-prototypes-\u2014-Mozilla-Firefox-1024x143.png\" alt=\"\" class=\"wp-image-26085\" srcset=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2023\/06\/2023-06-19-17_55_42-zabbix_-Configuration-of-item-prototypes-\u2014-Mozilla-Firefox-1024x143.png 1024w, https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2023\/06\/2023-06-19-17_55_42-zabbix_-Configuration-of-item-prototypes-\u2014-Mozilla-Firefox-300x42.png 300w, https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2023\/06\/2023-06-19-17_55_42-zabbix_-Configuration-of-item-prototypes-\u2014-Mozilla-Firefox-768x107.png 768w, https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2023\/06\/2023-06-19-17_55_42-zabbix_-Configuration-of-item-prototypes-\u2014-Mozilla-Firefox.png 1170w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>It is similar definition as previous blog with addition of custom macro.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Verification<\/h2>\n\n\n\n<p>Next, we have to apply the template to the host. On the existing WildFly host, in templates field look for jstat and then Update button:<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"650\" height=\"279\" src=\"http:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2023\/06\/2023-06-19-17_59_03-zabbix_-Hosts-\u2014-Mozilla-Firefox.png\" alt=\"\" class=\"wp-image-26086\" srcset=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2023\/06\/2023-06-19-17_59_03-zabbix_-Hosts-\u2014-Mozilla-Firefox.png 650w, https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2023\/06\/2023-06-19-17_59_03-zabbix_-Hosts-\u2014-Mozilla-Firefox-300x129.png 300w\" sizes=\"auto, (max-width: 650px) 100vw, 650px\" \/><\/figure>\n\n\n\n<p>Now, if we click on hostname and Items, I can filter on &#8220;jstat&#8221; and find all my automatically created items:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"455\" src=\"http:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2023\/06\/2023-06-19-18_01_44-zabbix_-Configuration-of-items-\u2014-Mozilla-Firefox-1024x455.png\" alt=\"\" class=\"wp-image-26087\" srcset=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2023\/06\/2023-06-19-18_01_44-zabbix_-Configuration-of-items-\u2014-Mozilla-Firefox-1024x455.png 1024w, https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2023\/06\/2023-06-19-18_01_44-zabbix_-Configuration-of-items-\u2014-Mozilla-Firefox-300x133.png 300w, https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2023\/06\/2023-06-19-18_01_44-zabbix_-Configuration-of-items-\u2014-Mozilla-Firefox-768x341.png 768w, https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2023\/06\/2023-06-19-18_01_44-zabbix_-Configuration-of-items-\u2014-Mozilla-Firefox-1536x682.png 1536w, https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2023\/06\/2023-06-19-18_01_44-zabbix_-Configuration-of-items-\u2014-Mozilla-Firefox.png 1703w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>Orange means that these items were automatically discovered and created.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Is this Really Better?<\/h2>\n\n\n\n<p>You might wonder if all this was really make anything easier for me. It is, in deed, as I can export the template (in YAML, JSON or XML) and import it in any Zabbix server setup:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: jscript; title: ; notranslate\" title=\"\">\n{\n    &quot;zabbix_export&quot;: {\n        &quot;version&quot;: &quot;6.4&quot;,\n        &quot;template_groups&quot;: &#x5B;\n            {\n                &quot;uuid&quot;: &quot;a571c0d144a111b2aa9fcd6&quot;,\n                &quot;name&quot;: &quot;Templates\/Applications&quot;\n            }\n        ],\n        &quot;templates&quot;: &#x5B;\n            {\n                &quot;uuid&quot;: &quot;42c55f6c4ecd48dabdca9f2c6c5e2dca&quot;,\n                &quot;template&quot;: &quot;jstat&quot;,\n                &quot;name&quot;: &quot;jstat&quot;,\n                &quot;description&quot;: &quot;Java Virtual Machine Garbage Collection monitoring template&quot;,\n                &quot;groups&quot;: &#x5B;\n                    {\n                        &quot;name&quot;: &quot;Templates\/Applications&quot;\n                    }\n                ],\n                &quot;items&quot;: &#x5B;\n                    {\n                        &quot;uuid&quot;: &quot;5a6dce56aeb4111394bba08b9efc80a4&quot;,\n                        &quot;name&quot;: &quot;JVM GC stats&quot;,\n                        &quot;key&quot;: &quot;system.run&#x5B;sudo \/app\/Java\/jdk\/bin\/jstat -gc `pgrep java`|tr -s &#039; &#039;|cut -c2-]&quot;,\n                        &quot;trends&quot;: &quot;0&quot;,\n                        &quot;value_type&quot;: &quot;TEXT&quot;,\n                        &quot;preprocessing&quot;: &#x5B;\n                            {\n                                &quot;type&quot;: &quot;TRIM&quot;,\n                                &quot;parameters&quot;: &#x5B;\n                                    &quot; &quot;\n                                ]\n                            },\n                            {\n                                &quot;type&quot;: &quot;CSV_TO_JSON&quot;,\n                                &quot;parameters&quot;: &#x5B;\n                                    &quot; &quot;,\n                                    &quot;&quot;,\n                                    &quot;1&quot;\n                                ]\n                            }\n                        ]\n                    }\n                ],\n                &quot;discovery_rules&quot;: &#x5B;\n                    {\n                        &quot;uuid&quot;: &quot;7b8a286247d741115e11362b65ec99c&quot;,\n                        &quot;name&quot;: &quot;Discover jstat counters&quot;,\n                        &quot;key&quot;: &quot;vfs.file.contents&#x5B;\\&quot;\/tmp\/jstat_metrics.json\\&quot;]&quot;,\n                        &quot;item_prototypes&quot;: &#x5B;\n                            {\n                                &quot;uuid&quot;: &quot;c9270a10d6ec4997ae11194695ae53&quot;,\n                                &quot;name&quot;: &quot;Java jstat {#JSTATCOUNTER}&quot;,\n                                &quot;type&quot;: &quot;DEPENDENT&quot;,\n                                &quot;key&quot;: &quot;jstat.&#x5B;\\&quot;{#JSTATCOUNTER}\\&quot;]&quot;,\n                                &quot;delay&quot;: &quot;0&quot;,\n                                &quot;value_type&quot;: &quot;FLOAT&quot;,\n                                &quot;preprocessing&quot;: &#x5B;\n                                    {\n                                        &quot;type&quot;: &quot;JSONPATH&quot;,\n                                        &quot;parameters&quot;: &#x5B;\n                                            &quot;$&#x5B;0].{#JSTATCOUNTER}&quot;\n                                        ]\n                                    }\n                                ],\n                                &quot;master_item&quot;: {\n                                    &quot;key&quot;: &quot;system.run&#x5B;sudo \/app\/Java\/jdk\/bin\/jstat -gc `pgrep java`|tr -s &#039; &#039;|cut -c2-]&quot;\n                                }\n                            }\n                        ]\n                    }\n                ]\n            }\n        ]\n    }\n}\n<\/pre><\/div>","protected":false},"excerpt":{"rendered":"<p>In my previous Zabbix blog post, I wanted to monitor JVM garbage collection metrics. As there are 17 items to create, I looked for a way to automatically create them. I found it \ud83d\ude42 . In this blog, I will also demonstrate how to create: Note that configuration created in previous blog was removed before [&hellip;]<\/p>\n","protected":false},"author":40,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[197],"tags":[143,2430],"type_dbi":[],"class_list":["post-26065","post","type-post","status-publish","format-standard","hentry","category-application-integration-middleware","tag-monitoring","tag-zabbix"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v27.2 (Yoast SEO v27.2) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>Zabbix Automatic Item Creation - dbi Blog<\/title>\n<meta name=\"description\" content=\"What is the procedure to automaticaly create items in Zabbix?\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.dbi-services.com\/blog\/zabbix-automatic-item-creation\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Zabbix Automatic Item Creation\" \/>\n<meta property=\"og:description\" content=\"What is the procedure to automaticaly create items in Zabbix?\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.dbi-services.com\/blog\/zabbix-automatic-item-creation\/\" \/>\n<meta property=\"og:site_name\" content=\"dbi Blog\" \/>\n<meta property=\"article:published_time\" content=\"2023-06-20T07:05:16+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-09-11T08:18:34+00:00\" \/>\n<meta name=\"author\" content=\"Middleware Team\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Middleware Team\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.dbi-services.com\/blog\/zabbix-automatic-item-creation\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.dbi-services.com\/blog\/zabbix-automatic-item-creation\/\"},\"author\":{\"name\":\"Middleware Team\",\"@id\":\"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/8d8563acfc6e604cce6507f45bac0ea1\"},\"headline\":\"Zabbix Automatic Item Creation\",\"datePublished\":\"2023-06-20T07:05:16+00:00\",\"dateModified\":\"2024-09-11T08:18:34+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.dbi-services.com\/blog\/zabbix-automatic-item-creation\/\"},\"wordCount\":437,\"commentCount\":0,\"keywords\":[\"Monitoring\",\"Zabbix\"],\"articleSection\":[\"Application integration &amp; Middleware\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.dbi-services.com\/blog\/zabbix-automatic-item-creation\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.dbi-services.com\/blog\/zabbix-automatic-item-creation\/\",\"url\":\"https:\/\/www.dbi-services.com\/blog\/zabbix-automatic-item-creation\/\",\"name\":\"Zabbix Automatic Item Creation - dbi Blog\",\"isPartOf\":{\"@id\":\"https:\/\/www.dbi-services.com\/blog\/#website\"},\"datePublished\":\"2023-06-20T07:05:16+00:00\",\"dateModified\":\"2024-09-11T08:18:34+00:00\",\"author\":{\"@id\":\"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/8d8563acfc6e604cce6507f45bac0ea1\"},\"description\":\"What is the procedure to automaticaly create items in Zabbix?\",\"breadcrumb\":{\"@id\":\"https:\/\/www.dbi-services.com\/blog\/zabbix-automatic-item-creation\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.dbi-services.com\/blog\/zabbix-automatic-item-creation\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.dbi-services.com\/blog\/zabbix-automatic-item-creation\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Accueil\",\"item\":\"https:\/\/www.dbi-services.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Zabbix Automatic Item Creation\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.dbi-services.com\/blog\/#website\",\"url\":\"https:\/\/www.dbi-services.com\/blog\/\",\"name\":\"dbi Blog\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.dbi-services.com\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/8d8563acfc6e604cce6507f45bac0ea1\",\"name\":\"Middleware Team\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/secure.gravatar.com\/avatar\/ddcae7ba0f9d1a0e7ae707f0e689e4a9c95bb48ec49c8e6d9cc86d43f4121cb6?s=96&d=mm&r=g\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/ddcae7ba0f9d1a0e7ae707f0e689e4a9c95bb48ec49c8e6d9cc86d43f4121cb6?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/ddcae7ba0f9d1a0e7ae707f0e689e4a9c95bb48ec49c8e6d9cc86d43f4121cb6?s=96&d=mm&r=g\",\"caption\":\"Middleware Team\"},\"url\":\"https:\/\/www.dbi-services.com\/blog\/author\/middleware-team\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Zabbix Automatic Item Creation - dbi Blog","description":"What is the procedure to automaticaly create items in Zabbix?","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.dbi-services.com\/blog\/zabbix-automatic-item-creation\/","og_locale":"en_US","og_type":"article","og_title":"Zabbix Automatic Item Creation","og_description":"What is the procedure to automaticaly create items in Zabbix?","og_url":"https:\/\/www.dbi-services.com\/blog\/zabbix-automatic-item-creation\/","og_site_name":"dbi Blog","article_published_time":"2023-06-20T07:05:16+00:00","article_modified_time":"2024-09-11T08:18:34+00:00","author":"Middleware Team","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Middleware Team","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.dbi-services.com\/blog\/zabbix-automatic-item-creation\/#article","isPartOf":{"@id":"https:\/\/www.dbi-services.com\/blog\/zabbix-automatic-item-creation\/"},"author":{"name":"Middleware Team","@id":"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/8d8563acfc6e604cce6507f45bac0ea1"},"headline":"Zabbix Automatic Item Creation","datePublished":"2023-06-20T07:05:16+00:00","dateModified":"2024-09-11T08:18:34+00:00","mainEntityOfPage":{"@id":"https:\/\/www.dbi-services.com\/blog\/zabbix-automatic-item-creation\/"},"wordCount":437,"commentCount":0,"keywords":["Monitoring","Zabbix"],"articleSection":["Application integration &amp; Middleware"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.dbi-services.com\/blog\/zabbix-automatic-item-creation\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.dbi-services.com\/blog\/zabbix-automatic-item-creation\/","url":"https:\/\/www.dbi-services.com\/blog\/zabbix-automatic-item-creation\/","name":"Zabbix Automatic Item Creation - dbi Blog","isPartOf":{"@id":"https:\/\/www.dbi-services.com\/blog\/#website"},"datePublished":"2023-06-20T07:05:16+00:00","dateModified":"2024-09-11T08:18:34+00:00","author":{"@id":"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/8d8563acfc6e604cce6507f45bac0ea1"},"description":"What is the procedure to automaticaly create items in Zabbix?","breadcrumb":{"@id":"https:\/\/www.dbi-services.com\/blog\/zabbix-automatic-item-creation\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.dbi-services.com\/blog\/zabbix-automatic-item-creation\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.dbi-services.com\/blog\/zabbix-automatic-item-creation\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Accueil","item":"https:\/\/www.dbi-services.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Zabbix Automatic Item Creation"}]},{"@type":"WebSite","@id":"https:\/\/www.dbi-services.com\/blog\/#website","url":"https:\/\/www.dbi-services.com\/blog\/","name":"dbi Blog","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.dbi-services.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/8d8563acfc6e604cce6507f45bac0ea1","name":"Middleware Team","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/ddcae7ba0f9d1a0e7ae707f0e689e4a9c95bb48ec49c8e6d9cc86d43f4121cb6?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/ddcae7ba0f9d1a0e7ae707f0e689e4a9c95bb48ec49c8e6d9cc86d43f4121cb6?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/ddcae7ba0f9d1a0e7ae707f0e689e4a9c95bb48ec49c8e6d9cc86d43f4121cb6?s=96&d=mm&r=g","caption":"Middleware Team"},"url":"https:\/\/www.dbi-services.com\/blog\/author\/middleware-team\/"}]}},"_links":{"self":[{"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/posts\/26065","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/users\/40"}],"replies":[{"embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/comments?post=26065"}],"version-history":[{"count":13,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/posts\/26065\/revisions"}],"predecessor-version":[{"id":26110,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/posts\/26065\/revisions\/26110"}],"wp:attachment":[{"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/media?parent=26065"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/categories?post=26065"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/tags?post=26065"},{"taxonomy":"type","embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/type_dbi?post=26065"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}