{"id":1022,"date":"2011-09-17T14:17:32","date_gmt":"2011-09-17T18:17:32","guid":{"rendered":"http:\/\/antipaucity.com\/?p=1022"},"modified":"2011-09-17T14:17:32","modified_gmt":"2011-09-17T18:17:32","slug":"ogshogfs-for-fun-and-profit","status":"publish","type":"post","link":"https:\/\/merikebi.warrenmyers.com\/?p=1022","title":{"rendered":"ogsh\/ogfs for fun and profit"},"content":{"rendered":"<p>The absolute coolest feature of HP&#8217;s Server Automation suite is the OGSH (or OGFS) &#8211; the Opsware Global SHell (or FileSystem).<\/p>\n<p>I worked for Opsware before HP acquired them, and the OGSH was a new feature to the product (then called Opsware SAS (Server Automation System)). It&#8217;s a <a href=\"http:\/\/fuse.sourceforge.net\">fuse<\/a>\u00a0module that gives a [limited] bash interface to the managed environment by presenting a live query\/view into the database, and, ultimately, allowing manipulation of managed servers in the environment.<\/p>\n<p>For example, to access a list of all managed servers, you login to global shell, then<\/p>\n<blockquote><p><code>cd \/opsw\/Server\/@<\/code><\/p><\/blockquote>\n<p>The &#8216;@&#8217; sign is used to indicate you are &#8220;there&#8221; &#8211; at the limit of that particular filter (in this case, &#8220;Server&#8221;).<\/p>\n<p>Since it&#8217;s bash, you can run most common *nix utilities and commands. But the one that&#8217;s most handy, in my opinion, is <code>rosh<\/code> &#8211; the Remote Opsware SHell.<\/p>\n<p>Remote shell opens an authenticated, logged session to a remote machine (*nix or Windows &#8211; doesn&#8217;t matter), based on your user&#8217;s\/group&#8217;s permissions. For testing purposes, I always configure one group (and add myself) that can connect using <code>root<\/code> for *nix machines (and Administrator on Windows).<\/p>\n<p>The basic command to connect to a machine is:<\/p>\n<blockquote><p><code>rosh -l [username] -n [machine]<\/code><\/p><\/blockquote>\n<p>You can also pass commands to <code>rosh<\/code> like it was an ssh session:<\/p>\n<blockquote><p><code>rosh -l [username] -n [machine] '[command]'<\/code><\/p><\/blockquote>\n<p>For the fullest power of <code>rosh<\/code>, though, use it in a script or loop. For example:<\/p>\n<blockquote><p><code>for sn in *; do rosh -l root -n $sn 'uptime ; uname -a'; done<\/code><\/p><\/blockquote>\n<p>That will remote shell into every server in the current view, using standard shell expansion of the splat (*), and run <code>uptime<\/code> and <code>uname -a<\/code>, printing the results to screen. That particular command is handy for quick-and-dirty reports on the managed environment to see<\/p>\n<ul>\n<li>which servers are up, and which aren&#8217;t<\/li>\n<li>how long they&#8217;ve been up<\/li>\n<\/ul>\n<p>In addition to <code>rosh<\/code>, global shell provides a near-complete exposing of the SA API (which is also accessible via Java, web services, and Python (using the &#8220;PyTwist&#8221; bindings written to access the Java interfaces).<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The absolute coolest feature of HP&#8217;s Server Automation suite is the OGSH (or OGFS) &#8211; the Opsware Global SHell (or FileSystem). I worked for Opsware before HP acquired them, and the OGSH was a new feature to the product (then called Opsware SAS (Server Automation System)). It&#8217;s a fuse\u00a0module that gives a [limited] bash interface &hellip;<br \/><a href=\"https:\/\/merikebi.warrenmyers.com\/?p=1022\" class=\"more-link pen_button pen_element_default pen_icon_arrow_double\">Continue reading <span class=\"screen-reader-text\">ogsh\/ogfs for fun and profit<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_hide_featured_image":false,"_jetpack_featured_image_duplicate_dismissed":0,"_jetpack_feature_clip_id":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_post_was_ever_published":false},"categories":[41,45,48],"tags":[],"keyring_services":[],"class_list":["post-1022","post","type-post","status-publish","format-standard","hentry","category-technical","category-tutorial","category-work"],"jetpack_sharing_enabled":true,"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/merikebi.warrenmyers.com\/index.php?rest_route=\/wp\/v2\/posts\/1022","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/merikebi.warrenmyers.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/merikebi.warrenmyers.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/merikebi.warrenmyers.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/merikebi.warrenmyers.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1022"}],"version-history":[{"count":0,"href":"https:\/\/merikebi.warrenmyers.com\/index.php?rest_route=\/wp\/v2\/posts\/1022\/revisions"}],"wp:attachment":[{"href":"https:\/\/merikebi.warrenmyers.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1022"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/merikebi.warrenmyers.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1022"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/merikebi.warrenmyers.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1022"},{"taxonomy":"keyring_services","embeddable":true,"href":"https:\/\/merikebi.warrenmyers.com\/index.php?rest_route=%2Fwp%2Fv2%2Fkeyring_services&post=1022"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}