Closed networking-guy closed 4 years ago
That sounds really familiar, but I couldn't find a ticket right away either 😕
I stumbled across this issue as well a few times, it seems that this has been carried along since icinga1: https://github.com/Icinga/icinga-core/issues/1342
Will be taken into account for IcingaDB, but not the IDO schema.
I supspect that there is an existing bug with the field "last_hard_state" for the table "statehistory" in the IDO. If a host changes its hard state, the field "last_hard_state" equals the field "state". Possible duplicate to "https://monitoring-portal.org/index.php?thread/40698-state-and-last-state/" from an other user reporting:
Expected Behavior
I would expect, that "last_hard_state" reflects the last hard state: status: up - state: 0 / last_hard_state:0 status; down(hard) - state:1 / last_hard_state:0 status: up - state: 0 / last_hard_state:1
Current Behavior
The current behavior: status: up - state: 0 / last_hard_state:0 status; down(hard) - state:1 / last_hard_state:1 status: up - state: 0 / last_hard_state:0
Steps to Reproduce (for bugs)
SELECT state_time, name1, state, last_hard_state, icinga_statehistory.* FROM icinga_statehistory, icinga_objects WHERE state_type = 1 AND icinga_statehistory.object_id = icinga_objects.object_id AND icinga_objects.objecttype_id = 1
Context
We trying to create reports which should reflect up/down (only hard state) informations about host and services.
Your Environment
icinga2 --version
): 2.6.0 / 2.6.1icinga2 feature list
): Disabled features: debuglog gelf influxdb opentsdb syslog Enabled features: api checker command compatlog graphite ido-mysql livestatus mainlog notification perfdata statusdataicinga2 daemon -C
): icinga2 daemon -C information/cli: Icinga application loader (version: v2.6.0) information/cli: Loading configuration file(s). information/ConfigItem: Committing config item(s). information/ApiListener: My API identity: XXXXXXXXXXXXXXXXX warning/DbConnection: Specifying flags using '|' for 'categories' for object 'id o-mysql' of type 'IdoMysqlConnection' is deprecated. This functionality will be removed in 2.6.0. Please use an array. information/ConfigItem: Instantiated 1 ApiUser. information/ConfigItem: Instantiated 1 ApiListener. information/ConfigItem: Instantiated 10 Zones. information/ConfigItem: Instantiated 1 FileLogger. information/ConfigItem: Instantiated 10 Endpoints. information/ConfigItem: Instantiated 1 LivestatusListener. information/ConfigItem: Instantiated 9114 Notifications. information/ConfigItem: Instantiated 2 NotificationCommands. information/ConfigItem: Instantiated 174 CheckCommands. information/ConfigItem: Instantiated 1 Downtime. information/ConfigItem: Instantiated 10 HostGroups. information/ConfigItem: Instantiated 1 IcingaApplication. information/ConfigItem: Instantiated 1607 Hosts. information/ConfigItem: Instantiated 22 Comments. information/ConfigItem: Instantiated 2 Users. information/ConfigItem: Instantiated 9 UserGroups. information/ConfigItem: Instantiated 44 Dependencies. information/ConfigItem: Instantiated 5 TimePeriods. information/ConfigItem: Instantiated 7518 Services. information/ConfigItem: Instantiated 1 CheckerComponent. information/ConfigItem: Instantiated 1 CompatLogger. information/ConfigItem: Instantiated 1 StatusDataWriter. information/ConfigItem: Instantiated 1 ExternalCommandListener. information/ConfigItem: Instantiated 1 GraphiteWriter. information/ConfigItem: Instantiated 1 PerfdataWriter. information/ConfigItem: Instantiated 1 IdoMysqlConnection. information/ConfigItem: Instantiated 1 NotificationComponent. information/ScriptGlobal: Dumping variables to file '/var/cache/icinga2/icinga2. vars' information/cli: Finished validating the configuration file(s).