[Nagiosplug-help] R: check_by_ssh timed out issue

Mirza Dedic mirde at oppy.com
Thu May 27 16:11:39 CEST 2010


How did you get the -u switch to appear on check_by_ssh?

Mine does not seem to have this, this is the output of -h for my plugin.

check_by_ssh v2002 (nagios-plugins 1.4.13)
Copyright (c) 1999 Karl DeBisschop <kdebisschop at users.sourceforge.net>
Copyright (c) 2000-2008 Nagios Plugin Development Team
      <nagiosplug-devel at lists.sourceforge.net>

This plugin uses SSH to execute commands on a remote host

Usage: check_by_ssh -H <host> -C <command> [-fqv] [-1|-2] [-4|-6]
       [-S [lines]] [-E [lines]] [-t timeout] [-i identity]
       [-l user] [-n name] [-s servicelist] [-O outputfile]
       [-p port] [-o ssh-option]

Options:
-h, --help
    Print detailed help screen
-V, --version
    Print version information
--extra-opts=[section][@file]
    Read additionnal options from ini file
-H, --hostname=ADDRESS
    Host name, IP Address, or unix socket (must be an absolute path)
-p, --port=INTEGER
    Port number (default: none)
-4, --use-ipv4
    Use IPv4 connection
-6, --use-ipv6
    Use IPv6 connection
-1, --proto1
    tell ssh to use Protocol 1 [optional]
-2, --proto2
    tell ssh to use Protocol 2 [optional]
-S, --skip-stdout[=n]
    Ignore all or (if specified) first n lines on STDOUT [optional]
-E, --skip-stderr[=n]
    Ignore all or (if specified) first n lines on STDERR [optional]
-f
    tells ssh to fork rather than create a tty [optional]. This will always return OK if ssh is executed
-C, --command='COMMAND STRING'
    command to execute on the remote machine
-l, --logname=USERNAME
    SSH user name on remote host [optional]
-i, --identity=KEYFILE
    identity of an authorized key [optional]
-O, --output=FILE
    external command file for nagios [optional]
-s, --services=LIST
    list of nagios service names, separated by ':' [optional]
-n, --name=NAME
    short name of host in nagios configuration [optional]
-o, --ssh-option=OPTION
    Call ssh with '-o OPTION' (may be used multiple times) [optional]
-q, --quiet
    Tell ssh to suppress warning and diagnostic messages [optional]
-w, --warning=DOUBLE
    Response time to result in warning status (seconds)
-c, --critical=DOUBLE
    Response time to result in critical status (seconds)
-t, --timeout=INTEGER
    Seconds before connection times out (default: 10)
-v, --verbose
    Show details for command-line debugging (Nagios may truncate output)

The most common mode of use is to refer to a local identity file with
the '-i' option. In this mode, the identity pair should have a null
passphrase and the public key should be listed in the authorized_keys
file of the remote host. Usually the key will be restricted to running
only one command on the remote server. If the remote SSH server tracks
invocation arguments, the one remote program may be an agent that can
execute additional commands as proxy

To use passive mode, provide multiple '-C' options, and provide
all of -O, -s, and -n options (servicelist order must match '-C'options)

Examples:
$ check_by_ssh -H localhost -n lh -s c1:c2:c3 -C uptime -C uptime -C uptime -O /tmp/foo
$ cat /tmp/foo
[1080933700] PROCESS_SERVICE_CHECK_RESULT;flint;c1;0; up 2 days
[1080933700] PROCESS_SERVICE_CHECK_RESULT;flint;c2;0; up 2 days
[1080933700] PROCESS_SERVICE_CHECK_RESULT;flint;c3;0; up 2 days

Notes:
See: http://nagiosplugins.org/extra-opts for --extra-opts usage and examples.

Send email to nagios-users at lists.sourceforge.net if you have questions
regarding use of this software. To submit patches or suggest improvements,
send email to nagiosplug-devel at lists.sourceforge.net


From: Valerio.FABRIZIO at sungard.com [mailto:Valerio.FABRIZIO at sungard.com]
Sent: May/26/2010 10:54 PM
To: nagiosplug-help at lists.sourceforge.net
Subject: [Nagiosplug-help] R: check_by_ssh timed out issue



Hi
I've had the same problem with some remote checks, I solved it by adding a "-u" in the command. ("u" turns a time out critical into a time out unknown message). This works only if your plugin accept this value.


Regards
Valerio
________________________________
Da: Mirza Dedic [mailto:mirde at oppy.com]
Inviato: giovedì 27 maggio 2010 5.18
A: 'Nagios Plugin Help List'
Oggetto: Re: [Nagiosplug-help] check_by_ssh timed out issue

I get that, but with the check script the "timed out" warning comes back as a critical.

I might be stuck with this as there is no "switch" to add to check_by_ssh for timed out values to not raise a critical condition as I've seen in some other scripts.

From: Tony Parsonage [mailto:TParsonage at thiess.com.au]
Sent: May/26/2010 5:02 PM
To: Nagios Plugin Help List
Subject: Re: [Nagiosplug-help] check_by_ssh timed out issue

You should be able to set the alert so that if you get an 'unknown' response then  will not alert.  I am unsure where this is set on the command line, my copy of Groundworks uses a web browser front end and it is set as below:

[cid:image001.jpg at 01CAFD6B.D8F67940]

If I untick the box for 'unknown' then save your configuration then I only get emails for Warning and Critical alerts.

Tony

From: Mirza Dedic [mailto:mirde at oppy.com]
Sent: Thursday, 27 May 2010 9:50 AM
To: 'nagiosplug-help at lists.sourceforge.net'
Subject: [Nagiosplug-help] check_by_ssh timed out issue


Hi List,



I have Nagios currently using check_by_ssh (check_by_ssh v2002 (nagios-plugins 1.4.13)) to check some of my remote servers, it calls a log script on the remote server and the log script returns a warning if the log files matches the criteria.



Every now and then, the check_by_ssh script gets timed out, and returns the message below.



Is there a way to suppress this at the Nagios box, so that Plugin Timed Out messages do not get emailed as "Critical"?



Anyone know? Below is my command definition..



define command{

                command_name             van-oppy-pro_data450

                command_line $USER1$/check_by_ssh -H someserver -p 22 -i /home/nagios/.ssh/id_dsa -t 10 -C "/home/nagios/plugins/check_logfiles -t 30 -f /home/nagios/log_conf/usr1_data450.lg"

}



Nagios alert returned when the box being queried is very busy (this does not happen often, but creates a unwanted false positive warning):



CRITICAL - Plugin timed out while executing system call



Click here<https://www.mailcontrol.com/sr/wQw0zmjPoHdJTZGyOCrrhg==> to report this email as spam.

The Oppenheimer Group ---- CONFIDENTIAL



This message is for the designated recipient only and may contain privileged, proprietary, or otherwise private information. If you have received it in error, please notify the sender immediately and delete the original. Any other use of the email by you is prohibited.




_____________________________________________________________________

IMPORTANT - This email and any attachments may be confidential and privileged.

If received in error, please contact Thiess and delete all copies.  You may not

rely on advice and documents received by email unless confirmed by a signed Thiess

letter.  This restriction on reliance will not apply to the extent that the above email

communication is between parties to a contract and is authorised under that contract.

Before opening or using attachments, check them for viruses and defects.  Thiess'

liability is limited to resupplying any affected attachments.



The Oppenheimer Group ---- CONFIDENTIAL



This message is for the designated recipient only and may contain privileged, proprietary, or otherwise private information. If you have received it in error, please notify the sender immediately and delete the original. Any other use of the email by you is prohibited.

The Oppenheimer Group ---- CONFIDENTIAL

This message is for the designated recipient only and may contain privileged, proprietary, or otherwise private information. If you have received it in error, please notify the sender immediately and delete the original. Any other use of the email by you is prohibited.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.monitoring-plugins.org/archive/help/attachments/20100527/692ce1fa/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.jpg
Type: image/jpeg
Size: 8765 bytes
Desc: image001.jpg
URL: <https://www.monitoring-plugins.org/archive/help/attachments/20100527/692ce1fa/attachment.jpg>


More information about the Help mailing list