{"id":248,"date":"2017-02-02T15:26:49","date_gmt":"2017-02-02T14:26:49","guid":{"rendered":"http:\/\/blog.le-vert.net\/?p=248"},"modified":"2017-02-02T15:51:40","modified_gmt":"2017-02-02T14:51:40","slug":"debugging-no-output-in-nagios-or-centreon","status":"publish","type":"post","link":"https:\/\/blog.le-vert.net\/?p=248","title":{"rendered":"Debugging &#8220;no output&#8221; in Nagios or Centreon"},"content":{"rendered":"<div class=\"twttr_buttons\"><div class=\"twttr_twitter\">\n\t\t\t\t\t<a href=\"http:\/\/twitter.com\/share?text=Debugging+%22no+output%22+in+Nagios+or+Centreon\" class=\"twitter-share-button\" data-via=\"\" data-hashtags=\"\"  data-size=\"default\" data-url=\"https:\/\/blog.le-vert.net\/?p=248\"  data-related=\"\" target=\"_blank\">Tweet<\/a>\n\t\t\t\t<\/div><\/div><p>You just set up a new test that was running perfectly fine when ran by hand but fails completely after integration in the monitoring software ?<br \/>\nOf course, you suspect that the actually run command in invalid, thanks to parameters, quotes, escapes or whatever but you&#8217;re having hard time to figure out what was run exactly&#8230;<\/p>\n<p>Been there, done that. But here&#8217;s a magic trick:<br \/>\nLet&#8217;s do some kind of &#8220;ps | tail -f | grep&#8221; on the monitoring poller itself:<\/p>\n<p><code>while true; do ps aux | grep <strong>check_script_name<\/strong> | grep -v grep; done<\/code><\/p>\n<p>Now, trigger a forced check and get the full command on your terminal.<br \/>\nSome quotes might be missing because ps aux doesn&#8217;t show the argument separator but I guess that could be workarounded with a real script querying \/proc\/${pid}\/cmdline that contains \\0 arg separator&#8230;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>You just set up a new test that was running perfectly fine when ran by hand but fails completely after integration in the monitoring software ? Of course, you suspect that the actually run command in invalid, thanks to parameters, &hellip; <a href=\"https:\/\/blog.le-vert.net\/?p=248\">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":{"footnotes":""},"categories":[1],"tags":[],"_links":{"self":[{"href":"https:\/\/blog.le-vert.net\/index.php?rest_route=\/wp\/v2\/posts\/248"}],"collection":[{"href":"https:\/\/blog.le-vert.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.le-vert.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.le-vert.net\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.le-vert.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=248"}],"version-history":[{"count":4,"href":"https:\/\/blog.le-vert.net\/index.php?rest_route=\/wp\/v2\/posts\/248\/revisions"}],"predecessor-version":[{"id":252,"href":"https:\/\/blog.le-vert.net\/index.php?rest_route=\/wp\/v2\/posts\/248\/revisions\/252"}],"wp:attachment":[{"href":"https:\/\/blog.le-vert.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=248"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.le-vert.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=248"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.le-vert.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=248"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}