{"id":41,"date":"2017-12-08T16:56:22","date_gmt":"2017-12-08T14:56:22","guid":{"rendered":"http:\/\/thomas-kopton.de\/vblog\/?p=41"},"modified":"2017-12-23T16:52:23","modified_gmt":"2017-12-23T14:52:23","slug":"vrops-supermetric-using-logical-expressions","status":"publish","type":"post","link":"https:\/\/thomas-kopton.de\/vblog\/?p=41","title":{"rendered":"vROps SuperMetric using logical expressions"},"content":{"rendered":"<p>vRealie Operations <strong>Super Metrics<\/strong> are a\u00a0very flexible and powerful way to extend the capabilities of the product way beyond the OOB content.<\/p>\n<p>There are many blog articles out there explaining how to basically use super metrics but only very few sources gives some examples how to put logical expressions into your formulas. So the question is, how dos this work?<\/p>\n<p><a href=\"https:\/\/thomas-kopton.de\/vblog\/wp-content\/uploads\/2017\/10\/image01.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-49 size-large\" src=\"https:\/\/thomas-kopton.de\/vblog\/wp-content\/uploads\/2017\/10\/image01-1024x769.png\" alt=\"\" width=\"640\" height=\"481\" srcset=\"https:\/\/thomas-kopton.de\/vblog\/wp-content\/uploads\/2017\/10\/image01.png 1024w, https:\/\/thomas-kopton.de\/vblog\/wp-content\/uploads\/2017\/10\/image01-300x225.png 300w, https:\/\/thomas-kopton.de\/vblog\/wp-content\/uploads\/2017\/10\/image01-768x577.png 768w\" sizes=\"auto, (max-width: 640px) 100vw, 640px\" \/><\/a><\/p>\n<p>Using some simple examples I am going to explain how the magic of logical expressions work in vROps Super Metrics.<\/p>\n<h6>First of all some fundamentals:<\/h6>\n<ul>\n<li>Super Metric working on a selected object itself, like ESXi cluster in this example, which is just showing the actual metric (we will need soon):<\/li>\n<\/ul>\n<pre>avg(${this, metric=summary|total_number_hosts})<\/pre>\n<ul>\n<li>Super Metric working on direct descendants of a selected object, in this case ESXi hosts in a cluster, which is counting the powered on hosts:<\/li>\n<\/ul>\n<pre>count(${adaptertype=VMWARE, objecttype=HostSystem, metric=sys|poweredOn, depth=1})<\/pre>\n<h6>Now, let&#8217;s put the pieces together and build a super metric which follows this pattern:<\/h6>\n<pre>condition ? inCaseOfTrue : elseCase;<\/pre>\n<p>Even if this doesn&#8217;t mean anything in terms of semantics, the syntax of such an expression might look like this one:<\/p>\n<pre>count(${adaptertype=VMWARE, objecttype=HostSystem, metric=sys|poweredOn, depth=1}) == avg(${this, metric=summary|total_number_hosts}) &amp;&amp; avg(${adaptertype=VMWARE, objecttype=HostSystem, metric=cpu|usage_average, depth=1} as cpuUsage) &gt; 40 ? avg(cpuUsage ):5<\/pre>\n<p><a href=\"https:\/\/thomas-kopton.de\/vblog\/wp-content\/uploads\/2017\/12\/image03.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-59 size-full\" src=\"https:\/\/thomas-kopton.de\/vblog\/wp-content\/uploads\/2017\/12\/image03.png\" alt=\"\" width=\"1385\" height=\"34\" srcset=\"https:\/\/thomas-kopton.de\/vblog\/wp-content\/uploads\/2017\/12\/image03.png 1385w, https:\/\/thomas-kopton.de\/vblog\/wp-content\/uploads\/2017\/12\/image03-300x7.png 300w, https:\/\/thomas-kopton.de\/vblog\/wp-content\/uploads\/2017\/12\/image03-768x19.png 768w, https:\/\/thomas-kopton.de\/vblog\/wp-content\/uploads\/2017\/12\/image03-1024x25.png 1024w\" sizes=\"auto, (max-width: 1385px) 100vw, 1385px\" \/><\/a><\/p>\n<p>One could translate this formula into that statement:<\/p>\n<pre>If all ESXi hosts in a given cluster are powered on AND clusters average CPU usage is greater than 40 THEN show me the average CPU usage, ELSE show me 5<\/pre>\n<p><a href=\"https:\/\/thomas-kopton.de\/vblog\/wp-content\/uploads\/2017\/12\/image02.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-57 size-large\" src=\"https:\/\/thomas-kopton.de\/vblog\/wp-content\/uploads\/2017\/12\/image02-1024x418.png\" alt=\"\" width=\"640\" height=\"261\" srcset=\"https:\/\/thomas-kopton.de\/vblog\/wp-content\/uploads\/2017\/12\/image02-1024x418.png 1024w, https:\/\/thomas-kopton.de\/vblog\/wp-content\/uploads\/2017\/12\/image02-300x123.png 300w, https:\/\/thomas-kopton.de\/vblog\/wp-content\/uploads\/2017\/12\/image02-768x314.png 768w, https:\/\/thomas-kopton.de\/vblog\/wp-content\/uploads\/2017\/12\/image02.png 1290w\" sizes=\"auto, (max-width: 640px) 100vw, 640px\" \/><\/a><\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>vRealie Operations Super Metrics are a\u00a0very flexible and powerful way to extend the capabilities of the product way beyond the OOB content. There are many blog articles out there explaining how to basically use super metrics but only very few sources gives some examples how to put logical expressions into your formulas. So the question &#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[4,3],"class_list":["post-41","post","type-post","status-publish","format-standard","hentry","category-vrops","tag-supermetric","tag-vrops"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>vROps SuperMetric using logical expressions - TOMsOps<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/thomas-kopton.de\/vblog\/?p=41\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"vROps SuperMetric using logical expressions - TOMsOps\" \/>\n<meta property=\"og:description\" content=\"vRealie Operations Super Metrics are a\u00a0very flexible and powerful way to extend the capabilities of the product way beyond the OOB content. There are many blog articles out there explaining how to basically use super metrics but only very few sources gives some examples how to put logical expressions into your formulas. So the question ...\" \/>\n<meta property=\"og:url\" content=\"https:\/\/thomas-kopton.de\/vblog\/?p=41\" \/>\n<meta property=\"og:site_name\" content=\"TOMsOps\" \/>\n<meta property=\"article:published_time\" content=\"2017-12-08T14:56:22+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2017-12-23T14:52:23+00:00\" \/>\n<meta property=\"og:image\" content=\"http:\/\/thomas-kopton.de\/vblog\/wp-content\/uploads\/2017\/10\/image01-1024x769.png\" \/>\n<meta name=\"author\" content=\"Thomas Kopton\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Thomas Kopton\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/thomas-kopton.de\\\/vblog\\\/?p=41#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/thomas-kopton.de\\\/vblog\\\/?p=41\"},\"author\":{\"name\":\"Thomas Kopton\",\"@id\":\"https:\\\/\\\/thomas-kopton.de\\\/vblog\\\/#\\\/schema\\\/person\\\/892d6b96c66b1dd4b75c6e32fdbfea82\"},\"headline\":\"vROps SuperMetric using logical expressions\",\"datePublished\":\"2017-12-08T14:56:22+00:00\",\"dateModified\":\"2017-12-23T14:52:23+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/thomas-kopton.de\\\/vblog\\\/?p=41\"},\"wordCount\":188,\"commentCount\":0,\"image\":{\"@id\":\"https:\\\/\\\/thomas-kopton.de\\\/vblog\\\/?p=41#primaryimage\"},\"thumbnailUrl\":\"http:\\\/\\\/thomas-kopton.de\\\/vblog\\\/wp-content\\\/uploads\\\/2017\\\/10\\\/image01-1024x769.png\",\"keywords\":[\"SuperMetric\",\"vROps\"],\"articleSection\":[\"vROps\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/thomas-kopton.de\\\/vblog\\\/?p=41#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/thomas-kopton.de\\\/vblog\\\/?p=41\",\"url\":\"https:\\\/\\\/thomas-kopton.de\\\/vblog\\\/?p=41\",\"name\":\"vROps SuperMetric using logical expressions - TOMsOps\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/thomas-kopton.de\\\/vblog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/thomas-kopton.de\\\/vblog\\\/?p=41#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/thomas-kopton.de\\\/vblog\\\/?p=41#primaryimage\"},\"thumbnailUrl\":\"http:\\\/\\\/thomas-kopton.de\\\/vblog\\\/wp-content\\\/uploads\\\/2017\\\/10\\\/image01-1024x769.png\",\"datePublished\":\"2017-12-08T14:56:22+00:00\",\"dateModified\":\"2017-12-23T14:52:23+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/thomas-kopton.de\\\/vblog\\\/#\\\/schema\\\/person\\\/892d6b96c66b1dd4b75c6e32fdbfea82\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/thomas-kopton.de\\\/vblog\\\/?p=41#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/thomas-kopton.de\\\/vblog\\\/?p=41\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/thomas-kopton.de\\\/vblog\\\/?p=41#primaryimage\",\"url\":\"http:\\\/\\\/thomas-kopton.de\\\/vblog\\\/wp-content\\\/uploads\\\/2017\\\/10\\\/image01-1024x769.png\",\"contentUrl\":\"http:\\\/\\\/thomas-kopton.de\\\/vblog\\\/wp-content\\\/uploads\\\/2017\\\/10\\\/image01-1024x769.png\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/thomas-kopton.de\\\/vblog\\\/?p=41#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/thomas-kopton.de\\\/vblog\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"vROps SuperMetric using logical expressions\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/thomas-kopton.de\\\/vblog\\\/#website\",\"url\":\"https:\\\/\\\/thomas-kopton.de\\\/vblog\\\/\",\"name\":\"TOMsOps\",\"description\":\"Just another VMware Cloud Management Blog\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/thomas-kopton.de\\\/vblog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/thomas-kopton.de\\\/vblog\\\/#\\\/schema\\\/person\\\/892d6b96c66b1dd4b75c6e32fdbfea82\",\"name\":\"Thomas Kopton\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/e746aafbd3733172ceb4d600ba1feda61bc87cd3b70f5a9dfb581907cc7973b1?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/e746aafbd3733172ceb4d600ba1feda61bc87cd3b70f5a9dfb581907cc7973b1?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/e746aafbd3733172ceb4d600ba1feda61bc87cd3b70f5a9dfb581907cc7973b1?s=96&d=mm&r=g\",\"caption\":\"Thomas Kopton\"},\"url\":\"https:\\\/\\\/thomas-kopton.de\\\/vblog\\\/?author=1\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"vROps SuperMetric using logical expressions - TOMsOps","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:\/\/thomas-kopton.de\/vblog\/?p=41","og_locale":"en_US","og_type":"article","og_title":"vROps SuperMetric using logical expressions - TOMsOps","og_description":"vRealie Operations Super Metrics are a\u00a0very flexible and powerful way to extend the capabilities of the product way beyond the OOB content. There are many blog articles out there explaining how to basically use super metrics but only very few sources gives some examples how to put logical expressions into your formulas. So the question ...","og_url":"https:\/\/thomas-kopton.de\/vblog\/?p=41","og_site_name":"TOMsOps","article_published_time":"2017-12-08T14:56:22+00:00","article_modified_time":"2017-12-23T14:52:23+00:00","og_image":[{"url":"http:\/\/thomas-kopton.de\/vblog\/wp-content\/uploads\/2017\/10\/image01-1024x769.png","type":"","width":"","height":""}],"author":"Thomas Kopton","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Thomas Kopton","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/thomas-kopton.de\/vblog\/?p=41#article","isPartOf":{"@id":"https:\/\/thomas-kopton.de\/vblog\/?p=41"},"author":{"name":"Thomas Kopton","@id":"https:\/\/thomas-kopton.de\/vblog\/#\/schema\/person\/892d6b96c66b1dd4b75c6e32fdbfea82"},"headline":"vROps SuperMetric using logical expressions","datePublished":"2017-12-08T14:56:22+00:00","dateModified":"2017-12-23T14:52:23+00:00","mainEntityOfPage":{"@id":"https:\/\/thomas-kopton.de\/vblog\/?p=41"},"wordCount":188,"commentCount":0,"image":{"@id":"https:\/\/thomas-kopton.de\/vblog\/?p=41#primaryimage"},"thumbnailUrl":"http:\/\/thomas-kopton.de\/vblog\/wp-content\/uploads\/2017\/10\/image01-1024x769.png","keywords":["SuperMetric","vROps"],"articleSection":["vROps"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/thomas-kopton.de\/vblog\/?p=41#respond"]}]},{"@type":"WebPage","@id":"https:\/\/thomas-kopton.de\/vblog\/?p=41","url":"https:\/\/thomas-kopton.de\/vblog\/?p=41","name":"vROps SuperMetric using logical expressions - TOMsOps","isPartOf":{"@id":"https:\/\/thomas-kopton.de\/vblog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/thomas-kopton.de\/vblog\/?p=41#primaryimage"},"image":{"@id":"https:\/\/thomas-kopton.de\/vblog\/?p=41#primaryimage"},"thumbnailUrl":"http:\/\/thomas-kopton.de\/vblog\/wp-content\/uploads\/2017\/10\/image01-1024x769.png","datePublished":"2017-12-08T14:56:22+00:00","dateModified":"2017-12-23T14:52:23+00:00","author":{"@id":"https:\/\/thomas-kopton.de\/vblog\/#\/schema\/person\/892d6b96c66b1dd4b75c6e32fdbfea82"},"breadcrumb":{"@id":"https:\/\/thomas-kopton.de\/vblog\/?p=41#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/thomas-kopton.de\/vblog\/?p=41"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/thomas-kopton.de\/vblog\/?p=41#primaryimage","url":"http:\/\/thomas-kopton.de\/vblog\/wp-content\/uploads\/2017\/10\/image01-1024x769.png","contentUrl":"http:\/\/thomas-kopton.de\/vblog\/wp-content\/uploads\/2017\/10\/image01-1024x769.png"},{"@type":"BreadcrumbList","@id":"https:\/\/thomas-kopton.de\/vblog\/?p=41#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/thomas-kopton.de\/vblog"},{"@type":"ListItem","position":2,"name":"vROps SuperMetric using logical expressions"}]},{"@type":"WebSite","@id":"https:\/\/thomas-kopton.de\/vblog\/#website","url":"https:\/\/thomas-kopton.de\/vblog\/","name":"TOMsOps","description":"Just another VMware Cloud Management Blog","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/thomas-kopton.de\/vblog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/thomas-kopton.de\/vblog\/#\/schema\/person\/892d6b96c66b1dd4b75c6e32fdbfea82","name":"Thomas Kopton","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/e746aafbd3733172ceb4d600ba1feda61bc87cd3b70f5a9dfb581907cc7973b1?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/e746aafbd3733172ceb4d600ba1feda61bc87cd3b70f5a9dfb581907cc7973b1?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/e746aafbd3733172ceb4d600ba1feda61bc87cd3b70f5a9dfb581907cc7973b1?s=96&d=mm&r=g","caption":"Thomas Kopton"},"url":"https:\/\/thomas-kopton.de\/vblog\/?author=1"}]}},"_links":{"self":[{"href":"https:\/\/thomas-kopton.de\/vblog\/index.php?rest_route=\/wp\/v2\/posts\/41","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/thomas-kopton.de\/vblog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/thomas-kopton.de\/vblog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/thomas-kopton.de\/vblog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/thomas-kopton.de\/vblog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=41"}],"version-history":[{"count":11,"href":"https:\/\/thomas-kopton.de\/vblog\/index.php?rest_route=\/wp\/v2\/posts\/41\/revisions"}],"predecessor-version":[{"id":75,"href":"https:\/\/thomas-kopton.de\/vblog\/index.php?rest_route=\/wp\/v2\/posts\/41\/revisions\/75"}],"wp:attachment":[{"href":"https:\/\/thomas-kopton.de\/vblog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=41"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/thomas-kopton.de\/vblog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=41"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/thomas-kopton.de\/vblog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=41"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}