To provide a rich UX for the Elastic Agent we need to provide a way to communicate and control the running Elastic Agent.
Information that needs to be able to be retrieved from the local agent:
- Running version (possible different then the executing binary, but rare)
- Current status
- Overall agent status
- Status of each application
- Ability to restart Elastic Agent (self-restarts self with re-exec)
- Ability to trigger self-upgrade Elastic Agent
Below documents the commands and expected outputs:
version
Same version
$ elastic-agent version
Running Daemon: 7.9.0-SNAPSHOT (build: unknown at 0001-01-01 00:00:00 +0000 UTC)
Executable: 7.9.0-SNAPSHOT (build: unknown at 0001-01-01 00:00:00 +0000 UTC)
Not running
$ elastic-agent version
Running Daemon: <not running>
Executable: 7.9.0-SNAPSHOT (build: unknown at 0001-01-01 00:00:00 +0000 UTC)
Different versions running
$ elastic-agent version
WARN: The running version of Elastic Agent does not match this version.
Running Daemon: 7.9.0-SNAPSHOT (build: unknown at 0001-01-01 00:00:00 +0000 UTC)
Executable: 8.0.0-SNAPSHOT (build: unknown at 0001-01-01 00:00:00 +0000 UTC)
status
$ elastic-agent status
Status: Degraded
Message: 1 application is degraded
Application Status Message
Filebeat Healthy Running
Metricbeat Degraded system/load is an invalid metricset
Endpoint Security Healthy Protected with policy {000-....}
restart
The different [/] below are showing interactive progress of what the command will report as its performing the restart action. It will then just print Successfully restarted over the progress.
$ elastic-agent restart
[/] Triggering restart
[-] Waiting to reconnect
[\] Reconnecting
[|] Connected
Successfully restarted
upgrade
The different [/] below are showing interactive progress of what the command will report as its performing the restart action. It will then just print Successfully restarted over the progress.
Next-version in same major
$ elastic-agent upgrade
[/] Triggering upgrade
[-] Upgrading to 7.9.1
[\] Reconnecting
[|] Connected
Successfully upgraded to 7.9.1
Next major
$ elastic-agent upgrade --version 8.0.0
[/] Triggering upgrade
[-] Upgrading to 8.0.0
[\] Reconnecting
[|] Connected
Successfully upgraded to 8.0.0
Specific version
$ elastic-agent upgrade --version 7.9.2-SNAPSHOT
[/] Triggering upgrade
[-] Upgrading to 8.9.2-SNAPSHOT
[\] Reconnecting
[|] Connected
Successfully upgraded to 7.9.2-SNAPSHOT
To provide a rich UX for the Elastic Agent we need to provide a way to communicate and control the running Elastic Agent.
Information that needs to be able to be retrieved from the local agent:
Below documents the commands and expected outputs:
versionSame version
Not running
Different versions running
statusrestartThe different
[/]below are showing interactive progress of what the command will report as its performing the restart action. It will then just printSuccessfully restartedover the progress.upgradeThe different
[/]below are showing interactive progress of what the command will report as its performing the restart action. It will then just printSuccessfully restartedover the progress.Next-version in same major
Next major
Specific version