{"id":372,"date":"2015-03-03T15:16:36","date_gmt":"2015-03-03T20:16:36","guid":{"rendered":"http:\/\/www.hpux.ws\/?p=372"},"modified":"2015-03-03T15:25:53","modified_gmt":"2015-03-03T20:25:53","slug":"making-sure-mwa-is-running-properly","status":"publish","type":"post","link":"https:\/\/www.hpux.ws\/?p=372","title":{"rendered":"Making sure MWA is running properly"},"content":{"rendered":"<p>What follows is a health check script that checks the installation status of HP Operations Agent and the run status of the two mwa daemons that measure performance.<\/p>\n<p>When run with the -y parameter the script will attempt to correct installed status of HP Operations Agent.<\/p>\n<p>If you want the script, please email me via the sites response form. Cutting and pasting from this site can be done, but may be a very frustrating endeavor.<\/p>\n<p>I have added commentary to the script, which may introduce run errors if screen scraped.<\/p>\n<p><strong>myserva:root > cat 247_mwarun<br \/>\n#!\/bin\/ksh<br \/>\n############################################################################<br \/>\n#     make sure scopeux is running, if not run if not installed install.ed<\/p>\n<p># Load common environment<br \/>\n. \/var\/adm\/bin\/.scriptenv<br \/>\n        echo &#8220;. Checking for mwa software installed and running on ${hn}.&#8221;<\/p>\n<p>is=myserva<br \/>\nif [ &#8220;${hn}&#8221; = &#8220;myserva&#8221; ]; then is=&#8221;myservb&#8221;;fi<\/p>\n<p>ps -ef >\/tmp\/plist.txt<\/p>\n<p>srun=$(awk &#8216;\/scopeux\/{print $NF}&#8217; \/tmp\/plist.txt | wc -l);<br \/>\nmrun=$(awk &#8216;\/midaemon\/{print $NF}&#8217; \/tmp\/plist.txt | wc -l);<br \/>\nswlist -l bundle TC097EA > \/tmp\/swlist.txt<br \/>\nmwainst=$(awk &#8216;\/TC097EA\/{ print $NF}&#8217; \/tmp\/swlist.txt| wc -l);<\/p>\n<p>#echo &#8220;scopeux procs running: $srun mwa installed: $mwainst&#8221;<br \/>\nif [ &#8220;$1&#8221; = &#8220;-y&#8221; ];then<br \/>\nCHANGES=1<br \/>\nfi<\/p>\n<p>if [ ${srun} -eq 0 ] || [ ${mrun} -eq 0 ] ;then<br \/>\n        if (($CHANGES));then<br \/>\n            if [ ${mwainst} -ne 1 ]<br \/>\n            then<br \/>\n              ### depot server location is in variable ${is}. This is an ignite depot server.<br \/>\n              swinstall -x mount_all_filesystems=false -s ${is}:\/Depots\/B.11.31\/2014midyear_depot TC097EA<br \/>\n              rc=$?<br \/>\n              echo &#8220;mwa TC097EA install succeeded checking sd on ${hn}&#8230;&#8221;<br \/>\n              swlist -l bundle TC097EA > \/tmp\/swlist.txt<br \/>\n              mwainst=$(awk &#8216;\/TC097EA\/{ print $NF}&#8217; \/tmp\/swlist.txt| wc -l);<br \/>\n              if [ ${mwainst} -eq 1 ];then echo &#8221;      pass &#8211; mwa NOW installed.&#8221; ;fi<br \/>\n              optstat=$(\/var\/adm\/bin\/bdfmegs &#8220;\/opt &#8221; |awk &#8216;!\/File-System\/{print $5}&#8217;);<br \/>\n              echo &#8220;${hn} \/opt is ${optstat} full remediate if above 85% &#8230;&#8221;<br \/>\n            else<br \/>\n              mwa start all<br \/>\n            fi<br \/>\n        else<br \/>\n        echo &#8221; NOTICE     &#8211; mwa not installed  or scopeux\/midaemon is not running on ${hn} .(-y will fix).&#8221;<br \/>\n        fi<br \/>\nelse<br \/>\n        echo &#8221;      pass &#8211; mwa installed. scopeux\/midaemon is running on ${hn}.&#8221;<br \/>\nfi<br \/>\noptstat=$(\/var\/adm\/bin\/bdfmegs &#8220;\/opt &#8221; |awk &#8216;!\/File-System\/{print $5}&#8217;);<br \/>\necho &#8220;${hn} \/opt is ${optstat} full remediate if above 85% &#8230;&#8221;<br \/>\nrm -f \/tmp\/plist.txt<br \/>\nrm -f \/tmp\/swlist.txt<br \/>\necho &#8220;#### end report $0 ${sn} ####&#8221;<br \/>\n<\/strong><\/p>\n<p>Script depends on Bill Hassell&#8217;s bdfmegs script. bdf can be made to work.<br \/>\nTypical output is:<\/p>\n<p>myserv0:root > <strong>.\/247_mwarun<\/strong><br \/>\nExecuting HP-UX specific environment parameters&#8230;<br \/>\n. Checking for mwa software installed and running on myserv0.<br \/>\n      pass &#8211; mwa installed. scopeux\/midaemon is running on mserv0.<br \/>\nmyserv0 \/opt is 68% full remediate if above 85% &#8230;<br \/>\n#### end report .\/247_mwarun myserv0 ####<br \/>\nmyserv0:root > mwa stop all<\/p>\n<p>Shutting down Perf Agent collection software<br \/>\n         Shutting down scopeux, pid(s) 28345<br \/>\n         The Perf Agent collector, scopeux has been shut down successfully.<br \/>\nNOTE:   The ARM registration daemon ttd will be left running.<\/p>\n<p>OVOA is running. Not shutting down coda<br \/>\nmyserv0:root > <strong>.\/247_mwarun<\/strong><br \/>\nExecuting HP-UX specific environment parameters&#8230;<br \/>\n. Checking for mwa software installed and running on myserv0.<br \/>\n NOTICE     &#8211; mwa not installed  or scopeux\/midaemon is not running on myserv0 .(-y will fix).<br \/>\nmyserv0 \/opt is 68% full remediate if above 85% &#8230;<br \/>\n#### end report .\/247_mwarun myserv0 ####<\/p>\n","protected":false},"excerpt":{"rendered":"<p>What follows is a health check script that checks the installation status of HP Operations Agent and the run status of the two mwa daemons that measure performance.<\/p>\n<p>When run with the -y parameter the script will attempt to correct installed status of HP Operations Agent.<\/p>\n<p>If you want the script, please email me via the sites response form. Cutting and pasting from this site can be done, but may be a very frustrating endeavor.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_bbp_topic_count":0,"_bbp_reply_count":0,"_bbp_total_topic_count":0,"_bbp_total_reply_count":0,"_bbp_voice_count":0,"_bbp_anonymous_reply_count":0,"_bbp_topic_count_hidden":0,"_bbp_reply_count_hidden":0,"_bbp_forum_subforum_count":0,"_kadence_starter_templates_imported_post":false,"footnotes":""},"categories":[],"tags":[],"class_list":["post-372","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/www.hpux.ws\/index.php?rest_route=\/wp\/v2\/posts\/372"}],"collection":[{"href":"https:\/\/www.hpux.ws\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.hpux.ws\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.hpux.ws\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.hpux.ws\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=372"}],"version-history":[{"count":0,"href":"https:\/\/www.hpux.ws\/index.php?rest_route=\/wp\/v2\/posts\/372\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.hpux.ws\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=372"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.hpux.ws\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=372"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.hpux.ws\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=372"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}