Code Monkey home page Code Monkey logo

Comments (19)

HenriWahl avatar HenriWahl commented on July 21, 2024

@jr-timme any idea?

from nagstamon.

jr-timme avatar jr-timme commented on July 21, 2024

We don't build the Icinga packages ourselves, we're currently running the latest Versions from the Icinga Debian repository:

icingadb:
  Installed: 1.1.1-1+debian11
  Candidate: 1.1.1-1+debian11
  Version table:
 *** 1.1.1-1+debian11 500
        500 https://packages.icinga.com/debian icinga-bullseye/main amd64 Packages
        
icingadb-web:
  Installed: 1.0.2-1+debian11
  Candidate: 1.0.2-1+debian11
  Version table:
 *** 1.0.2-1+debian11 500
        500 https://packages.icinga.com/debian icinga-bullseye/main amd64 Packages

icingaweb2:
  Installed: 2.11.4-1+debian11
  Candidate: 2.11.4-1+debian11
  Version table:
 *** 2.11.4-1+debian11 500
        500 https://packages.icinga.com/debian icinga-bullseye/main amd64 Packages

So I can't really speak to the Master Branch version but with the versions from the official repository the icingadb module returns the last_update field as Milliseconds since the Unix Epoch, e.g.,

[...]
    "state": {
      [...]
      "last_update": "1695295061.506",
[...]

I don't really have any deeper knowledge of the Icinga Code, but it looks to me as that is still the case in the master Branch:
https://github.com/Icinga/icingadb/blob/c20f066bd87528960ec095c2e6fd88d014156b6c/pkg/icingadb/v1/state.go#L25
https://github.com/Icinga/icingadb/blob/c20f066bd87528960ec095c2e6fd88d014156b6c/schema/pgsql/schema.sql#L436
https://github.com/Icinga/icingadb/blob/c20f066bd87528960ec095c2e6fd88d014156b6c/schema/mysql/schema.sql#L322

How the icingaweb2 version could change that I don't know.

@sebek72 did you change anything in regard to the timestamps, so that they are already formatted instead of in Milliseconds since the Unix Epoch?

from nagstamon.

sebek72 avatar sebek72 commented on July 21, 2024

Hi. Thanks for the feedback. I would not know where to change that :)
I tried to install previous icinga stack versions to see if there is an instance where this works (btw my icinga is deployed via docker), but also with 2.1.12 (with icingadb 1.1.0) it behaves the same.

mariadb output seems to be fine
MariaDB [icingadb]> SELECT last_update from service_state; +---------------+ | last_update | +---------------+ | 1695289781960 | | 1695289782390 | | 1695289782160 | | 1695289782661 |

from nagstamon.

jr-timme avatar jr-timme commented on July 21, 2024

Could you check the raw json output, just to make sure that the date there is already formatted?

curl -v -l -b cookies.txt -c cookies.txt "http://10.55.32.212:8080/icingadb/hosts?host.state.is_problem=y&host.state.state_type=hard&columns=host.state.last_update&format=json" | jq

cookies can either be exported from a browser or generated through another curl in which you authenticate yourself

from nagstamon.

sebek72 avatar sebek72 commented on July 21, 2024

This is the json output:

"last_update":"2023-09-21T09:49:38.753+00:00","last_state_change":"1970-01-01T00:00:00.000+00:00", "next_check":"2023-09-21T09:49:59.838+00:00", "next_update":"2023-09-21T09:50:21.846+00:00",

Update:
Also tried now with icingaweb2.12.0 (released) same output

from nagstamon.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.