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

UI displays Check Timeperiod after check_period removed from Service object #8695

Open
kenmarsh8 opened this issue Mar 22, 2021 · 9 comments
Labels
area/db-ido Database output bug Something isn't working

Comments

@kenmarsh8
Copy link

Describe the bug

Removed check_period = "workhours" from Service, causing it to revert to default 24x7.
Dumped Service objects and verified Service no longer has a check_period entry.
Reload page in UI
UI still shows custom check period: "Check Timeperiod | Weekdays, 9am to 5pm"

To Reproduce

  1. Create a Service with a non-default check_period entry.
  2. Verify display in UI of "Check Timeperiod | Weekdays, 9am to 5pm"
    
  3. Removed check_period. Reload icinga2. Restart icinga2.
    
  4. Verify display in UI of that Service still has "Check Timeperiod | Weekdays, 9am to 5pm"
    

Expected behavior

The "Check Timeperiod | Weekdays, 9am to 5pm" should go away.
see check_period.png

Screenshots

See check_icinga.png

Your Environment

Include as many relevant details about the environment you experienced the problem in

Module version:
icingaweb2 2.8.2-1.bionic
icingaweb2-common 2.8.2-1.bionic

Dependent module versions:
icingaweb2-module-doc 2.8.2-1.bionic
icingaweb2-module-monitoring 2.8.2-1.bionic

Icinga Web 2 version and modules (System - About):
Icinga Web 2 Version
2.8.2
Git commit
8a89839af94a247ee2149b2336c73b8251b477c0
PHP Version
7.2.24-0ubuntu0.18.04.7
Git commit date
2020-08-17

Web browser and version:
Latest firefox and Chrome

Icinga 2 version used (icinga2 --version):

icinga2 - The Icinga 2 network monitoring daemon (version: r2.12.1-1)

Copyright (c) 2012-2021 Icinga GmbH (https://icinga.com/)
License GPLv2+: GNU GPL version 2 or later http://gnu.org/licenses/gpl2.html
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

System information:
Platform: Ubuntu
Platform version: 18.04.5 LTS (Bionic Beaver)
Kernel: Linux
Kernel version: 4.15.0-124-generic
Architecture: x86_64

Build information:
Compiler: GNU 8.4.0
Build host: runner-wytxxqbb-project-298-concurrent-0
OpenSSL version: OpenSSL 1.1.1 11 Sep 2018

PHP version used (php --version):

PHP 7.2.24-0ubuntu0.18.04.7 (cli) (built: Oct 7 2020 15:24:25) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
with Zend OPcache v7.2.24-0ubuntu0.18.04.7, Copyright (c) 1999-2018, by Zend Technologies

Server operating system and version:
Linux icinga-dev 4.15.0-124-generic Icinga/icingaweb2#127-Ubuntu SMP Fri Nov 6 10:54:43 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=18.04
DISTRIB_CODENAME=bionic
DISTRIB_DESCRIPTION="Ubuntu 18.04.5 LTS"

Additional context

###before modification (has a custom check_period of business hours)

icinga2 object list --type service >> service.$(date "+%m%d%H%M%Y").txt
grep check_period service.022416142021.txt | grep work | head

check_period = "workhours"
check_period = "workhours"
check_period = "workhours"
check_period = "workhours"
check_period = "workhours"
check_period = "workhours"
check_period = "workhours"
check_period = "workhours"
check_period = "workhours"
check_period = "workhours"

###after modification (no custom check_period in Service)

grep check_period service.032210562021.txt | grep work | head
(no output)

@kenmarsh8
Copy link
Author

check_period

@nilmerg
Copy link
Member

nilmerg commented Mar 23, 2021

Hi,

Icinga Web 2 only fetches the data from the database (IDO). If Icinga 2 doesn't update this, the UI will show wrong results.

@nilmerg nilmerg transferred this issue from Icinga/icingaweb2 Mar 23, 2021
@kenmarsh8
Copy link
Author

The Service objects in memory have been updated, the "icinga2 object list --type service" command proves that. But I suppose it is possible what is in memory in Icinga2 is out of sync with what is in the database. I'll dig around some more before closing this, and possibly opening an Icinga2 bug report.

@julianbrost
Copy link
Contributor

No need to do that, the issue was already moved there :)

@kenmarsh8
Copy link
Author

@julianbrost Thank you for the move!

@kenmarsh8
Copy link
Author

I'm in mysql; any hints which table/columns to look at?

@julianbrost
Copy link
Contributor

You have to thank @nilmerg for that.

check_timeperiod_object_id of table icinga_services would probably be what you have to check.

@kenmarsh8
Copy link
Author

kenmarsh8 commented Mar 23, 2021

Indeed it is still in the database.
But it is no longer in the configs!
Nor is it in the service objects dumped from live Icinga.

select display_name, check_timeperiod_object_id from icinga_services where display_name = "NSLCD (LDAP)";

shows for all

| NSLCD (LDAP) | 2580 |

select * from icinga_timeperiods where timeperiod_object_id = 2580;

| 4 | 1 | 1 | 2580 | Weekdays, 9am to 5pm | 09f7e127167a32aae2192362fa3aa3ead94796fa5685f1831cf1d8d9a770203b |

@kenmarsh8
Copy link
Author

@nilmerg Thank you for moving the issue here.

@Al2Klimov Al2Klimov added the area/db-ido Database output label Oct 12, 2021
@Al2Klimov Al2Klimov added the bug Something isn't working label Oct 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/db-ido Database output bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants