Unterschiede
Hier werden die Unterschiede zwischen zwei Versionen angezeigt.
Beide Seiten der vorigen Revision Vorhergehende Überarbeitung Nächste Überarbeitung | Vorhergehende Überarbeitung | ||
centos:web_c7:icinga:config_1 [05.05.2015 18:57. ] – [SSH] django | centos:web_c7:icinga:config_1 [20.04.2018 10:36. ] (aktuell) – Externe Bearbeitung 127.0.0.1 | ||
---|---|---|---|
Zeile 8: | Zeile 8: | ||
- **[[centos: | - **[[centos: | ||
- **[[centos: | - **[[centos: | ||
- | - **[[centos: | + | - **[[centos: |
- **[[centos: | - **[[centos: | ||
- **[[centos: | - **[[centos: | ||
Zeile 351: | Zeile 351: | ||
- | # ssh -i / | + | # ssh -i / |
- | ############################################################################## | + | |
+ | < | ||
# | # | ||
# | # | ||
Zeile 376: | Zeile 377: | ||
############################################################################## | ############################################################################## | ||
-bash-4.1$ | -bash-4.1$ | ||
+ | </ | ||
+ | # / | ||
+ | < | ||
+ | Copyright (c) 1999 Karl DeBisschop < | ||
+ | Copyright (c) 2000-2014 Nagios Plugin Development Team | ||
+ | < | ||
+ | This plugin uses SSH to execute commands on a remote host | ||
+ | |||
+ | Usage: | ||
+ | | ||
+ | [-S [lines]] [-E [lines]] [-t timeout] [-i identity] | ||
+ | [-l user] [-n name] [-s servicelist] [-O outputfile] | ||
+ | [-p port] [-o ssh-option] [-F configfile] | ||
+ | |||
+ | Options: | ||
+ | -h, --help | ||
+ | Print detailed help screen | ||
+ | -V, --version | ||
+ | Print version information | ||
+ | | ||
+ | Read options from an ini file. See | ||
+ | https:// | ||
+ | for usage and examples. | ||
+ | -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 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 ':' | ||
+ | -n, --name=NAME | ||
+ | short name of host in nagios configuration [optional] | ||
+ | -o, --ssh-option=OPTION | ||
+ | Call ssh with '-o OPTION' | ||
+ | -F, --configfile | ||
+ | Tell ssh to use this configfile [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 ' | ||
+ | | ||
+ | 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 | ||
+ | | ||
+ | | ||
+ | |||
+ | To use passive mode, provide multiple ' | ||
+ | all of -O, -s, and -n options (servicelist order must match ' | ||
+ | |||
+ | Examples: | ||
+ | $ check_by_ssh -H localhost -n lh -s c1:c2:c3 -C uptime -C uptime -C uptime -O /tmp/foo | ||
+ | $ cat /tmp/foo | ||
+ | | ||
+ | | ||
+ | | ||
+ | |||
+ | Send email to help@nagios-plugins.org if you have questions regarding use | ||
+ | of this software. To submit patches or suggest improvements, | ||
+ | devel@nagios-plugins.org | ||
+ | </ | ||
+ | |||
+ | Auf dem Remote-Host: | ||
+ | # / | ||
+ | |||
+ | OK - load average: 0.13, 0.13, 0.09|load1=0.130; | ||
+ | |||
+ | # vim / | ||
+ | < | ||
+ | object CheckCommand " | ||
+ | import " | ||
+ | |||
+ | command = [ PluginDir + "/ | ||
+ | |||
+ | arguments = { | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | | ||
+ | } | ||
+ | " | ||
+ | | ||
+ | } | ||
+ | " | ||
+ | | ||
+ | } | ||
+ | " | ||
+ | | ||
+ | } | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | | ||
+ | } | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | | ||
+ | } | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | |||
+ | } | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | |||
+ | # vim / | ||
+ | <file cc+ / | ||
+ | // Django: 2015-05-05 | ||
+ | |||
+ | apply Service for (by_ssh => config in host.vars.by_ssh) { | ||
+ | import " | ||
+ | |||
+ | check_command = " | ||
+ | command_endpoint = host.vars.remote_client | ||
+ | |||
+ | vars += config | ||
+ | |||
+ | assign where host.vars.remote_client | ||
+ | } | ||
+ | </ | ||
==== Bridging ==== | ==== Bridging ==== | ||
Zeile 413: | Zeile 572: | ||
* **[[http:// | * **[[http:// | ||
- | ~~DISCUSSION~~ | + |