{"id":2692,"date":"2011-11-30T22:46:55","date_gmt":"2011-11-30T21:46:55","guid":{"rendered":"http:\/\/contoso.se\/blog\/?p=2692"},"modified":"2011-12-01T13:41:18","modified_gmt":"2011-12-01T12:41:18","slug":"unixlinux-shell-command-as-performance-data-in-om12","status":"publish","type":"post","link":"http:\/\/contoso.se\/blog\/?p=2692","title":{"rendered":"UNIX\/Linux Shell Command as Performance Data in OM12"},"content":{"rendered":"<p>Tonight I created a example on how to use a Linux\/UNIX command to return data as performance data in OM12. In this example we build a rule that count files in a folder and returns it as performance data.<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter size-medium wp-image-2693\" title=\"20111130_Xplat_Perf_01\" src=\"http:\/\/contoso.se\/blog\/wp-content\/uploads\/2011\/11\/20111130_Xplat_Perf_01-300x247.jpg\" alt=\"\" width=\"300\" height=\"247\" srcset=\"http:\/\/contoso.se\/blog\/wp-content\/uploads\/2011\/11\/20111130_Xplat_Perf_01-300x247.jpg 300w, http:\/\/contoso.se\/blog\/wp-content\/uploads\/2011\/11\/20111130_Xplat_Perf_01.jpg 782w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/p>\n<ol>\n<li>In the Operations Manager console, navigate to Author\/Management Pack Objects\/Rules<\/li>\n<li>Right-click rules and create a new Rule, select Collection Rules\/Probe Based\/UNIX\/Linux Shell Command (Performance) rule<\/li>\n<li>Select a management pack<\/li>\n<li>General, input a name and a rule target. For example \u00e2\u20ac\u0153Field \u00e2\u20ac\u201c X plat \u00e2\u20ac\u201c Number of files\u00e2\u20ac\u009d as name and \u00e2\u20ac\u0153SUSE Linux Enterprise Computer\u00e2\u20ac\u009d as monitor target<\/li>\n<li>Schedule, select how often you want the\u00c2\u00a0rule to run the command, for example every 15 minute<\/li>\n<li><span>Shell Command Details, input the script you want to use. The command can be a path to a binary or script file or a single-line shell command. In this example we can the following command to count files in the \/<span>tmp<\/span> folder<\/span><br \/>\n<span> find \/<span>tmp<\/span> | <span>wc<\/span> -l<\/span><\/li>\n<li>Filter Expression, use default settings and click Next<\/li>\n<li>Performance Mapper, input name of object, counter and instance, for example<br \/>\nObject: Folder Management<br \/>\nCounter: Number of files<br \/>\n<span> Instance: \/<span>tmp<\/span><\/span><\/li>\n<li>Click Create and your rule is ready!<\/li>\n<\/ol>\n<p>You can now navigate to a performance view and show the data collected by the rule (might need to wait some minutes depending on your rule settings)<\/p>\n<p><a href=\"http:\/\/contoso.se\/blog\/wp-content\/uploads\/2011\/11\/20111130_Xplat_Perf_02.jpg\"><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter size-medium wp-image-2697\" title=\"20111130_Xplat_Perf_02\" src=\"http:\/\/contoso.se\/blog\/wp-content\/uploads\/2011\/11\/20111130_Xplat_Perf_02-300x77.jpg\" alt=\"\" width=\"300\" height=\"77\" srcset=\"http:\/\/contoso.se\/blog\/wp-content\/uploads\/2011\/11\/20111130_Xplat_Perf_02-300x77.jpg 300w, http:\/\/contoso.se\/blog\/wp-content\/uploads\/2011\/11\/20111130_Xplat_Perf_02.jpg 806w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p><a href=\"http:\/\/contoso.se\/blog\/wp-content\/uploads\/2011\/11\/20111130_Xplat_Perf_03.jpg\"><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter size-medium wp-image-2701\" title=\"20111130_Xplat_Perf_03\" src=\"http:\/\/contoso.se\/blog\/wp-content\/uploads\/2011\/11\/20111130_Xplat_Perf_03-300x108.jpg\" alt=\"\" width=\"300\" height=\"108\" srcset=\"http:\/\/contoso.se\/blog\/wp-content\/uploads\/2011\/11\/20111130_Xplat_Perf_03-300x108.jpg 300w, http:\/\/contoso.se\/blog\/wp-content\/uploads\/2011\/11\/20111130_Xplat_Perf_03-1024x370.jpg 1024w, http:\/\/contoso.se\/blog\/wp-content\/uploads\/2011\/11\/20111130_Xplat_Perf_03.jpg 1320w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Tonight I created a example on how to use a Linux\/UNIX command to return data as performance data in OM12. In this example we build a rule that count files in a folder and returns it as performance data. In the Operations Manager console, navigate to Author\/Management Pack Objects\/Rules Right-click rules and create a new &hellip; <a href=\"http:\/\/contoso.se\/blog\/?p=2692\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0},"categories":[61],"tags":[],"_links":{"self":[{"href":"http:\/\/contoso.se\/blog\/index.php?rest_route=\/wp\/v2\/posts\/2692"}],"collection":[{"href":"http:\/\/contoso.se\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/contoso.se\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/contoso.se\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/contoso.se\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2692"}],"version-history":[{"count":12,"href":"http:\/\/contoso.se\/blog\/index.php?rest_route=\/wp\/v2\/posts\/2692\/revisions"}],"predecessor-version":[{"id":2708,"href":"http:\/\/contoso.se\/blog\/index.php?rest_route=\/wp\/v2\/posts\/2692\/revisions\/2708"}],"wp:attachment":[{"href":"http:\/\/contoso.se\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2692"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/contoso.se\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2692"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/contoso.se\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2692"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}