Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Elastic Agent][question] How to trigger Unhealthy status for testing? #25321

Closed
manishgupta-qasource opened this issue Jan 15, 2021 · 7 comments
Labels
Team:Elastic-Agent Label for the Agent team

Comments

@manishgupta-qasource
Copy link

manishgupta-qasource commented Jan 15, 2021

As per below comment
elastic/kibana#84962 (comment)

We need to make Agent into Unhealthy state to test the filters. Can a team member advise on the easiest way to trigger an Unhealthy state on an agent?

@elasticmachine
Copy link
Collaborator

Pinging @elastic/ingest-management (Team:Ingest Management)

@jen-huang jen-huang changed the title Steps Required to make agent in Unhealthy status for testing the Filters [Elastic Agent] How to trigger Unhealthy status for testing? Apr 26, 2021
@jen-huang jen-huang transferred this issue from elastic/kibana Apr 26, 2021
@jen-huang jen-huang changed the title [Elastic Agent] How to trigger Unhealthy status for testing? [Elastic Agent][question] How to trigger Unhealthy status for testing? Apr 26, 2021
@jen-huang jen-huang added the Team:Elastic-Agent Label for the Agent team label Apr 26, 2021
@elasticmachine
Copy link
Collaborator

Pinging @elastic/agent (Team:Agent)

@ph
Copy link
Contributor

ph commented Apr 27, 2021

@urso What do you think should be the experience here? should we allow some kind of debug tool?

@ph
Copy link
Contributor

ph commented Apr 30, 2021

@michalpristas or @blakerouse Any tips for them?

@blakerouse
Copy link
Contributor

I don't really have a way to do it in Elastic Agent. Could possible come up with a API call that would allow you to manipulate the .fleet-agents index to make it show up that way, for a short period of time.

@jen-huang
Copy link

jen-huang commented May 3, 2021

@blakerouse Good point idea, I hadn't considered that.

@manishgupta-qasource / @muskangulati-qasource You can run the following query in Dev Tools to force an agent into Unhealthy status. Replace d0415977-c688-44c7-abe0-065887ddc52b with the agent ID you want to update. You can also skip the last_checkin field if your agent has already checked in at least once:

POST .fleet-agents/_update/d0415977-c688-44c7-abe0-065887ddc52b
{
  "doc": {
    "last_checkin": "2021-05-03T22:06:20Z",
    "last_checkin_status": "error"
  }
}

Forcing it like this will probably trigger other unintended effects, so please use this for UI testing only 😉

@muskangulati-qasource
Copy link

Hi @jen-huang,

Thank you for providing the steps for the same. Our query is now resolved and we were successful in updating the agent status from healthy to Unhealthy & back to healthy!!

Please find below the whole testing details.

Build Details:

Version: 7.13.0-SNAPSHOT
Commit: 62a98b97048b3639b8dfe7884776d95581dc1eb5
Build number: 40746

Refer Screenshots:

  • Healthy Status:
    Healthy

  • API hit to change agent status from Healthy to Unhealthy:
    API

  • Unhealthy status:
    Error

  • API hit to change agent status from Unhealthy to Healthy:
    API2

Hence, we closing this ticket.

Thanks!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Team:Elastic-Agent Label for the Agent team
Projects
None yet
Development

No branches or pull requests

7 participants