If a backup on a host is done successfully, I use the REST API to process the check result.
If the backup fails for some reason, the API call is not made and I expect the service to go to an UNKNOWN or CRITICAL state but the service remains in the OK state:
for passive checks you need active also. If there is no passive check result, Icinga will call the check command you defined. You should also set the passive state (critical/warning or unknown) to be returned by the plugin and the output text if there is no passive check result.
Thanks for your reply. I am a bit confused since the documentation says the following:
“In Icinga 2 active check freshness is enabled by default. It is determined by the check_interval attribute and no incoming check results in that period of time.”
From the above, I assumed that Icinga will check freshness after the check_interval and if no results were received for that period, it will transition the state of the service to something other than OK.
If I understand you correctly I need to define an additional service in addition to my “backup” service, let’s call it “check-backup” for argument sake, that checks the freshness of my “backup” service. If that is the case then it doesn’t seem like Icinga is performing any freshness checks?
How would I check the freshness of the “backup” service inside the “check-backup” service?
you dont need to setup a second service. Just enable active checks and you get a notification if no passive result is received in the freshness period.
Hello there!
Also welcome to the community from my side
If there was an answer that works for you, could you mark that reply as the solution?
This helps others figure out whether a question still needs an answer and where to look if someone has a similar issue.