Skip to content

Commit

Permalink
Refinement in the main README (#101)
Browse files Browse the repository at this point in the history
Fix some typo
Update some .yam variable names
  • Loading branch information
mpagot authored Sep 21, 2022
1 parent 2064f22 commit cba022c
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,13 @@ Agents provide two main functionalities:
- Discovery

## Heartbeating
When Trento agent starts it begins notifying th control plane about its presence in the cluster by _heartbeting_ periodically.
When Trento agent starts, it begins notifying the control plane about its presence in the cluster by _heartbeting_ periodically.

## Discovery

Agents are responsible for the _discovery_ of all the clustered components that are required in order to run highly available SAP Applications.
Agents are responsible for the _discovery_ of all the clustered components that are required in order to run highly available SAP Applications.

Currently implemented discoveries gather information about these aspects of a target host
Discoveries gather information about these aspects of a target host
- OSVersion, HostName, HostIpAddresses... - _HostDiscovery_
- Cloud Service Provider it is running on - _CloudDiscovery_
- Pacemaker/Corosync/SBD metadata - _ClusterDiscovery_
Expand Down Expand Up @@ -77,7 +77,6 @@ sudo ./install-agent.sh
The script will ask you for some input.

- `ssh-address`: the address to which the trento-agent should be reachable for ssh connection by the runner for check execution.

- `server-ip`: the address where Trento server can be reached.
- `api-key`: the API key generated by the server that allows agents to actually communicate with the control plane

Expand Down Expand Up @@ -157,7 +156,8 @@ systemctl start trento-agent.service
```

> If the discovery loop is being executed too frequently, and this impacts the Web interface performance, the agent
> has the option to configure the discovery loop mechanism using the various `--<cloud,cluster,host,sapsystem>-discovery-period` flags. Increasing these value improves the overall performance of the application
> has the option to configure the discovery loop mechanism using the various `--<cloud,cluster,host,sapsystem>-discovery-period` flags.
> Increasing this value improves the overall performance of the application
## Configuration

Expand All @@ -181,8 +181,7 @@ Note that order represents priority
# /etc/trento/agent.yaml
api-key: <api-key-generated-from-the-server>
collector-host: https://localhost
collector-port: 8443
server-ip: https://localhost
```

## Environment Variables
Expand All @@ -195,7 +194,7 @@ Examples:

`api-key` -> `TRENTO_API_KEY=<some-api-key> ./trento-agent start`

`collector-host` -> `TRENTO_COLLECTOR_HOST=https://localhost ./trento-agent start`
`server-ip` -> `TRENTO_SERVER_IP=https://localhost ./trento-agent start`

# Development

Expand Down Expand Up @@ -235,12 +234,12 @@ A plugin system is available in the Agent, in order to add new fact gathering op

To create a new plugin (check the [example](plugin_examples/dummy.go) dummy plugin for that) follow the next steps:

- Create a new golang package. This is as simple as creating a new folder (it can be created anywhere, it doesn't need to be in the Agent code directory) with `.go` file inside. Name the golang file with a meaningful name (even though, it is not relevant for the usage itself).
- Create a new Golang package. This is as simple as creating a new folder (it can be created anywhere, it doesn't need to be in the Agent code directory) with `.go` file inside. Name the Golang file with a meaningful name (even though, it is not relevant for the usage itself).
- The `.go` file implements the `main` package and imports the `go-plugin` package as seen in the example.
- Implement the gathering function with the `func (s exampleGatherer) Gather(factsRequests []gatherers.FactRequest) ([]gatherers.Fact, error)` signature. This function must gather the facts from the system where the Agent is running.
- This function receives a list of fact gathering requests to gather, which entirely depends on the gathering code nature.
- Copy the `main()` function from the [example](plugin_examples/dummy.go) file. Simply replace the gatherer struct name there.
- Once the plugin is implemented, it must be compiled. Use the next command for that: `go build -o /usr/etc/trento/example ./your_plugin_folder/example.go`. The `-o` flag specifies the destination of the created binary, which the Agent neeeds to load. This folder is the same specified in the `--plugins-folder` flag in the Agent execution. In this case, the used name for the output in the `-o` flag is relevant, as this name is the gatherer name that must be used in the server side checks declaration.
- Once the plugin is implemented, it must be compiled. Use the next command for that: `go build -o /usr/etc/trento/example ./your_plugin_folder/example.go`. The `-o` flag specifies the destination of the created binary, which the Agent needs to load. This folder is the same specified in the `--plugins-folder` flag in the Agent execution. In this case, the used name for the output in the `-o` flag is relevant, as this name is the gatherer name that must be used in the server side checks declaration.
- In order to see that the plugin is correctly loaded, run: `./trento-agent facts list`.

Find the official gatherers code in: https://github.com/trento-project/agent/tree/main/internal/factsengine/gatherers
Expand Down

0 comments on commit cba022c

Please sign in to comment.