diff options
author | Yuki (aka Ruben Gomez) <rugoli@gmail.com> | 2014-09-17 10:30:59 +0200 |
---|---|---|
committer | Yuki (aka Ruben Gomez) <rugoli@gmail.com> | 2014-09-17 10:30:59 +0200 |
commit | 5cf0da83195a1f162d49e6dad374dd40f6c07dff (patch) | |
tree | 26a6056d1816037155a35951328e38144b365185 /config/nrpe2/nrpe2.inc | |
parent | 6fc32123543416dff79f9b095357c5de6805cfd4 (diff) | |
download | pfsense-packages-5cf0da83195a1f162d49e6dad374dd40f6c07dff.tar.gz pfsense-packages-5cf0da83195a1f162d49e6dad374dd40f6c07dff.tar.bz2 pfsense-packages-5cf0da83195a1f162d49e6dad374dd40f6c07dff.zip |
Modifications to allow nrpe arguments (dont_blame_nrpe) in the config edition
With this change we can allow pass arguments from Nagios server to pfsense, and
allow them or not from the NRPE config web.
To get a config file with $ARG1$ $ARG2$... we must scape them in the
"Extra options" input and put \$ARG1\$ \$ARG2\$...
Diffstat (limited to 'config/nrpe2/nrpe2.inc')
-rw-r--r-- | config/nrpe2/nrpe2.inc | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/config/nrpe2/nrpe2.inc b/config/nrpe2/nrpe2.inc index 7b249368..c515ab99 100644 --- a/config/nrpe2/nrpe2.inc +++ b/config/nrpe2/nrpe2.inc @@ -47,6 +47,7 @@ function nrpe2_custom_php_install_command() { $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]['dont_blame_nrpe'] = "on"; } if (!is_array($config['installedpackages']['nrpe2']['config'][0]['row'])) { @@ -170,6 +171,12 @@ function nrpe2_custom_php_write_config() { $server_port = $config['installedpackages']['nrpe2']['config'][0]['server_port']; $allowed_hosts = $config['installedpackages']['nrpe2']['config'][0]['allowed_hosts']; + $dont_blame_nrpe = $config['installedpackages']['nrpe2']['config'][0]['dont_blame_nrpe']; + if ($config['installedpackages']['nrpe2']['config'][0]['dont_blame_nrpe'] == "on") { + $dont_blame_nrpe = 1; + } else { + $dont_blame_nrpe = 0; + } $fd = fopen(NRPE_CONFIG_DIR . '/nrpe.cfg', 'w'); $nrpe_cfg = <<<EOD @@ -179,7 +186,7 @@ server_port={$server_port} nrpe_user=nagios nrpe_group=nagios allowed_hosts={$allowed_hosts} -dont_blame_nrpe=0 +dont_blame_nrpe={$dont_blame_nrpe} debug=0 command_timeout=60 connection_timeout=300 |