cmd_test_class Class Reference
Execute a given command with asmonitor, and return the result.
More...
Public Member Functions |
| crash ($msg) |
| Print error and die.
|
| attach_object ($object) |
| Attach an object to the sandbox.
|
| cmdline ($type, $masquerade_user=true) |
| Ask the running nagios instance of the command line for a given object.
|
| runcmd ($type, $cmd_node=false, $include_code=true) |
| Run a command in a sandbox.
|
Static Public Attributes |
static | $status |
| Service status names.
|
static | $host_status |
| Host status names.
|
Detailed Description
Execute a given command with asmonitor, and return the result.
Member Function Documentation
cmd_test_class::cmdline |
( |
$ |
type, |
|
|
$ |
masquerade_user = true | |
|
) |
| | |
Ask the running nagios instance of the command line for a given object.
- Parameters:
-
| $type | the type of the object to ask for |
| $masquerade_user | if the $USERn$ vars should be masqueraded |
- Returns:
- the command line to run
cmd_test_class::runcmd |
( |
$ |
type, |
|
|
$ |
cmd_node = false , |
|
|
$ |
include_code = true | |
|
) |
| | |
Run a command in a sandbox.
- Parameters:
-
| $type | the type of the object to ask for |
| $cmd_node | the node on which to run the command on if different from the current/local node. |
| $include_code | if true, the return code will be included in the formatted output |
- Returns:
- string the output of the plugin
Field Documentation
cmd_test_class::$host_status [static] |
Initial value: array(
0 => 'OK',
1 => 'DOWN',
2 => 'UNREACHABLE'
)
Host status names.
cmd_test_class::$status [static] |
Initial value: array(
0 => 'OK',
1 => 'WARNING',
2 => 'CRITICAL',
3 => 'UNKNOWN'
)
Service status names.
The documentation for this class was generated from the following file: