{"id":105,"date":"2018-12-24T12:36:16","date_gmt":"2018-12-24T11:36:16","guid":{"rendered":"http:\/\/thomas-kopton.de\/vblog\/?p=105"},"modified":"2018-12-24T12:36:16","modified_gmt":"2018-12-24T11:36:16","slug":"vrops-supermetric-using-logical-expressions-2","status":"publish","type":"post","link":"https:\/\/thomas-kopton.de\/vblog\/?p=105","title":{"rendered":"vROps SuperMetric using logical expressions"},"content":{"rendered":"\n<p>vRealize Operations\u00a0<strong>Super Metrics<\/strong>\u00a0are a\u00a0very flexible and powerful way to extend the capabilities of the product way beyond the OOB content.<br>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\n\n\n<figure class=\"wp-block-image is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/thomas-kopton.de\/vblog\/wp-content\/uploads\/2017\/10\/image01.png\" alt=\"\" width=\"800\" height=\"600\"\/><figcaption>vROps Super Metric<\/figcaption><\/figure>\n\n\n\n<p>Using some simple examples I am going to explain how the magic of logical expressions work in vROps Super Metrics.<br><\/p>\n\n\n\n<h6 class=\"wp-block-heading\">First of all some fundamentals:<\/h6>\n\n\n\n<ul class=\"wp-block-list\"><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><\/ul>\n\n\n\n<pre class=\"wp-block-preformatted\">avg(${this, metric=summary|total_number_hosts})<\/pre>\n\n\n\n<ul class=\"wp-block-list\"><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><\/ul>\n\n\n\n<pre class=\"wp-block-preformatted\">count(${adaptertype=VMWARE, objecttype=HostSystem, metric=sys|poweredOn, depth=1})<\/pre>\n\n\n\n<h6 class=\"wp-block-heading\">Now, let&#8217;s put the pieces together and build a super metric which follows this pattern:<\/h6>\n\n\n\n<pre class=\"wp-block-preformatted\">condition ? inCaseOfTrue : elseCase;<\/pre>\n\n\n\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\n\n\n<pre class=\"wp-block-preformatted\">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) > 40 ? avg(cpuUsage ):5<\/pre>\n\n\n\n<figure class=\"wp-block-image is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/2.bp.blogspot.com\/-n8C9QBcdP5c\/WpqQAq3f_7I\/AAAAAAAABl8\/hD6Ns4f-f6sq7U5GPlhDaUcfHWWtJ4SdQCLcBGAs\/s1600\/formula.png\" alt=\"\" width=\"795\" height=\"21\"\/><\/figure>\n\n\n\n<p>One could translate this formula into that statement:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">If all ESXi hosts in a given cluster are powered on AND<br>clusters average CPU usage is greater than 40<br>THEN show me the average CPU usage,<br>ELSE show me 5<\/pre>\n\n\n\n<figure class=\"wp-block-image is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/thomas-kopton.de\/vblog\/wp-content\/uploads\/2017\/12\/image02.png\" alt=\"\" width=\"832\" height=\"339\"\/><figcaption>Working vROps Super Metric<\/figcaption><\/figure>\n\n\n\n<p>Have fun creating your own Super Metrics based on logical expressions.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>vRealize Operations\u00a0Super Metrics\u00a0are 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 is, how dos &#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":[10,11,9,4],"class_list":["post-105","post","type-post","status-publish","format-standard","hentry","category-vrops","tag-6-7","tag-7-0","tag-logocalexpression","tag-supermetric"],"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=105\" \/>\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=\"vRealize Operations\u00a0Super Metrics\u00a0are 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 is, how dos ...\" \/>\n<meta property=\"og:url\" content=\"https:\/\/thomas-kopton.de\/vblog\/?p=105\" \/>\n<meta property=\"og:site_name\" content=\"TOMsOps\" \/>\n<meta property=\"article:published_time\" content=\"2018-12-24T11:36:16+00:00\" \/>\n<meta property=\"og:image\" content=\"http:\/\/thomas-kopton.de\/vblog\/wp-content\/uploads\/2017\/10\/image01.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=105#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/thomas-kopton.de\\\/vblog\\\/?p=105\"},\"author\":{\"name\":\"Thomas Kopton\",\"@id\":\"https:\\\/\\\/thomas-kopton.de\\\/vblog\\\/#\\\/schema\\\/person\\\/892d6b96c66b1dd4b75c6e32fdbfea82\"},\"headline\":\"vROps SuperMetric using logical expressions\",\"datePublished\":\"2018-12-24T11:36:16+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/thomas-kopton.de\\\/vblog\\\/?p=105\"},\"wordCount\":205,\"commentCount\":0,\"image\":{\"@id\":\"https:\\\/\\\/thomas-kopton.de\\\/vblog\\\/?p=105#primaryimage\"},\"thumbnailUrl\":\"http:\\\/\\\/thomas-kopton.de\\\/vblog\\\/wp-content\\\/uploads\\\/2017\\\/10\\\/image01.png\",\"keywords\":[\"6.7\",\"7.0\",\"logocalexpression\",\"SuperMetric\"],\"articleSection\":[\"vROps\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/thomas-kopton.de\\\/vblog\\\/?p=105#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/thomas-kopton.de\\\/vblog\\\/?p=105\",\"url\":\"https:\\\/\\\/thomas-kopton.de\\\/vblog\\\/?p=105\",\"name\":\"vROps SuperMetric using logical expressions - TOMsOps\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/thomas-kopton.de\\\/vblog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/thomas-kopton.de\\\/vblog\\\/?p=105#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/thomas-kopton.de\\\/vblog\\\/?p=105#primaryimage\"},\"thumbnailUrl\":\"http:\\\/\\\/thomas-kopton.de\\\/vblog\\\/wp-content\\\/uploads\\\/2017\\\/10\\\/image01.png\",\"datePublished\":\"2018-12-24T11:36:16+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/thomas-kopton.de\\\/vblog\\\/#\\\/schema\\\/person\\\/892d6b96c66b1dd4b75c6e32fdbfea82\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/thomas-kopton.de\\\/vblog\\\/?p=105#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/thomas-kopton.de\\\/vblog\\\/?p=105\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/thomas-kopton.de\\\/vblog\\\/?p=105#primaryimage\",\"url\":\"http:\\\/\\\/thomas-kopton.de\\\/vblog\\\/wp-content\\\/uploads\\\/2017\\\/10\\\/image01.png\",\"contentUrl\":\"http:\\\/\\\/thomas-kopton.de\\\/vblog\\\/wp-content\\\/uploads\\\/2017\\\/10\\\/image01.png\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/thomas-kopton.de\\\/vblog\\\/?p=105#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=105","og_locale":"en_US","og_type":"article","og_title":"vROps SuperMetric using logical expressions - TOMsOps","og_description":"vRealize Operations\u00a0Super Metrics\u00a0are 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 is, how dos ...","og_url":"https:\/\/thomas-kopton.de\/vblog\/?p=105","og_site_name":"TOMsOps","article_published_time":"2018-12-24T11:36:16+00:00","og_image":[{"url":"http:\/\/thomas-kopton.de\/vblog\/wp-content\/uploads\/2017\/10\/image01.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=105#article","isPartOf":{"@id":"https:\/\/thomas-kopton.de\/vblog\/?p=105"},"author":{"name":"Thomas Kopton","@id":"https:\/\/thomas-kopton.de\/vblog\/#\/schema\/person\/892d6b96c66b1dd4b75c6e32fdbfea82"},"headline":"vROps SuperMetric using logical expressions","datePublished":"2018-12-24T11:36:16+00:00","mainEntityOfPage":{"@id":"https:\/\/thomas-kopton.de\/vblog\/?p=105"},"wordCount":205,"commentCount":0,"image":{"@id":"https:\/\/thomas-kopton.de\/vblog\/?p=105#primaryimage"},"thumbnailUrl":"http:\/\/thomas-kopton.de\/vblog\/wp-content\/uploads\/2017\/10\/image01.png","keywords":["6.7","7.0","logocalexpression","SuperMetric"],"articleSection":["vROps"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/thomas-kopton.de\/vblog\/?p=105#respond"]}]},{"@type":"WebPage","@id":"https:\/\/thomas-kopton.de\/vblog\/?p=105","url":"https:\/\/thomas-kopton.de\/vblog\/?p=105","name":"vROps SuperMetric using logical expressions - TOMsOps","isPartOf":{"@id":"https:\/\/thomas-kopton.de\/vblog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/thomas-kopton.de\/vblog\/?p=105#primaryimage"},"image":{"@id":"https:\/\/thomas-kopton.de\/vblog\/?p=105#primaryimage"},"thumbnailUrl":"http:\/\/thomas-kopton.de\/vblog\/wp-content\/uploads\/2017\/10\/image01.png","datePublished":"2018-12-24T11:36:16+00:00","author":{"@id":"https:\/\/thomas-kopton.de\/vblog\/#\/schema\/person\/892d6b96c66b1dd4b75c6e32fdbfea82"},"breadcrumb":{"@id":"https:\/\/thomas-kopton.de\/vblog\/?p=105#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/thomas-kopton.de\/vblog\/?p=105"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/thomas-kopton.de\/vblog\/?p=105#primaryimage","url":"http:\/\/thomas-kopton.de\/vblog\/wp-content\/uploads\/2017\/10\/image01.png","contentUrl":"http:\/\/thomas-kopton.de\/vblog\/wp-content\/uploads\/2017\/10\/image01.png"},{"@type":"BreadcrumbList","@id":"https:\/\/thomas-kopton.de\/vblog\/?p=105#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\/105","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=105"}],"version-history":[{"count":3,"href":"https:\/\/thomas-kopton.de\/vblog\/index.php?rest_route=\/wp\/v2\/posts\/105\/revisions"}],"predecessor-version":[{"id":108,"href":"https:\/\/thomas-kopton.de\/vblog\/index.php?rest_route=\/wp\/v2\/posts\/105\/revisions\/108"}],"wp:attachment":[{"href":"https:\/\/thomas-kopton.de\/vblog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=105"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/thomas-kopton.de\/vblog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=105"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/thomas-kopton.de\/vblog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=105"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}