Skip to content

Add option to set host check results - #45

Merged
martialblog merged 8 commits into
mainfrom
add-host-check
Oct 13, 2026
Merged

martialblog merged 8 commits into
mainfrom
add-host-check

Conversation

@martialblog

Copy link
Copy Markdown
Member

Fixes #42

@martialblog martialblog added this to the v1.1.0 milestone Oct 5, 2026
@martialblog martialblog self-assigned this Oct 5, 2026
@martialblog

Copy link
Copy Markdown
Member Author

Hi @UiP9AV6Y

This PR should enable the described use-case. Feel free to test it and give me feedback.

Thanks

@UiP9AV6Y UiP9AV6Y left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the change looks good overall, just minor nitpicks

Comment thread internal/api/listener.go Outdated
Comment thread internal/api/listener.go Outdated
Comment thread internal/api/listener.go Outdated
Comment thread internal/api/listener.go
Comment thread internal/api/listener.go Outdated
@UiP9AV6Y

UiP9AV6Y commented Oct 7, 2026

Copy link
Copy Markdown
Contributor

i did run into an issue while testing the feature against the local docker-compose stack.

the bridge sent the following request

{
  "exit_status": 2,
  "plugin_output": "Host down",
  "ttl": 0,
  "filter": "host.name==\"gaff.bac.test\"",
  "type": "Host"
}

and received the following response from the Icinga2 API

{
  "results": [
    {
      "code": 400,
      "status": "Invalid 'exit_status' for Host gaff.bac.test."
    }
  ]
}

not sure if my setup is broken or something else is not working as intended. the error is currently not logged; i have opened #46 as a result

martialblog and others added 5 commits October 12, 2026 09:45
Co-authored-by: Gordon Bleux <33967640+UiP9AV6Y@users.noreply.github.com>
Co-authored-by: Gordon Bleux <33967640+UiP9AV6Y@users.noreply.github.com>
Comment thread internal/api/listener.go
@martialblog

Copy link
Copy Markdown
Member Author

@UiP9AV6Y Thanks for the review. You're setup isn't broken it's the exit status mapping for host checks.

@UiP9AV6Y

Copy link
Copy Markdown
Contributor

can confirm. host objets are now updates based on alerts.

i have refactored the docker-compose setup to include an example for a host-check-based alert in a feature branch

feel free to cherry pick the commit, otherwise i can make a follow-up PR

@martialblog

Copy link
Copy Markdown
Member Author

Thanks for the feedback. I think this will be the last change for the version v1.1.0.

@martialblog
martialblog merged commit 69f90f0 into main Oct 13, 2026
3 checks passed
@martialblog
martialblog deleted the add-host-check branch October 13, 2026 18:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature]: Allow alerts to be associated with Host object status

2 participants