mirror of
https://github.com/Icinga/icingaweb2-module-businessprocess.git
synced 2026-01-16 09:42:53 -05:00
commit
3fe1c9d1a7
4 changed files with 17 additions and 7 deletions
2
.github/workflows/php.yml
vendored
2
.github/workflows/php.yml
vendored
|
|
@ -17,7 +17,7 @@ jobs:
|
|||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
php: ['7.1', '7.2', '7.3', '7.4', '8.0', '8.1']
|
||||
php: ['7.2', '7.3', '7.4', '8.0', '8.1']
|
||||
os: ['ubuntu-latest']
|
||||
|
||||
steps:
|
||||
|
|
|
|||
|
|
@ -101,6 +101,12 @@ class ProcessCommand extends Command
|
|||
*/
|
||||
public function checkAction()
|
||||
{
|
||||
$nodeName = $this->params->shift();
|
||||
if (! $nodeName) {
|
||||
Logger::error('A process name is required');
|
||||
exit(1);
|
||||
}
|
||||
|
||||
try {
|
||||
$name = $this->params->get('config');
|
||||
if ($name === null) {
|
||||
|
|
@ -125,7 +131,7 @@ class ProcessCommand extends Command
|
|||
|
||||
/** @var BpNode $node */
|
||||
try {
|
||||
$node = $bp->getNode($this->params->shift());
|
||||
$node = $bp->getNode($nodeName);
|
||||
MonitoringState::apply($bp);
|
||||
if ($bp->hasErrors()) {
|
||||
Logger::error("Checking Business Process '%s' failed: %s\n", $name, $bp->getErrors());
|
||||
|
|
@ -133,7 +139,7 @@ class ProcessCommand extends Command
|
|||
exit(3);
|
||||
}
|
||||
} catch (Exception $err) {
|
||||
Logger::error("Checking Business Process '%s' failed: %s", $name, $err->getMessage());
|
||||
Logger::error("Checking Business Process '%s' failed: %s", $name, $err);
|
||||
|
||||
exit(3);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -54,10 +54,13 @@ class SimulationForm extends QuickForm
|
|||
'class' => 'autosubmit',
|
||||
'value' => $this->simulatedNode ? $node->getState() : null,
|
||||
));
|
||||
if (in_array($this->getSentValue('state'), array('0', '99'))) {
|
||||
|
||||
$sentState = $this->getSentValue('state');
|
||||
if (in_array($sentState, array('0', '99'))) {
|
||||
return;
|
||||
}
|
||||
if ($hasSimulation || ctype_digit($this->getSentValue('state'))) {
|
||||
|
||||
if ($hasSimulation || ($sentState !== null && ctype_digit($sentState))) {
|
||||
$this->addElement('checkbox', 'acknowledged', array(
|
||||
'label' => $this->translate('Acknowledged'),
|
||||
'value' => $node->isAcknowledged(),
|
||||
|
|
@ -98,8 +101,9 @@ class SimulationForm extends QuickForm
|
|||
public function onSuccess()
|
||||
{
|
||||
$nodeName = $this->node->getName();
|
||||
$state = $this->getValue('state');
|
||||
|
||||
if (ctype_digit($this->getValue('state'))) {
|
||||
if ($state !== null && ctype_digit($state)) {
|
||||
$this->notifySuccess($this->translate('Simulation has been set'));
|
||||
$this->simulation->set($nodeName, (object) array(
|
||||
'state' => $this->getValue('state'),
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ Requirements
|
|||
------------
|
||||
|
||||
* Icinga Web 2 (>= 2.9)
|
||||
* PHP (>= 7.1)
|
||||
* PHP (>= 7.2)
|
||||
* Icinga Web 2 modules:
|
||||
* The `monitoring` module needs to be configured and enabled.
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue