Module: nagvis Branch: master Commit: 68500e52e1760fc2f00f3181866583d562129489 URL: http://nagvis.git.sourceforge.net/git/gitweb.cgi?p=nagvis/nagvis;a=commit;h=68500e52e1760fc2f00f3181866583d562129489
Author: Lars Michelsen <[email protected]> Date: Wed Jul 21 15:42:23 2010 +0200 Renamed the alivehost to statushost --- docs/en_US/nagvis_config_format_description.html | 6 ++-- etc/nagvis.ini.php-sample | 12 +++++----- share/server/core/classes/CoreBackendMgmt.php | 24 +++++++++++----------- share/server/core/classes/GlobalMainCfg.php | 2 +- 4 files changed, 22 insertions(+), 22 deletions(-) diff --git a/docs/en_US/nagvis_config_format_description.html b/docs/en_US/nagvis_config_format_description.html index 8e33b68..c350f90 100644 --- a/docs/en_US/nagvis_config_format_description.html +++ b/docs/en_US/nagvis_config_format_description.html @@ -384,15 +384,15 @@ socket="unix:/usr/local/nagios/var/rw/live" <td> backendtype </td><td>mklivestatus</td><td> type of backend - MUST be set </td> </tr> <tr> - <td>alivehost</td><td> </td> - <td><p>The alive host can be used to prevent annoying timeouts when a backend is not + <td>statushost</td><td> </td> + <td><p>The status host can be used to prevent annoying timeouts when a backend is not reachable. This is only useful in multi backend setups.</p> <p>It works as follows: The assumption is that there is a "local" backend which monitors the host of the "remote" backend. When the remote backend host is reported as UP the backend is queried as normal.</p> <p>When the remote backend host is reported as "DOWN" or "UNREACHABLE" NagVis won't try to connect to the backend anymore until the backend host gets available again.</p> - <p>The alivehost needs to be given in the following format: "<backend_id>:<hostname>" + <p>The statushost needs to be given in the following format: "<backend_id>:<hostname>" -> e.g. "live_2:nagios"</p> <p>The host needs to be in another backend than the current one to work correctly.</p> </td> diff --git a/etc/nagvis.ini.php-sample b/etc/nagvis.ini.php-sample index 492ea26..ce7bb61 100644 --- a/etc/nagvis.ini.php-sample +++ b/etc/nagvis.ini.php-sample @@ -263,7 +263,7 @@ ; The path /usr/local/nagios/var/rw has to exist [backend_live_1] backendtype="mklivestatus" -; The alive host can be used to prevent annoying timeouts when a backend is not +; The status host can be used to prevent annoying timeouts when a backend is not ; reachable. This is only useful in multi backend setups. ; ; It works as follows: The assumption is that there is a "local" backend which @@ -272,9 +272,9 @@ backendtype="mklivestatus" ; When the remote backend host is reported as "DOWN" or "UNREACHABLE" NagVis won't ; try to connect to the backend anymore until the backend host gets available again. ; -; The alivehost needs to be given in the following format: +; The statushost needs to be given in the following format: ; "<backend_id>:<hostname>" -> e.g. "live_2:nagios" -;alivehost="" +;statushost="" ;socket="unix:/usr/local/nagios/var/rw/live" ; Example definition for a MySQL backend @@ -282,7 +282,7 @@ backendtype="mklivestatus" [backend_ndomy_1] ; type of backend - MUST be set backendtype="ndomy" -; The alive host can be used to prevent annoying timeouts when a backend is not +; The status host can be used to prevent annoying timeouts when a backend is not ; reachable. This is only useful in multi backend setups. ; ; It works as follows: The assumption is that there is a "local" backend which @@ -291,9 +291,9 @@ backendtype="ndomy" ; When the remote backend host is reported as "DOWN" or "UNREACHABLE" NagVis won't ; try to connect to the backend anymore until the backend host gets available again. ; -; The alivehost needs to be given in the following format: +; The statushost needs to be given in the following format: ; "<backend_id>:<hostname>" -> e.g. "live_2:nagios" -;alivehost="" +;statushost="" ; hostname for NDO-db ;dbhost="localhost" ; portname for NDO-db diff --git a/share/server/core/classes/CoreBackendMgmt.php b/share/server/core/classes/CoreBackendMgmt.php index 58b6976..648b682 100644 --- a/share/server/core/classes/CoreBackendMgmt.php +++ b/share/server/core/classes/CoreBackendMgmt.php @@ -378,26 +378,26 @@ class CoreBackendMgmt { } /** - * Checks if a backend host is alive using status + * Checks if a backend host is status using status * information from another backend * * @author Lars Michelsen <[email protected]> */ - private function backendAlive($backendId, $aliveHost) { - list($aliveBackend, $aliveHost) = explode(':', $aliveHost, 2); + private function backendAlive($backendId, $statusHost) { + list($statusBackend, $statusHost) = explode(':', $statusHost, 2); - if($aliveBackend == $backendId) - $this->aError[$backendId] = new BackendConnectionProblem($this->CORE->getLang()->getText('Configuration Error: The aliveHost ([ALIVEHOST]) is in same backend as the one to check.', Array('ALIVEHOST' => $aliveHost))); + if($tatackend == $backendId) + $this->aError[$backendId] = new BackendConnectionProblem($this->CORE->getLang()->getText('Configuration Error: The statusHost ([STATUSHOST]) is in same backend as the one to check.', Array('STATUSHOST' => $statusHost))); try { $filters = Array(Array('key' => 'host_name', 'op' => '=', 'val' => 'name')); - $aObjs = Array($aliveHost => Array(new NagVisHost($this->CORE, $this, $aliveBackend, $aliveHost))); - $aCounts = $this->getBackend($aliveBackend)->getHostState($aObjs, 1, $filters); + $aObjs = Array($statusHost => Array(new NagVisHost($this->CORE, $this, $statusBackend, $statusHost))); + $aCounts = $this->getBackend($statusBackend)->getHostState($aObjs, 1, $filters); } catch(BackendException $e) { return true; } - if($aCounts[$aliveHost]['state'] == 'UP') + if($aCounts[$statusHost]['state'] == 'UP') return true; else return false; @@ -412,7 +412,7 @@ class CoreBackendMgmt { private function initializeBackend($backendId) { if($this->checkBackendExists($backendId, true)) { /** - * The alive host can be used to prevent annoying timeouts when a backend is not + * The status host can be used to prevent annoying timeouts when a backend is not * reachable. This is only useful in multi backend setups. * * It works as follows: The assumption is that there is a "local" backend which @@ -421,9 +421,9 @@ class CoreBackendMgmt { * When the remote backend host is reported as "DOWN" or "UNREACHABLE" NagVis won't * try to connect to the backend anymore until the backend host gets available again. */ - $aliveHost = $this->CORE->getMainCfg()->getValue('backend_' . $backendId, 'alivehost'); - if($aliveHost != '' && !$this->backendAlive($backendId, $aliveHost)) { - $this->aError[$backendId] = new BackendConnectionProblem($this->CORE->getLang()->getText('The backend is reported as dead by the aliveHost ([ALIVEHOST]).', Array('ALIVEHOST' => $aliveHost))); + $statusHost = $this->CORE->getMainCfg()->getValue('backend_' . $backendId, 'statushost'); + if($statusHost != '' && !$this->backendAlive($backendId, $statusHost)) { + $this->aError[$backendId] = new BackendConnectionProblem($this->CORE->getLang()->getText('The backend is reported as dead by the statusHost ([STATUSHOST]).', Array('STATUSHOST' => $statusHost))); return false; } diff --git a/share/server/core/classes/GlobalMainCfg.php b/share/server/core/classes/GlobalMainCfg.php index 7dc1cb6..27411cc 100644 --- a/share/server/core/classes/GlobalMainCfg.php +++ b/share/server/core/classes/GlobalMainCfg.php @@ -527,7 +527,7 @@ class GlobalMainCfg { 'editable' => 0, 'default' => '', 'match' => MATCH_STRING_NO_SPACE), - 'alivehost' => Array('must' => 0, + 'statushost' => Array('must' => 0, 'editable' => 1, 'default' => '', 'match' => MATCH_STRING_NO_SPACE_EMPTY), ------------------------------------------------------------------------------ This SF.net email is sponsored by Sprint What will you do first with EVO, the first 4G phone? Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first _______________________________________________ Nagvis-checkins mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/nagvis-checkins
