aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--config/nrpe2/nrpe2.inc96
-rw-r--r--pkg_config.8.xml2
-rw-r--r--pkg_config.8.xml.amd642
3 files changed, 52 insertions, 48 deletions
diff --git a/config/nrpe2/nrpe2.inc b/config/nrpe2/nrpe2.inc
index e60e5d2e..ca6f00ab 100644
--- a/config/nrpe2/nrpe2.inc
+++ b/config/nrpe2/nrpe2.inc
@@ -31,52 +31,56 @@ function nrpe2_custom_php_install_command() {
$ip = $config['interfaces']['lan']['ipaddr'];
- $config['installedpackages']['nrpe2']['config'][0]['enabled'] = "on";
- $config['installedpackages']['nrpe2']['config'][0]['server_address'] = $ip;
- $config['installedpackages']['nrpe2']['config'][0]['server_port'] = 5666;
- $config['installedpackages']['nrpe2']['config'][0]['allowed_hosts'] = "127.0.0.1";
-
- $config['installedpackages']['nrpe2']['config'][0]['row'] = array(
- 0 => array(
- 'name' => 'check_users',
- 'command' => 'check_users',
- 'warning' => '5',
- 'critical' => '10'
- ),
- 1 => array(
- 'name' => 'check_load',
- 'command' => 'check_load',
- 'warning' => '15,10,5',
- 'critical' => '30,25,20',
- ),
- 2 => array(
- 'name' => 'check_root',
- 'command' => 'check_disk',
- 'warning' => '20%',
- 'critical' => '10%',
- 'extra' => '-p /'
- ),
- 3 => array(
- 'name' => 'check_var',
- 'command' => 'check_disk',
- 'warning' => '20%',
- 'critical' => '10%',
- 'extra' => '-p /var/run'
- ),
- 4 => array(
- 'name' => 'check_zombie_procs',
- 'command' => 'check_procs',
- 'warning' => '5',
- 'critical' => '10',
- 'extra' => '-s Z'
- ),
- 5 => array(
- 'name' => 'check_total_procs',
- 'command' => 'check_procs',
- 'warning' => '150',
- 'critical' => '200'
- )
- );
+ if (!is_array($config['installedpackages']['nrpe2'])) {
+ $config['installedpackages']['nrpe2']['config'][0]['enabled'] = "on";
+ $config['installedpackages']['nrpe2']['config'][0]['server_address'] = $ip;
+ $config['installedpackages']['nrpe2']['config'][0]['server_port'] = 5666;
+ $config['installedpackages']['nrpe2']['config'][0]['allowed_hosts'] = "127.0.0.1";
+ }
+
+ if (!is_array($config['installedpackages']['nrpe2']['config'][0]['row'])) {
+ $config['installedpackages']['nrpe2']['config'][0]['row'] = array(
+ 0 => array(
+ 'name' => 'check_users',
+ 'command' => 'check_users',
+ 'warning' => '5',
+ 'critical' => '10'
+ ),
+ 1 => array(
+ 'name' => 'check_load',
+ 'command' => 'check_load',
+ 'warning' => '15,10,5',
+ 'critical' => '30,25,20',
+ ),
+ 2 => array(
+ 'name' => 'check_root',
+ 'command' => 'check_disk',
+ 'warning' => '20%',
+ 'critical' => '10%',
+ 'extra' => '-p /'
+ ),
+ 3 => array(
+ 'name' => 'check_var',
+ 'command' => 'check_disk',
+ 'warning' => '20%',
+ 'critical' => '10%',
+ 'extra' => '-p /var/run'
+ ),
+ 4 => array(
+ 'name' => 'check_zombie_procs',
+ 'command' => 'check_procs',
+ 'warning' => '5',
+ 'critical' => '10',
+ 'extra' => '-s Z'
+ ),
+ 5 => array(
+ 'name' => 'check_total_procs',
+ 'command' => 'check_procs',
+ 'warning' => '150',
+ 'critical' => '200'
+ )
+ );
+ }
unlink_if_exists('/usr/local/etc/rc.d/nrpe2');
$fd = fopen('/usr/local/etc/rc.d/nrpe2.sh', 'w');
$rc_file = <<<EOD
diff --git a/pkg_config.8.xml b/pkg_config.8.xml
index 3eab792f..2dd376be 100644
--- a/pkg_config.8.xml
+++ b/pkg_config.8.xml
@@ -1322,7 +1322,7 @@
<build_port_path>/usr/ports/net-mgmt/nagios-plugins</build_port_path>
<build_options>WITH_SSL=true WITHOUT_ARGS=true</build_options>
<config_file>http://www.pfsense.com/packages/config/nrpe2/nrpe2.xml</config_file>
- <version>2.12_3 v2</version>
+ <version>2.12_3 v2.1</version>
<status>Beta</status>
<required_version>1.2</required_version>
<maintainer>erik@erikkristensen.com</maintainer>
diff --git a/pkg_config.8.xml.amd64 b/pkg_config.8.xml.amd64
index cf920444..4b0b01f7 100644
--- a/pkg_config.8.xml.amd64
+++ b/pkg_config.8.xml.amd64
@@ -1250,7 +1250,7 @@
<build_port_path>/usr/ports/net-mgmt/nrpe2</build_port_path>
<build_options>WITH_SSL=true WITHOUT_ARGS=true</build_options>
<config_file>http://www.pfsense.com/packages/config/nrpe2/nrpe2.xml</config_file>
- <version>2.12_3 v2</version>
+ <version>2.12_3 v2.1</version>
<status>Beta</status>
<required_version>1.2</required_version>
<maintainer>erik@erikkristensen.com</maintainer>