mirror of
https://github.com/Icinga/icinga2.git
synced 2025-07-28 16:14:09 +02:00
parent
be4324c606
commit
9b9ee5c425
@ -163,6 +163,7 @@ Custom Attributes:
|
|||||||
Name | Description
|
Name | Description
|
||||||
----------------|--------------
|
----------------|--------------
|
||||||
ssh_address | **Optional.** The host's address. Defaults to "$address$".
|
ssh_address | **Optional.** The host's address. Defaults to "$address$".
|
||||||
|
ssh_port | **Optional.** The port that should be checked. Defaults to 22.
|
||||||
|
|
||||||
### <a id="itl-disk"></a> disk
|
### <a id="itl-disk"></a> disk
|
||||||
|
|
||||||
|
@ -193,10 +193,18 @@ object CheckCommand "ntp_time" {
|
|||||||
object CheckCommand "ssh" {
|
object CheckCommand "ssh" {
|
||||||
import "plugin-check-command"
|
import "plugin-check-command"
|
||||||
|
|
||||||
command = [
|
command = PluginDir + "/check_ssh"
|
||||||
PluginDir + "/check_ssh",
|
|
||||||
"$ssh_address$"
|
arguments = {
|
||||||
]
|
"-p" = {
|
||||||
|
value = "$ssh_port$"
|
||||||
|
optional = true
|
||||||
|
}
|
||||||
|
"host" = {
|
||||||
|
value = "$ssh_address$"
|
||||||
|
skip_key = true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
vars.ssh_address = "$address$"
|
vars.ssh_address = "$address$"
|
||||||
}
|
}
|
||||||
|
@ -208,6 +208,7 @@
|
|||||||
%attribute %string "value"
|
%attribute %string "value"
|
||||||
%attribute %string "description"
|
%attribute %string "description"
|
||||||
%attribute %number "optional"
|
%attribute %number "optional"
|
||||||
|
%attribute %number "skip_key"
|
||||||
%attribute %string "set_if"
|
%attribute %string "set_if"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -59,13 +59,15 @@ void PluginUtility::ExecuteCommand(const Command::Ptr& commandObj, const Checkab
|
|||||||
const Value& arginfo = kv.second;
|
const Value& arginfo = kv.second;
|
||||||
|
|
||||||
bool optional = false;
|
bool optional = false;
|
||||||
|
bool skip_key = false;
|
||||||
String argval;
|
String argval;
|
||||||
|
|
||||||
if (arginfo.IsObjectType<Dictionary>()) {
|
if (arginfo.IsObjectType<Dictionary>()) {
|
||||||
Dictionary::Ptr argdict = arginfo;
|
Dictionary::Ptr argdict = arginfo;
|
||||||
argval = argdict->Get("value");
|
argval = argdict->Get("value");
|
||||||
optional = argdict->Get("optional");
|
optional = argdict->Get("optional");
|
||||||
|
skip_key = argdict->Get("skip_key");
|
||||||
|
|
||||||
String set_if = argdict->Get("set_if");
|
String set_if = argdict->Get("set_if");
|
||||||
|
|
||||||
if (!set_if.IsEmpty()) {
|
if (!set_if.IsEmpty()) {
|
||||||
@ -106,7 +108,8 @@ void PluginUtility::ExecuteCommand(const Command::Ptr& commandObj, const Checkab
|
|||||||
}
|
}
|
||||||
|
|
||||||
Array::Ptr command_arr = command;
|
Array::Ptr command_arr = command;
|
||||||
command_arr->Add(argname);
|
if (!skip_key)
|
||||||
|
command_arr->Add(argname);
|
||||||
if (!argval.IsEmpty())
|
if (!argval.IsEmpty())
|
||||||
command_arr->Add(argresolved);
|
command_arr->Add(argresolved);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user