From 11375fe3e8826e02f7a5bec1f6a2d743060dbd76 Mon Sep 17 00:00:00 2001 From: Renato Botelho Date: Mon, 9 Feb 2015 16:26:24 -0200 Subject: Fix nrpe2 startup script, it should fix #4391 --- config/nrpe2/nrpe2.inc | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'config/nrpe2/nrpe2.inc') diff --git a/config/nrpe2/nrpe2.inc b/config/nrpe2/nrpe2.inc index c515ab99..aa2a582c 100644 --- a/config/nrpe2/nrpe2.inc +++ b/config/nrpe2/nrpe2.inc @@ -25,11 +25,19 @@ require_once('filter.inc'); -if (substr(trim(file_get_contents("/etc/version")),0,3) == "2.0") { +$pfs_version = substr(trim(file_get_contents("/etc/version")),0,3); + +if ($pfs_version == "2.0") { define('NRPE_BASE', '/usr/local'); } else { define('NRPE_BASE', '/usr/pbi/nrpe-' . php_uname("m")); } + +if ($pfs_version == "2.1") + define('NRPE_BINARY', NRPE_BASE . "sbin/nrpe2"); +else + define('NRPE_BINARY', "/usr/local/sbin/nrpe2"); + define('NRPE_CONFIG_DIR', NRPE_BASE . '/etc'); define('NRPE_RCFILE', '/usr/local/etc/rc.d/nrpe2.sh'); @@ -94,6 +102,7 @@ function nrpe2_custom_php_install_command() { ); } unlink_if_exists(NRPE_CONFIG_DIR . '/rc.d/nrpe2'); + $nrpe2_binary = NRPE_BINARY; $fd = fopen(NRPE_RCFILE, 'w'); $rc_file = <<