From 5f91d2a4715fe487a857533e4695dde0a9be124d Mon Sep 17 00:00:00 2001
From: Arne Teuke
Date: Sun, 30 Jul 2017 13:06:19 +0100
Subject: [PATCH 1/3] added basic command examples
---
README.md | 11 ++++++++++-
manifests/commands/definition_rules.pp | 18 ++++++++++++++++++
templates/cmd_rule.erb | 2 +-
3 files changed, 29 insertions(+), 2 deletions(-)
diff --git a/README.md b/README.md
index 0585dd1..0c11d85 100644
--- a/README.md
+++ b/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`.
### 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
diff --git a/manifests/commands/definition_rules.pp b/manifests/commands/definition_rules.pp
index 9c521e8..d34dc97 100644
--- a/manifests/commands/definition_rules.pp
+++ b/manifests/commands/definition_rules.pp
@@ -61,6 +61,24 @@ class cd_nrpe::commands::definition_rules (
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$',
+ }
}
}
diff --git a/templates/cmd_rule.erb b/templates/cmd_rule.erb
index d6435e9..20aaaf8 100644
--- a/templates/cmd_rule.erb
+++ b/templates/cmd_rule.erb
@@ -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 %>
From c0a5382d2c4cd8850246d69ae94db8b500da085c Mon Sep 17 00:00:00 2001
From: Arne Teuke
Date: Sun, 30 Jul 2017 13:07:53 +0100
Subject: [PATCH 2/3] added basic command examples
---
templates/cmd_rule.erb | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/templates/cmd_rule.erb b/templates/cmd_rule.erb
index 20aaaf8..bab311b 100644
--- a/templates/cmd_rule.erb
+++ b/templates/cmd_rule.erb
@@ -1,2 +1,2 @@
-cmd[<%= @ne_check_cmd %>]=<%= @ne_cmd_path %><%= @ne_check_cmd %> <%= @ne_cmd_argstring %>
+command[<%= @ne_check_cmd %>]=<%= @ne_cmd_path %><%= @ne_check_cmd %> <%= @ne_cmd_argstring %>
From 2e89f817d99fb64710e84b254f0512ee8d2f7841 Mon Sep 17 00:00:00 2001
From: Jenkins Server
Date: Sun, 30 Jul 2017 14:07:49 +0200
Subject: [PATCH 3/3] recommit for updates in build 43
---
CHANGELOG.md | 10 +++++
doc/_index.html | 2 +-
doc/file.README.html | 26 +++++++++++-
doc/index.html | 26 +++++++++++-
doc/puppet_classes/cd_nrpe.html | 2 +-
...e_3A_3Acommands_3A_3Adefinition_rules.html | 40 ++++++++++++++++++-
.../cd_nrpe_3A_3Afirewall_3A_3Aiptables.html | 2 +-
.../cd_nrpe_3A_3Amain_3A_3Aconfig.html | 2 +-
.../cd_nrpe_3A_3Amain_3A_3Adirs.html | 2 +-
.../cd_nrpe_3A_3Amain_3A_3Afiles.html | 2 +-
.../cd_nrpe_3A_3Amain_3A_3Ainstall.html | 2 +-
.../cd_nrpe_3A_3Amain_3A_3Aservice.html | 2 +-
.../cd_nrpe_3A_3Amain_3A_3Auser.html | 2 +-
doc/puppet_classes/cd_nrpe_3A_3Aparams.html | 2 +-
...d_nrpe_3A_3Acommands_3A_3Adefinitions.html | 2 +-
doc/top-level-namespace.html | 2 +-
16 files changed, 108 insertions(+), 18 deletions(-)
diff --git a/CHANGELOG.md b/CHANGELOG.md
index aa89e0b..52d21b2 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -8,6 +8,16 @@ Changelog of Git Changelog.
No issue
+5c0374245dc1e72 Arne Teuke 2017-07-30 11:50:55
+
+
added test command
+
+
+7782b870bf31b9d Jenkins Server 2017-07-30 11:50:48
+
+
recommit for updates in build 42
+
+
7a767e39dc3aa27 Arne Teuke 2017-07-30 11:42:09
fixed typo, added including clause to definitions
diff --git a/doc/_index.html b/doc/_index.html
index 8b2c3de..26d55f9 100644
--- a/doc/_index.html
+++ b/doc/_index.html
@@ -171,7 +171,7 @@
diff --git a/doc/file.README.html b/doc/file.README.html
index c1a0ae1..0ec7a80 100644
--- a/doc/file.README.html
+++ b/doc/file.README.html
@@ -218,7 +218,29 @@ rules. Defaults to true.
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.
+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:
+<code>
+`cd_nrpe::commands::definitions` {
+'check_users':
+ `ne_check_cmd` =>
+'check_users',
+ `ne_cmd_argstring` => '-w $ARG1$ -c
+$ARG2$',
+ }
+</code>
+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
@@ -280,7 +302,7 @@ environments.
diff --git a/doc/index.html b/doc/index.html
index f9b9fd5..0607b51 100644
--- a/doc/index.html
+++ b/doc/index.html
@@ -218,7 +218,29 @@ rules. Defaults to true.
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.
+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:
+<code>
+`cd_nrpe::commands::definitions` {
+'check_users':
+ `ne_check_cmd` =>
+'check_users',
+ `ne_cmd_argstring` => '-w $ARG1$ -c
+$ARG2$',
+ }
+</code>
+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
@@ -280,7 +302,7 @@ environments.
diff --git a/doc/puppet_classes/cd_nrpe.html b/doc/puppet_classes/cd_nrpe.html
index fd67b52..d312bff 100644
--- a/doc/puppet_classes/cd_nrpe.html
+++ b/doc/puppet_classes/cd_nrpe.html
@@ -140,7 +140,7 @@ class cd_nrpe {
diff --git a/doc/puppet_classes/cd_nrpe_3A_3Acommands_3A_3Adefinition_rules.html b/doc/puppet_classes/cd_nrpe_3A_3Acommands_3A_3Adefinition_rules.html
index 62dc055..1d950bf 100644
--- a/doc/puppet_classes/cd_nrpe_3A_3Acommands_3A_3Adefinition_rules.html
+++ b/doc/puppet_classes/cd_nrpe_3A_3Acommands_3A_3Adefinition_rules.html
@@ -177,7 +177,25 @@ href="http://www.gnu.org/licenses">www.gnu.org/licenses/.
63
64
65
-66
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
# File 'manifests/commands/definition_rules.pp', line 28
@@ -218,7 +236,25 @@ class cd_nrpe::commands::definition_rules (
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$',
+ }
}
}
|
@@ -228,7 +264,7 @@ class cd_nrpe::commands::definition_rules (
diff --git a/doc/puppet_classes/cd_nrpe_3A_3Afirewall_3A_3Aiptables.html b/doc/puppet_classes/cd_nrpe_3A_3Afirewall_3A_3Aiptables.html
index ad268f3..4f19ccf 100644
--- a/doc/puppet_classes/cd_nrpe_3A_3Afirewall_3A_3Aiptables.html
+++ b/doc/puppet_classes/cd_nrpe_3A_3Afirewall_3A_3Aiptables.html
@@ -165,7 +165,7 @@ class cd_nrpe::firewall::iptables (
diff --git a/doc/puppet_classes/cd_nrpe_3A_3Amain_3A_3Aconfig.html b/doc/puppet_classes/cd_nrpe_3A_3Amain_3A_3Aconfig.html
index f2a83ae..6af2ca9 100644
--- a/doc/puppet_classes/cd_nrpe_3A_3Amain_3A_3Aconfig.html
+++ b/doc/puppet_classes/cd_nrpe_3A_3Amain_3A_3Aconfig.html
@@ -154,7 +154,7 @@ class cd_nrpe::main::config (
diff --git a/doc/puppet_classes/cd_nrpe_3A_3Amain_3A_3Adirs.html b/doc/puppet_classes/cd_nrpe_3A_3Amain_3A_3Adirs.html
index 39749d6..fc36c8e 100644
--- a/doc/puppet_classes/cd_nrpe_3A_3Amain_3A_3Adirs.html
+++ b/doc/puppet_classes/cd_nrpe_3A_3Amain_3A_3Adirs.html
@@ -205,7 +205,7 @@ class cd_nrpe::main::dirs (
diff --git a/doc/puppet_classes/cd_nrpe_3A_3Amain_3A_3Afiles.html b/doc/puppet_classes/cd_nrpe_3A_3Amain_3A_3Afiles.html
index f342579..9dda5ea 100644
--- a/doc/puppet_classes/cd_nrpe_3A_3Amain_3A_3Afiles.html
+++ b/doc/puppet_classes/cd_nrpe_3A_3Amain_3A_3Afiles.html
@@ -217,7 +217,7 @@ class cd_nrpe::main::files (
diff --git a/doc/puppet_classes/cd_nrpe_3A_3Amain_3A_3Ainstall.html b/doc/puppet_classes/cd_nrpe_3A_3Amain_3A_3Ainstall.html
index 06e24e3..acc08e8 100644
--- a/doc/puppet_classes/cd_nrpe_3A_3Amain_3A_3Ainstall.html
+++ b/doc/puppet_classes/cd_nrpe_3A_3Amain_3A_3Ainstall.html
@@ -160,7 +160,7 @@ class cd_nrpe::main::install (
diff --git a/doc/puppet_classes/cd_nrpe_3A_3Amain_3A_3Aservice.html b/doc/puppet_classes/cd_nrpe_3A_3Amain_3A_3Aservice.html
index af8dc41..f659d1b 100644
--- a/doc/puppet_classes/cd_nrpe_3A_3Amain_3A_3Aservice.html
+++ b/doc/puppet_classes/cd_nrpe_3A_3Amain_3A_3Aservice.html
@@ -183,7 +183,7 @@ class cd_nrpe::main::service (
diff --git a/doc/puppet_classes/cd_nrpe_3A_3Amain_3A_3Auser.html b/doc/puppet_classes/cd_nrpe_3A_3Amain_3A_3Auser.html
index 8f666a0..1f16080 100644
--- a/doc/puppet_classes/cd_nrpe_3A_3Amain_3A_3Auser.html
+++ b/doc/puppet_classes/cd_nrpe_3A_3Amain_3A_3Auser.html
@@ -193,7 +193,7 @@ class cd_nrpe::main::user (
diff --git a/doc/puppet_classes/cd_nrpe_3A_3Aparams.html b/doc/puppet_classes/cd_nrpe_3A_3Aparams.html
index c89f9a1..2eb2c37 100644
--- a/doc/puppet_classes/cd_nrpe_3A_3Aparams.html
+++ b/doc/puppet_classes/cd_nrpe_3A_3Aparams.html
@@ -1059,7 +1059,7 @@ $ne_cmd_rule_erb = 'cd_nrpe/cmd_rule.erb'
diff --git a/doc/puppet_defined_types/cd_nrpe_3A_3Acommands_3A_3Adefinitions.html b/doc/puppet_defined_types/cd_nrpe_3A_3Acommands_3A_3Adefinitions.html
index dcb87fb..dfa3e06 100644
--- a/doc/puppet_defined_types/cd_nrpe_3A_3Acommands_3A_3Adefinitions.html
+++ b/doc/puppet_defined_types/cd_nrpe_3A_3Acommands_3A_3Adefinitions.html
@@ -238,7 +238,7 @@ $ne_manage_cmds = $::cd_nrpe::params::ne_manage_cmds
diff --git a/doc/top-level-namespace.html b/doc/top-level-namespace.html
index 718498b..0edab9c 100644
--- a/doc/top-level-namespace.html
+++ b/doc/top-level-namespace.html
@@ -90,7 +90,7 @@