Skip to content
This repository has been archived by the owner on Jan 15, 2019. It is now read-only.

host in 'down' state is showing wrong duration (after passing from soft to hard) #1597

Open
zibfr opened this issue Aug 18, 2017 · 5 comments · May be fixed by #1609
Open

host in 'down' state is showing wrong duration (after passing from soft to hard) #1597

zibfr opened this issue Aug 18, 2017 · 5 comments · May be fixed by #1609
Labels

Comments

@zibfr
Copy link

zibfr commented Aug 18, 2017

Hi guys,

bug reproduced on

  • icinga 1.9.2 on Red Hat Enterprise Linux Server release 6.4 (Santiago) without BD link
  • icinga 1.12.2 on Red Hat Enterprise Linux Server release 6.4 (Santiago) with ido2db ORACLE BD link

in status.dat
for a DOWN host, both value are the same :

  • last_state_change=1501023297
  • last_hard_state_change=1501023297

not for a CRITICAL service :

  • last_state_change=1500869194
  • last_hard_state_change=1500870094

seems to me last_state_change resets between SOFT and HARD state for a host, not a service
bug ? possible to correct/modify this behavior ?

more details here:
https://monitoring-portal.org/index.php?thread/35228-host-in-down-state-is-showing-wrong-duration/

thanks in advance for any help regarding this matter.
Regards, Zibfr

@zibfr
Copy link
Author

zibfr commented Aug 18, 2017

if i have one host (with a service ping), i also have 15min difference (I use same check command for both host status and PING service status)
my delay between SOFT and HARD is 15min btw
image

@zibfr
Copy link
Author

zibfr commented Aug 18, 2017

if you need any more infos, feel free (y)

@zibfr
Copy link
Author

zibfr commented Aug 20, 2017

just to let you know wolfgang put a solution in https://monitoring-portal.org/index.php?thread/35228-host-in-down-state-is-showing-wrong-duration/

i will give it a try with next upgrade and let you know.

Regards,
Zibfr

@zibfr
Copy link
Author

zibfr commented Sep 22, 2017

Hi there,

the following patch (from @wolfgang) works perfectly:

in base/check.c
Change

	/* update last state change times */
	hst->last_state_change = current_time;
	if (hst->state_type == HARD_STATE)
		hst->last_hard_state_change = current_time;

to

	/* update last state change times */
	if (hst->last_state != hst->current_state)
		hst->last_state_change = hst->last_check;
	if (hst->state_type == HARD_STATE)
		hst->last_hard_state_change = hst->last_check;

I tested this workaround on my test server.

In order to correct this on both our production icinga servers (as my boss only accepts official source code with no correction of any kind), could you please correct this bug ideally for v1.9.2 and v1.12.2 (and/or at least latest 1.13.x version) plz ?

Regards
Zibfr

@dnsmichi
Copy link
Contributor

I'd merge a PR of yours, and you can backport the patch into the old EOL releases then. Icinga 1.x doesn't receive updates anymore, just security related and minor things for current 1.14.

@NotAFile NotAFile linked a pull request Sep 24, 2018 that will close this issue
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants