{"id":2541,"date":"2010-10-28T06:37:08","date_gmt":"2010-10-27T20:37:08","guid":{"rendered":"http:\/\/nsrd.info\/blog\/?p=2541"},"modified":"2018-12-11T18:30:05","modified_gmt":"2018-12-11T08:30:05","slug":"debugging-nsrmmd","status":"publish","type":"post","link":"https:\/\/nsrd.info\/blog\/2010\/10\/28\/debugging-nsrmmd\/","title":{"rendered":"Debugging nsrmmd"},"content":{"rendered":"<p>Sometimes it&#8217;s helpful to run NetWorker in debug mode &#8211; but sometimes, you just want to throw the nsrmmd processes into debug mode, and depending on your site, there may be a lot of them.<\/p>\n<p>So, I finally got around to writing a &#8220;script&#8221; to throw all nsrmmd processes into debug mode. It hardly warrants being a script, but it may be helpful to others. Of course, this is Unix only &#8211; I&#8217;ll leave it as an exercise to the reader to generate the equivalent Windows script.<\/p>\n<p>The entire script is as follows:<\/p>\n<pre>#!\/bin\/sh\n\nPLATFORM=`uname`\n\nif [ \"$PLATFORM\" = \"Linux\" ]\nthen\n\tPROCLIST=`ps -C nsrmmd -o pid | grep -v PID`\nelif [ \"$PLATFORM\" = \"SunOS\" ]\nthen\n\tPROCLIST=`ps -ea -o pid,comm | grep 'nsrmmd<\/pre>\n<p>The above is applicable only to Solaris and Linux so far &#8211; I&#8217;ve not customised for say, HPUX or AIX simply because I don&#8217;t have either of those platforms hanging around in my lab. To invoke, you&#8217;d simply run:<\/p>\n<div>\n<pre># <strong>dbgnsrmmd.sh level<\/strong><\/pre>\n<p>Where level is a number between 0 (for off) and 99 (for &#8230; &#8220;are you insane???&#8221;). Running it on one of my lab servers, it works as follows:<\/p>\n<pre>[root@nox bin]# <strong>dbgnsrmmd.sh 9<\/strong>\ndbgcommand -p 4972 Debug=9\ndbgcommand -p 4977 Debug=9\ndbgcommand -p 4979 Debug=9\ndbgcommand -p 4982 Debug=9\ndbgcommand -p 4991 Debug=9\ndbgcommand -p 4999 Debug=9<\/pre>\n<\/div>\n<div>Note that when you invoke dbgcommand against a sub-daemon such as nsrmmd (as opposed to nsrd itself), you won&#8217;t get an alert in the daemon.{raw|log} file to indicate the debug level has changed.<\/div>\n<pre>| awk '{print $1}'` fi DBG=$1 for pid in $PROCLIST do echo dbgcommand -p $pid Debug=$DBG dbgcommand -p $pid Debug=$DBG done<\/pre>\n<p>The above is applicable only to Solaris and Linux so far &#8211; I&#8217;ve not customised for say, HPUX or AIX simply because I don&#8217;t have either of those platforms hanging around in my lab. To invoke, you&#8217;d simply run:<\/p>\n<div>\n<pre><\/pre>\n<p>Where level is a number between 0 (for off) and 99 (for &#8230; &#8220;are you insane???&#8221;). Running it on one of my lab servers, it works as follows:<\/p>\n<pre><\/pre>\n<\/div>\n<div>Note that when you invoke dbgcommand against a sub-daemon such as nsrmmd (as opposed to nsrd itself), you won&#8217;t get an alert in the daemon.{raw|log} file to indicate the debug level has changed.<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Sometimes it&#8217;s helpful to run NetWorker in debug mode &#8211; but sometimes, you just want to throw the nsrmmd processes&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[15,16,20],"tags":[289,292,293,294,1248,668,909,957],"class_list":["post-2541","post","type-post","status-publish","format-standard","hentry","category-linux","category-networker","category-scripting","tag-dbgcommand","tag-debug","tag-debug-mode","tag-debug-trace-level","tag-linux","tag-nsrmmd","tag-solaris","tag-sunos"],"aioseo_notices":[],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/pKpIN-EZ","jetpack_sharing_enabled":true,"jetpack_likes_enabled":true,"_links":{"self":[{"href":"https:\/\/nsrd.info\/blog\/wp-json\/wp\/v2\/posts\/2541","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/nsrd.info\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/nsrd.info\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/nsrd.info\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/nsrd.info\/blog\/wp-json\/wp\/v2\/comments?post=2541"}],"version-history":[{"count":1,"href":"https:\/\/nsrd.info\/blog\/wp-json\/wp\/v2\/posts\/2541\/revisions"}],"predecessor-version":[{"id":7540,"href":"https:\/\/nsrd.info\/blog\/wp-json\/wp\/v2\/posts\/2541\/revisions\/7540"}],"wp:attachment":[{"href":"https:\/\/nsrd.info\/blog\/wp-json\/wp\/v2\/media?parent=2541"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/nsrd.info\/blog\/wp-json\/wp\/v2\/categories?post=2541"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/nsrd.info\/blog\/wp-json\/wp\/v2\/tags?post=2541"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}