[icinga-users] How to have a text log file of state changes?

Michael Friedrich michael.friedrich at icinga.com
Thu Jan 19 09:45:02 CET 2017

> On 18 Jan 2017, at 22:03, Stephane Bortzmeyer <stephane at sources.org> wrote:
> I like to folow events with a tail -f of a text log file. With Icinga
> 1, the log file gave me all I needed:
> [1484760372] HOST ALERT: foobar;DOWN;SOFT;1;CRITICAL - Host Unreachable (
> [1484760442] HOST ALERT: foobar;DOWN;SOFT;2;CRITICAL - Host Unreachable (
> [1484760512] HOST ALERT: foobar;DOWN;HARD;3;CRITICAL - Host Unreachable (
> [1484760512] HOST NOTIFICATION: icinga;foobar;DOWN;notify-host-by-email;CRITICAL - Host Unreachable (
> With Icinga 2, I don't know have to have the same.

The icinga2.log file is an application log, and allows you to watch and debug certain cases. The log file from Icinga 1.x somehow became a database for logs, without any index or proper joinable cases.

I’d suggest to 

a) use the DB IDO table icinga_statehistory
b) connect to the REST API event streams (type StateChange for example)

to fetch such events.

Kind regards,

More information about the icinga-users mailing list