added basic command examples
This commit is contained in:
11
README.md
11
README.md
@@ -87,7 +87,16 @@ There are currently no mandatory parameters, i.e. the module will function right
|
|||||||
* `$ne_include_selinux` : Whether to manage selinux exception rules. Defaults to `true`.
|
* `$ne_include_selinux` : Whether to manage selinux exception rules. Defaults to `true`.
|
||||||
|
|
||||||
### Managing Check Commands
|
### Managing Check Commands
|
||||||
In order to connect a Nagios monitoring server to clients through NRPE, you must define commands and the desired argument strings on the clients.
|
In order to connect a Nagios monitoring server to clients through NRPE, you must define commands and the desired argument strings on the clients. The default NRPE installation comes with a few examples of such commands, which are also included in this module. However, every environment is very different in their requirements and Nagios via Puppet is all about the ability to dynamicically set command arguments based on default variables / overrides. For that reason no hard-coded commands are included, but instead all commands are set via argument strings, where possible.
|
||||||
|
|
||||||
|
Defining commands is as simple as that:
|
||||||
|
```
|
||||||
|
`cd_nrpe::commands::definitions` { 'check_users':
|
||||||
|
`ne_check_cmd` => 'check_users',
|
||||||
|
`ne_cmd_argstring` => '-w $ARG1$ -c $ARG2$',
|
||||||
|
}
|
||||||
|
```
|
||||||
|
It is very recommendable to define such commands within Puppet modules controlling services, so any node running the particular service will automatically get the required check commands defined as well.
|
||||||
|
|
||||||
|
|
||||||
### SELINUX
|
### SELINUX
|
||||||
|
|||||||
@@ -61,6 +61,24 @@ class cd_nrpe::commands::definition_rules (
|
|||||||
ne_cmd_argstring => '-w $ARG1$ -c $ARG2$',
|
ne_cmd_argstring => '-w $ARG1$ -c $ARG2$',
|
||||||
}
|
}
|
||||||
|
|
||||||
|
cd_nrpe::commands::definitions { 'check_load':
|
||||||
|
ne_check_cmd => 'check_load',
|
||||||
|
ne_cmd_argstring => '-w $ARG1$ -c $ARG2$',
|
||||||
|
}
|
||||||
|
|
||||||
|
cd_nrpe::commands::definitions { 'check_disk':
|
||||||
|
ne_check_cmd => 'check_disk',
|
||||||
|
ne_cmd_argstring => '-w $ARG1$ -c $ARG2$ -p $ARG3$',
|
||||||
|
}
|
||||||
|
|
||||||
|
cd_nrpe::commands::definitions { 'check_procs':
|
||||||
|
ne_check_cmd => 'check_procs',
|
||||||
|
ne_cmd_argstring => '-w $ARG1$ -c $ARG2$ -s $ARG3$',
|
||||||
|
}
|
||||||
|
|
||||||
|
cd_nrpe::commands::definitions { 'check_swap':
|
||||||
|
ne_check_cmd => 'check_swap',
|
||||||
|
ne_cmd_argstring => '-w $ARG1$ -c $ARG2$',
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,2 +1,2 @@
|
|||||||
|
|
||||||
cmd[<%= @ne_check_cmd %>]= <%= @ne_cmd_path %><%= @ne_check_cmd %> <%= @ne_cmd_argstring %>
|
cmd[<%= @ne_check_cmd %>]=<%= @ne_cmd_path %><%= @ne_check_cmd %> <%= @ne_cmd_argstring %>
|
||||||
|
|||||||
Reference in New Issue
Block a user