Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Acknowledgements are not working without an expiry time #2911

Closed
pgress opened this issue Aug 4, 2017 · 9 comments · Fixed by #2914
Closed

Acknowledgements are not working without an expiry time #2911

pgress opened this issue Aug 4, 2017 · 9 comments · Fixed by #2914
Labels
area/monitoring Affects the monitoring module bug Something isn't working
Milestone

Comments

@pgress
Copy link

pgress commented Aug 4, 2017

We try to acknowledge an Service which is in Warning-State. We write an Comment and set Sticky Acknowledgement and press the button "Acknowledge Problem".
After this we get the following errror:

icinga2: Can't send external Icinga command: 409 Acknowledgement 'expiry' timestamp must be in the future for object localhost!Disk.

#0 /usr/share/icingaweb2/modules/monitoring/application/forms/Command/Object/AcknowledgeProblemCommandForm.php(159): Icinga\Module\Monitoring\Command\Transport\CommandTransport->send(Object(Icinga\Module\Monitoring\Command\Object\AcknowledgeProblemCommand))
#1 /usr/share/php/Icinga/Web/Form.php(1152): Icinga\Module\Monitoring\Forms\Command\Object\AcknowledgeProblemCommandForm->onSuccess()
#2 /usr/share/icingaweb2/modules/monitoring/library/Monitoring/Web/Controller/MonitoredObjectController.php(129): Icinga\Web\Form->handleRequest()
#3 /usr/share/icingaweb2/modules/monitoring/application/controllers/ServiceController.php(77): Icinga\Module\Monitoring\Web\Controller\MonitoredObjectController->handleCommandForm(Object(Icinga\Module\Monitoring\Forms\Command\Object\AcknowledgeProblemCommandForm))
#4 /usr/share/icingaweb2/library/vendor/Zend/Controller/Action.php(507): Icinga\Module\Monitoring\Controllers\ServiceController->acknowledgeProblemAction()
#5 /usr/share/php/Icinga/Web/Controller/Dispatcher.php(76): Zend_Controller_Action->dispatch('acknowledgeProb...')
#6 /usr/share/icingaweb2/library/vendor/Zend/Controller/Front.php(937): Icinga\Web\Controller\Dispatcher->dispatch(Object(Icinga\Web\Request), Object(Icinga\Web\Response))
#7 /usr/share/php/Icinga/Application/Web.php(389): Zend_Controller_Front->dispatch(Object(Icinga\Web\Request), Object(Icinga\Web\Response))
#8 /usr/share/php/Icinga/Application/webrouter.php(109): Icinga\Application\Web->dispatch()
#9 /usr/share/icingaweb2/public/index.php(4): require_once('/usr/share/php/...')
#10 {main}

The Command-Transport is send within the Icinga2-API.

Your Environment

  • Icinga Web 2 version and modules (System - About):
    cube | 1.0.0
    graphite | 0.0.0.5
    monitoring | 2.4.1
  • Version used (icinga2 --version): version: r2.7.0-1
  • Operating System and version: Debian GNU/Linux 8.9 (jessie)
  • Enabled features (icinga2 feature list): Enabled features: api checker command graphite ido-mysql mainlog notification
  • Config validation (icinga2 daemon -C): no error
  • If you run multiple Icinga 2 instances, the zones.conf file (or icinga2 object list --type Endpoint and icinga2 object list --type Zone) from all affected nodes.
host001:/root # icinga2 object list --type Endpoint
Object 'host001.localdomain' of type 'Endpoint':
  % declared in '/etc/icinga2/zones.conf', lines 1:0-1:47
  * __name = "host001.localdomain"
  * host = "10.0.0.133"
    % = modified in '/etc/icinga2/zones.conf', lines 2:3-2:22
  * log_duration = 86400
  * name = "host001.localdomain"
  * package = "_etc"
  * port = "5665"
  * source_location
    * first_column = 0
    * first_line = 1
    * last_column = 47
    * last_line = 1
    * path = "/etc/icinga2/zones.conf"
  * templates = [ "host001.localdomain" ]
    % = modified in '/etc/icinga2/zones.conf', lines 1:0-1:47
  * type = "Endpoint"
  * zone = ""

Object 'host002.localdomain' of type 'Endpoint':
  % declared in '/etc/icinga2/zones.conf', lines 5:1-5:48
  * __name = "host002.localdomain"
  * host = "10.0.0.134"
    % = modified in '/etc/icinga2/zones.conf', lines 6:3-6:22
  * log_duration = 86400
  * name = "host002.localdomain"
  * package = "_etc"
  * port = "5665"
  * source_location
    * first_column = 1
    * first_line = 5
    * last_column = 48
    * last_line = 5
    * path = "/etc/icinga2/zones.conf"
  * templates = [ "host002.localdomain" ]
    % = modified in '/etc/icinga2/zones.conf', lines 5:1-5:48
  * type = "Endpoint"
  * zone = ""
host001:/root # icinga2 object list --type Zone
Object 'global_zone' of type 'Zone':
  % declared in '/etc/icinga2/zones.conf', lines 13:1-13:25
  * __name = "global_zone"
  * endpoints = null
  * global = true
    % = modified in '/etc/icinga2/zones.conf', lines 14:3-14:15
  * name = "global_zone"
  * package = "_etc"
  * parent = ""
  * source_location
    * first_column = 1
    * first_line = 13
    * last_column = 25
    * last_line = 13
    * path = "/etc/icinga2/zones.conf"
  * templates = [ "global_zone" ]
    % = modified in '/etc/icinga2/zones.conf', lines 13:1-13:25
  * type = "Zone"
  * zone = ""

Object 'master' of type 'Zone':
  % declared in '/etc/icinga2/zones.conf', lines 9:1-9:20
  * __name = "master"
  * endpoints = [ "host001.localdomain", "host002.localdomain" ]
    % = modified in '/etc/icinga2/zones.conf', lines 10:3-10:84
  * global = false
  * name = "master"
  * package = "_etc"
  * parent = ""
  * source_location
    * first_column = 1
    * first_line = 9
    * last_column = 20
    * last_line = 9
    * path = "/etc/icinga2/zones.conf"
  * templates = [ "master" ]
    % = modified in '/etc/icinga2/zones.conf', lines 9:1-9:20
  * type = "Zone"
  * zone = ""

@sahnd
Copy link

sahnd commented Aug 7, 2017

I am facing the same issue.
Seems as if icingaweb2 implicitly sets a (faulty) expire time for acknowledgements, if "Use Expire Time" is not checked.

@localhorst-org
Copy link

localhorst-org commented Aug 7, 2017

same for me after update from http://packages.icinga.org/ubuntu icinga-xenial main to version 2.7.0-1.xenial

icinga2: Can't send external Icinga command: 409 Acknowledgement 'expiry' timestamp must be in the future for object xxx-xxxx-xxx-xxx!xxxxxxx_xxx_xxx_xxxxxxxx.

#0 /usr/share/icingaweb2/modules/monitoring/application/forms/Command/Object/AcknowledgeProblemCommandForm.php(159): Icinga\Module\Monitoring\Command\Transport\CommandTransport->send(Object(Icinga\Module\Monitoring\Command\Object\AcknowledgeProblemCommand))
#1 /usr/share/php/Icinga/Web/Form.php(1152): Icinga\Module\Monitoring\Forms\Command\Object\AcknowledgeProblemCommandForm->onSuccess()
#2 /usr/share/icingaweb2/modules/monitoring/library/Monitoring/Web/Controller/MonitoredObjectController.php(129): Icinga\Web\Form->handleRequest()
#3 /usr/share/icingaweb2/modules/monitoring/application/controllers/ServiceController.php(77): Icinga\Module\Monitoring\Web\Controller\MonitoredObjectController->handleCommandForm(Object(Icinga\Module\Monitoring\Forms\Command\Object\AcknowledgeProblemCommandForm))
#4 /usr/share/icingaweb2/library/vendor/Zend/Controller/Action.php(507): Icinga\Module\Monitoring\Controllers\ServiceController->acknowledgeProblemAction()
#5 /usr/share/php/Icinga/Web/Controller/Dispatcher.php(76): Zend_Controller_Action->dispatch('acknowledgeProb...')
#6 /usr/share/icingaweb2/library/vendor/Zend/Controller/Front.php(937): Icinga\Web\Controller\Dispatcher->dispatch(Object(Icinga\Web\Request), Object(Icinga\Web\Response))
#7 /usr/share/php/Icinga/Application/Web.php(389): Zend_Controller_Front->dispatch(Object(Icinga\Web\Request), Object(Icinga\Web\Response))
#8 /usr/share/php/Icinga/Application/webrouter.php(109): Icinga\Application\Web->dispatch()
#9 /usr/share/icingaweb2/public/index.php(4): require_once('/usr/share/php/...')
#10 {main}

@bcogel
Copy link

bcogel commented Aug 8, 2017

Same here.

RHEL 6.9 , icinga2-2.7.0-1.el6, icingacli-2.4.1-1.el6, icingaweb2-2.4.1-1.el6

We're using transport via API to get the ACKs and comments on our two servers in the master zone in sync. For redundancy and failover they are on different locations and both have icingaweb2 with separate databases installed.

@dnsmichi
Copy link
Contributor

dnsmichi commented Aug 8, 2017

Can be reproduced using the Vagrant boxes & snapshot packages / git master, 72dfa6d

screen shot 2017-08-08 at 12 40 00

dnsmichi pushed a commit that referenced this issue Aug 8, 2017
Icinga 2 v2.7.0 is more strict with the `expiry` attribute if sent
(cannot be null, or in the past).

While acknowledgments with expire time worked well (and do so with this patch),
the command renderer did not check whether the value is actually not null
before setting it into the data form. The boolean value from the checkbox is
not available in the command renderer unfortunately.

@lippserd: Verified working with and without expire time inside the Vagrant boxes.

fixes #2911
@dnsmichi
Copy link
Contributor

dnsmichi commented Aug 8, 2017

Please test the referenced PR.

@pgress
Copy link
Author

pgress commented Aug 8, 2017

Looks and works excellent

@localhorst-org
Copy link

worked also for me thx!

@bcogel
Copy link

bcogel commented Aug 8, 2017

Works for me too...

@snooops
Copy link

snooops commented Aug 9, 2017

works on debian jessie 64bit package

@lippserd lippserd changed the title Acknowledgements arent working without an expiry time Acknowledgements are not working without an expiry time Sep 8, 2017
@lippserd lippserd added bug Something isn't working area/monitoring Affects the monitoring module labels Sep 8, 2017
@lippserd lippserd added this to the 2.4.2 milestone Sep 8, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/monitoring Affects the monitoring module bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants