# State history is not updated when plugin output changes without a state change Show more lines

**URL:** <https://community.icinga.com/t/state-history-is-not-updated-when-plugin-output-changes-without-a-state-change-show-more-lines/15569>\
**Category:** Icinga 2\
**Tags:** icinga2\
**Created:** [September 8, 2026, 12:38pm UTC](https://community.icinga.com/t/state-history-is-not-updated-when-plugin-output-changes-without-a-state-change-show-more-lines/15569 "2026-09-08T12:38:03Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![FiratAlkis](https://community.icinga.com/letter_avatar_proxy/v4/letter/f/c6cbf5/32.png) [@FiratAlkis](https://community.icinga.com/u/FiratAlkis)\
**Post date:** [September 8, 2026, 12:38pm UTC](https://community.icinga.com/t/state-history-is-not-updated-when-plugin-output-changes-without-a-state-change-show-more-lines/15569/1 "2026-09-08T12:38:03Z")

</div>

Hello,

While testing I noticed a behavior that makes it difficult to display the latest plugin output for active problems.

I have a service called “Deneme1”.

When the service changes state from OK to CRITICAL, a record is written into the state\_history table and the plugin output is stored correctly.

Example:

State: CRITICAL  
Plugin Output: Deneme 12

I can see this value both in Icinga Web and in the icingadb.state\_history table.

However, if the service remains in CRITICAL state and only the plugin output changes, the state\_history table is not updated.

Example:

Initial state:  
CRITICAL  
Plugin Output: Deneme 12

Later:  
CRITICAL  
Plugin Output: Deneme 123

In Icinga Web I can see the updated plugin output (Deneme 123), but no new record is written into icingadb.state\_history and the existing state\_history record still contains “Deneme 12”.

As a result, external reporting tools that rely on state\_history cannot display the latest plugin output for ongoing problems.

Is this the expected behavior?

Would it be possible to make plugin output changes available in history even if the state itself does not change?

For example:

- create a new state\_history entry when output changes  
or
- update the latest history record with the current output

This would make it easier to build reporting and dashboard integrations that need the latest output of an active problem.

Thanks.

 ![image](https://community.icinga.com/uploads/default/original/2X/0/02e635520c809220e189c7d561ce5e91f8555951.png)

 ![image](https://community.icinga.com/uploads/default/original/2X/2/2805828561d04fcc44ea34babc3cd6d06425c021.png)

---

<div class="post-metadata">

**Author:** ![moreamazingnick](https://community.icinga.com/user_avatar/community.icinga.com/moreamazingnick/32/7725_2.png) [@moreamazingnick](https://community.icinga.com/u/moreamazingnick)\
**Post date:** [September 8, 2026, 12:59pm UTC](https://community.icinga.com/t/state-history-is-not-updated-when-plugin-output-changes-without-a-state-change-show-more-lines/15569/2 "2026-09-08T12:59:26Z")

</div>

"the reason for this is, that the most recent non hard state change information is stored in the redis server only.

The sql database hold the hard state relevant for “reboot consistant” sla calculation."

So an OK following an OK with a different output is not always in the database  
and a CRITICAL following a CRITICAL with a different output is not always in the database too  
I have written it down here:

> [@IcingaDB data is not up to date with the data displayed in Icingaweb](https://community.icinga.com/t/icingadb-data-is-not-up-to-date-with-the-data-displayed-in-icingaweb/13904/2):
>
> the reason for this is, that the most recent non hard state change information is stored in the redis server only. The sql database hold the hard state relevant for “reboot consistant” sla calculation. It is quite easy to implement something like this query in php as an icingaweb2 module. Inside icingeweb2 you can easyily combine the redis data with the sql data.

---

<div class="post-metadata">

**Author:** ![apenning](https://community.icinga.com/user_avatar/community.icinga.com/apenning/32/7669_2.png) [@apenning](https://community.icinga.com/u/apenning)\
**Post date:** [September 8, 2026, 1:42pm UTC](https://community.icinga.com/t/state-history-is-not-updated-when-plugin-output-changes-without-a-state-change-show-more-lines/15569/3 "2026-09-08T13:42:55Z")

</div>

> [@FiratAlkis](#):
>
> As a result, external reporting tools that rely on state\_history cannot display the latest plugin output for ongoing problems.

While @moreamazingnick already explained why this is the case, I would urge you not to query the relational database from external tools: the schema might change, things might break, or external calls might introduce database locking. If you want to query service state information, please use the Icinga 2 API: [Icinga2 Api - Icinga 2](https://icinga.com/docs/icinga-2/latest/doc/12-icinga2-api/#querying-objects)

---

<div class="post-metadata">

**Author:** ![moreamazingnick](https://community.icinga.com/user_avatar/community.icinga.com/moreamazingnick/32/7725_2.png) [@moreamazingnick](https://community.icinga.com/u/moreamazingnick)\
**Post date:** [September 8, 2026, 1:56pm UTC](https://community.icinga.com/t/state-history-is-not-updated-when-plugin-output-changes-without-a-state-change-show-more-lines/15569/4 "2026-09-08T13:56:16Z")

</div>

If it helps you could use icingadb-web api to query hosts:  
username demo  
password demo

`https://demo.icinga.com/icingadb/services?service.name~File%2A&format=json`

create a filter or not, and copy link address of the export-\>json  
works for hosts services and so on.

 ![Bildschirmfoto 2026-09-08 um 15.52.59](https://community.icinga.com/uploads/default/original/2X/6/637bcac85c76f47f1e9a6879ff59f04500c142cc.jpeg)

and it is machine readable json. just use basic auth on your script.  
you can also copy the query url directly and just set the header in your script to

```auto
               'headers' => [
                    'Accept' => 'application/json',
                    'Content-Type' => 'application/json',
                ],

```

with that you wont need `&format=json`

---

<div class="post-metadata">

**Author:** ![FiratAlkis](https://community.icinga.com/letter_avatar_proxy/v4/letter/f/c6cbf5/32.png) [@FiratAlkis](https://community.icinga.com/u/FiratAlkis)\
**Post date:** [September 8, 2026, 2:42pm UTC](https://community.icinga.com/t/state-history-is-not-updated-when-plugin-output-changes-without-a-state-change-show-more-lines/15569/5 "2026-09-08T14:42:02Z")

</div>

Thanks everyone for the explanations.

Now it makes sense.

I was assuming that state\_history would also contain plugin output changes while a service remains in the same state, but after testing and reviewing your explanations I understand that only hard state relevant information is persisted to the SQL database, while the latest volatile state information is kept in Redis.

This explains why I can see updated plugin output in Icinga Web, but not in state\_history or service\_state.

Our use case is to display the latest plugin output for active problems in an external dashboard. Since this information is not guaranteed to be available in the SQL database, we will most likely move to the Icinga 2 API (or IcingaDB Web JSON endpoints) instead of relying on state\_history.

Thank you for pointing me in the right direction and for the additional examples.🙏
