diff options
author | jim-p <jimp@pfsense.org> | 2011-10-17 15:31:22 -0400 |
---|---|---|
committer | jim-p <jimp@pfsense.org> | 2011-10-17 15:31:22 -0400 |
commit | f52026d30ffc5354a99999b5b036c67188b6018d (patch) | |
tree | 07a15c018c70f0ba2543a5924121b8cf232821b3 /config/nrpe2/nrpe2.inc | |
parent | e696bc409f773579808ebf0e2e9bd03ae17d1f1a (diff) | |
download | pfsense-packages-f52026d30ffc5354a99999b5b036c67188b6018d.tar.gz pfsense-packages-f52026d30ffc5354a99999b5b036c67188b6018d.tar.bz2 pfsense-packages-f52026d30ffc5354a99999b5b036c67188b6018d.zip |
Move this variable away from being a global. For some reason PHP refuses to honor the global declaration here when it's run at boot time, and the variable ends up empty and writing an invalid config.
Diffstat (limited to 'config/nrpe2/nrpe2.inc')
-rw-r--r-- | config/nrpe2/nrpe2.inc | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/config/nrpe2/nrpe2.inc b/config/nrpe2/nrpe2.inc index 2d136c3a..e60e5d2e 100644 --- a/config/nrpe2/nrpe2.inc +++ b/config/nrpe2/nrpe2.inc @@ -25,8 +25,6 @@ require_once('filter.inc'); -$nagios_check_path = "/usr/local/libexec/nagios"; - function nrpe2_custom_php_install_command() { global $g, $config; conf_mount_rw(); @@ -140,9 +138,10 @@ function nrpe2_custom_php_deinstall_command() { } function nrpe2_custom_php_write_config() { - global $g, $config, $nagios_check_path; - conf_mount_rw(); + global $g, $config; + $nagios_check_path = "/usr/local/libexec/nagios"; + conf_mount_rw(); $cmds = array(); foreach ($config['installedpackages']['nrpe2']['config'][0]['row'] as $cmd) { if (is_executable("{$nagios_check_path}/{$cmd['command']}")) @@ -186,7 +185,7 @@ function nrpe2_custom_php_service() { } function nrpe2_get_commands() { - global $nagios_check_path; + $nagios_check_path = "/usr/local/libexec/nagios"; $commands = glob("{$nagios_check_path}/check_*"); $cmdarr = array(); foreach ($commands as $cmd) |