checkand it can:
examplethat sends topology into StackState. It uses docker to run the StackState agent to execute the check.
stackstate.yamlfile is the main agent configuration file. It tells the agent where to find StackState and what API key to use.
examplecheck consists of two files:
conf.d/example.d/conf.yaml- the check configuration file
checks.d/example.py- the check Python code
run.shshell script that runs the StackState agent in a docker container. It reads the configuration from this sample project and executes the
stackstate.yamlfile) so it is fairly verbose.
examplecheck will be sent to StackState.
ctrl-cto stop the agent.
examplelabel. This should result in a topology similar to the following:
exampleagent check. The components appear in the Example domain and Applications and Hosts layers. The check produces two application components that StackState has grouped together. This is shown as a hexagon icon. Click on the group to access the individual components that make up the group.
streamsproperty in the Template function text area and copy it to your clipboard.
example-example://example-1-component-templatein the Template dropdown.
streamspart with the code you copied earlier.
some-application-1for the value. This is correct for one of our components, but not for the other. We need to make this value dynamic.
some-application-1with a reference to the component's external id:
Synchronization example example://example-1synchronization.
logstreamand its type is, indeed,
alert_levelfield in the
custom-event.jsonfile to try out different values, such as
ok. The component should change it's state a few seconds after receiving the event.
CRITICAL, this is what you should see: