{"id":139,"date":"2014-04-30T07:49:37","date_gmt":"2014-04-30T07:49:37","guid":{"rendered":"http:\/\/muse.oneshot.in\/?p=139"},"modified":"2014-04-30T07:50:25","modified_gmt":"2014-04-30T07:50:25","slug":"nagios-timeout-issues-a-quick-troubleshoot-on-basics","status":"publish","type":"post","link":"https:\/\/muse.oneshot.in\/?p=139","title":{"rendered":"Nagios Timeout issues- A quick troubleshoot on basics"},"content":{"rendered":"<header class=\"entry-header\">\n<h1 class=\"entry-title\">How-To: Fix service check time outs in Nagios + NRPE deployed\u00a0in\u00a0CentOS\/RHEL\u00a05<\/h1>\n<\/header>\n<p>Once you get used to writing plug-ins in Nagios and the complexity of the plug-ins you write grows, you may encounter this error, <code><strong>service check timed out<\/strong><\/code>.<\/p>\n<p>If some of your service checks have this problem, you can isolate the problem in these 3 values:<\/p>\n<p>1. <strong>how slow is the plugin<\/strong><\/p>\n<ul>\n<ul>This is the first thing you should do. Check if how much time does your plugin needs before it can finish checking and provide an exit status. Log-on to the server\u00a0you\u2019re monitoring and run the plugin locally. Use the<\/ul>\n<\/ul>\n<p><code>time<\/code><\/p>\n<ul>command to measure.<\/ul>\n<p><code>$ time \/usr\/lib\/nagios\/plugins\/check_service<\/code><\/p>\n<p>2. <strong>how short is NRPE\u2019s patience<\/strong><\/p>\n<ul>\n<ul>Once you have the value (in seconds) in step #1, check your NRPE configuration in that same server . The default location of NRPE\u2019s configuration is<\/ul>\n<\/ul>\n<p><code>\/etc\/nagios\/nrpe.cfg<\/code><\/p>\n<ul>\n<ul>Find this parameter,<\/ul>\n<\/ul>\n<p><code>command_timeout<\/code><\/p>\n<ul>. The value of this parameter, in seconds, must be greater than the value that you\u2019ve got in step #1.<\/ul>\n<ul>\n<ul>Once the parameter\u2019s been set, restart the NRPE service (<\/ul>\n<\/ul>\n<p><code>service nrpe restart<\/code><\/p>\n<ul>).<\/ul>\n<p>3. <strong>how short is Nagios\u2019 patience<\/strong><\/p>\n<ul>\n<ul>Nagios executes a command,<\/ul>\n<\/ul>\n<p><code>check_nrpe<\/code><\/p>\n<ul>\n<ul>, to connect to a NRPE service.<\/ul>\n<\/ul>\n<p><code>check_nrpe<\/code><\/p>\n<ul>\n<ul>has a timeout paramer,<\/ul>\n<\/ul>\n<p><code>-t<\/code><\/p>\n<ul>. This parameter must have a bigger value than the one you set in step #2.<\/ul>\n<ul>\n<ul>Log-on to your Nagios server and you can set this by opening the commands configuration file,<\/ul>\n<\/ul>\n<p><code>\/etc\/nagios\/objects\/commands.cfg<\/code><\/p>\n<ul>\n<ul>Find<\/ul>\n<\/ul>\n<p><code>check_nrpe<\/code><\/p>\n<ul>\n<ul>, and edit its<\/ul>\n<\/ul>\n<p><code>command_line<\/code><\/p>\n<ul>\n<ul>and set the<\/ul>\n<\/ul>\n<p><code>-t<\/code><\/p>\n<ul>\n<ul>parameter. For instance, if you want the timeout value to be 500 seconds, it will look like this:<\/ul>\n<\/ul>\n<p><code>command_line $USER1$\/check_nrpe -H $HOSTADDRESS$ -c $ARG1$ -t 500<\/code><\/p>\n<ul>\n<ul>Restart the Nagios service afterwards (<\/ul>\n<\/ul>\n<p><code>service nagios restart<\/code><\/p>\n<ul>).<\/ul>\n<p>In most cases these 3 steps should do<\/p>\n","protected":false},"excerpt":{"rendered":"<p>How-To: Fix service check time outs in Nagios + NRPE deployed\u00a0in\u00a0CentOS\/RHEL\u00a05 Once you get used to writing plug-ins in Nagios and the complexity of the plug-ins you write grows, you may encounter this error, service check timed out. If some of your service checks have this problem, you can isolate the problem in these 3 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":137,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[9],"tags":[],"class_list":["post-139","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-nagios"],"_links":{"self":[{"href":"https:\/\/muse.oneshot.in\/index.php?rest_route=\/wp\/v2\/posts\/139","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/muse.oneshot.in\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/muse.oneshot.in\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/muse.oneshot.in\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/muse.oneshot.in\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=139"}],"version-history":[{"count":1,"href":"https:\/\/muse.oneshot.in\/index.php?rest_route=\/wp\/v2\/posts\/139\/revisions"}],"predecessor-version":[{"id":140,"href":"https:\/\/muse.oneshot.in\/index.php?rest_route=\/wp\/v2\/posts\/139\/revisions\/140"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/muse.oneshot.in\/index.php?rest_route=\/wp\/v2\/media\/137"}],"wp:attachment":[{"href":"https:\/\/muse.oneshot.in\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=139"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/muse.oneshot.in\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=139"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/muse.oneshot.in\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=139"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}