mirror of
https://github.com/Icinga/icingaweb2-module-businessprocess.git
synced 2026-05-28 04:34:08 -04:00
parent
a2309c4786
commit
09cb5ef6fe
1 changed files with 13 additions and 8 deletions
|
|
@ -2,6 +2,8 @@
|
|||
|
||||
namespace Icinga\Module\Businessprocess\Clicommands;
|
||||
|
||||
use Exception;
|
||||
use Icinga\Application\Logger;
|
||||
use Icinga\Cli\Command;
|
||||
use Icinga\Module\Businessprocess\BpConfig;
|
||||
use Icinga\Module\Businessprocess\BpNode;
|
||||
|
|
@ -116,14 +118,17 @@ class ProcessCommand extends Command
|
|||
}
|
||||
|
||||
/** @var BpNode $node */
|
||||
$node = $bp->getNode($this->params->shift());
|
||||
MonitoringState::apply($bp);
|
||||
if ($bp->hasErrors()) {
|
||||
printf(
|
||||
"Checking Business Process %s failed: %s\n",
|
||||
$node->getAlias(),
|
||||
implode("\n", $bp->getErrors())
|
||||
);
|
||||
try {
|
||||
$node = $bp->getNode($this->params->shift());
|
||||
MonitoringState::apply($bp);
|
||||
if ($bp->hasErrors()) {
|
||||
Logger::error("Checking Business Process %s failed: %s\n");
|
||||
|
||||
exit(3);
|
||||
}
|
||||
} catch (Exception $err) {
|
||||
Logger::error("Checking Business Process failed: " . $err->getMessage());
|
||||
|
||||
exit(3);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue