Questions Tagged With nagioshttp://linuxexchange.org/tags/nagios/?type=rssquestions tagged <span class="tag">nagios</span>enFri, 30 Mar 2012 14:23:43 -0400shell script does not run in Nagioshttp://linuxexchange.org/questions/2814/shell-script-does-not-run-in-nagios<p>I have a following issue with Nagios. Here is my command definition:</p> <p>define command{</p> <pre><code>command_name dlg_notifications command_line /usr/local/nagios/libexec/nagios-msg-broker.sh } </code></pre> <p>and service definition</p> <p>define service{</p> <p>use mypc service_description dlg_Alerts_notifications check_command dlg_notifications max_check_attempts 1 retain_status_information 0 retain_nonstatus_information 0 }</p> <p>/bin/bash /usr/local/nagios/libexec/nagios-msg-broker.sh runs fine manually.</p> <p>I can run this script manually, but service defined above can’t run it. Here are the ownership/permissions of the script:</p> <p>perfserver-10:/usr/local/nagios/libexec$ ls -l nagios-msg-broker.sh -rwxrwxrwx 1 nagios nagcmd 149 Mar 30 10:04 nagios-msg-broker.sh</p> <p>Thanks.</p>lesmanFri, 30 Mar 2012 14:23:43 -0400http://linuxexchange.org/questions/2814/shell-script-does-not-run-in-nagiosnagiosHow to schedule a nagios host downtime from commandline?http://linuxexchange.org/questions/2640/how-to-schedule-a-nagios-host-downtime-from-commandline<p>Hi,</p> <p>I have a problem..I want to schedule specific nagios severs downtime from the commandline by curl.How do I do that?</p> <p>Al though someone suggest me a script from serverfault site to do the service and host notification eneable and disable from commandline by curl.</p> <p>Looking for similar script which will trigger the scheduled downtime from the commandline instead going to the web interface.</p> <p>curl -d " some key value pair(hostname,servicename" url "username:passowrd"</p> <p>which will do the service/host notification on and off from the commandline. So I want use curl in this fashion to provide downtime for specific nagios server.</p> <p>Above script is not working for it because downtime option of nagios taked more parameter and I tried to infuse those in the script..but it didn't work out that way.We need provide starttime,endtime and comment value too.</p> <p>Plus I have tried curl's option called --form and --form-string with that script..not able to get through.</p> <p>The besic idea is instead of going to the Nagios web interface, we want to done this thing from the command line(we have succeded for service/host service and notification).</p> <p>TIA Bhaskar</p>unixbhaskarWed, 27 Jul 2011 05:41:40 -0400http://linuxexchange.org/questions/2640/how-to-schedule-a-nagios-host-downtime-from-commandlinenagiosNagios SCHEDULE_FORCED_HOST_CHECK not runninghttp://linuxexchange.org/questions/1108/nagios-schedule_forced_host_check-not-running<p>In nagios, when I force a host check, I can clearly see in the logs:</p> <pre><code>[1279640879] EXTERNAL COMMAND: SCHEDULE_FORCED_HOST_CHECK;random-host.domain.org;1279640878 </code></pre> <p>However it never actually runs the check-host-alive check, which is check_ping.</p> <p>It doesn't appear in the scheduling queue, and even though the host in not pingable, and running the command itself fails it still shows as being up.</p> <pre><code>/usr/local/nagios/libexec/check_ping -H random-host.domain.org -w 3000.0,80% -c 5000.0,100% -p 1 CRITICAL - Host Unreachable (random-host.domain.org) Host Status: UP Status Information: PING OK - Packet loss = 0%, RTA = 1.10 ms Performance Data: Current Attempt: 1/10 State Type: HARD Last Check Type: ACTIVE Last Check Time: 07-19-2010 16:02:03 Status Data Age: 0d 0h 0m 30s Next Scheduled Active Check: N/A Latency: 0.000 seconds Check Duration: 0.053 seconds Last State Change: 04-01-2009 15:58:50 Current State Duration: 474d 0h 3m 43s Last Host Notification: N/A Current Notification Number: 0 Is This Host Flapping? NO Percent State Change: 0.00% In Scheduled Downtime? NO Last Update: 07-19-2010 16:02:25 </code></pre> <p>I can grep back through my archive logs, and see where hosts have been reported down however the above host was down for almost 30 minutes and we still received no alert:</p> <pre><code>HOST ALERT: some-other-random-host.org;DOWN;SOFT;1;CRITICAL - Host Unreachable (some-other-random-host.org) </code></pre> <p>My host and check-host-alive settings are:</p> <pre><code>define host{ name linuxprod-server use generic-host check_period 24x7 max_check_attempts 10 check_command check-host-alive notification_period 24x7 notification_interval 120 notification_options d,u,r contact_groups linux admins register 0 } </code></pre> <p>and check-host-alive is defined here:</p> <pre><code># 'check-host-alive' command definition define command{ command_name check-host-alive command_line $USER1$/check_ping -H $HOSTALIAS$ -w 3000.0,80% -c 5000.0,100% -p 1 } </code></pre> <p>Thoughts?</p>rfelsburgTue, 20 Jul 2010 16:04:48 -0400http://linuxexchange.org/questions/1108/nagios-schedule_forced_host_check-not-runningnagiosnot-executesystem-administrationlinuxqueueNagios: Event handlers not executing.http://linuxexchange.org/questions/355/nagios-event-handlers-not-executing<p>Greetings:</p> <p>I am using Nagios to monitor a host. If the host looses connectivity, I want Nagios to execute an event handler.</p> <p>The host definition contains a defined event_handler directive. The host inherits from generic-host and; therefore, event_handler_enabled is 1. In my main configuration file event handling is enabled. The associated command configuration file has also been defined.</p> <p>While troubleshooting I tried the following as root:</p> <h1>su nagios</h1> <h1>./test-handler [and my args here of course]</h1> <p>The output is correct as user nagios. However, the nagios binary that runs under user nagios will not execute the script. Here is a bit of my nagios.log file:</p> <p>[1273208210] HOST ALERT: vXP;DOWN;SOFT;2;CRITICAL - Host Unreachable (192.168.0.21) [1273208210] HOST EVENT HANDLER: vXP;(null);(null);(null);test-handler!$HOSTADDRESS$ [1273208212] EXTERNAL COMMAND: SCHEDULE_FORCED_HOST_CHECK;vXP;1273208211 [1273208220] HOST ALERT: vXP;UP;SOFT;3;PING OK - Packet loss = 0%, RTA = 35.37 ms [1273208220] HOST EVENT HANDLER: vXP;(null);(null);(null);test-handler!$HOSTADDRESS$</p> <p>According to the output, nagios appears to be running my command; however, based on the output it is actually doing nothing at all. I know that whatever I'm missing is probably very simple (and knowing me; it's right under my nose), but I'm at a loss.</p> <p>Any takers?</p>michealFri, 07 May 2010 05:08:06 -0400http://linuxexchange.org/questions/355/nagios-event-handlers-not-executingnagiosevent-handlernot-execute