From f52026d30ffc5354a99999b5b036c67188b6018d Mon Sep 17 00:00:00 2001 From: jim-p Date: Mon, 17 Oct 2011 15:31:22 -0400 Subject: 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. --- config/nrpe2/nrpe2.inc | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'config/nrpe2') 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) -- cgit v1.2.3