Application Lifecycle
NMX-T (Telemetry) requires NMX-C (Controller) to be up and running within the same network domain.
To start and stop the application, perform the following:
Make sure the cluster is enabled:
nv show cluster
If the cluster is disabled, enable it by running:
nv set cluster state enabled nv config apply
Start the telemetry application:
nv action start cluster app nmx-telemetry
Verify the NMX-T is running among the other cluster applications.
nv show cluster apps running
Enable the NMX-M registration:
nv action update cluster apps nmx-telemetry manager enabled
To stop the application, run:
nv action stop cluster app nmx-telemetry
Health check callback - expected to see "OK" in the output
curl -s http:
//localhost:9350/healthcheck
Application package information - list of components with their versions
curl -s http:
//localhost:9350/info/package | jq
Configuration callback - expected to see security configuration details
curl -s http:
//localhost:9350/config | jq
Prometheus metrics - expected to see metrics data
curl -s http:
//localhost:9352/metrics
Custom gRPC - expected to see metrics data
The form of the call depends on the installation method.
./test/nmx_client.sh --target localhost:
9351
subscribe
When running NMX-T in a standalone mode, i.e. not integrated into the NVOS bundle, the application lifecycle is controlled using the helper scripts distributed as a part of the package.
All the integration scripts are executed from the package “untarred” folder, making it an implicit script argument.
install.py:
installs an application from the uncompressed package folder. Accepts path to the application registry as a first positional command line argument.start.py:
starts the application running. The script needs to receive as input the argument full path to the folder with theuser_config.json
file.stop.py:
stops the application. The script receives as input argument the full path to the application registryuninstall.py:
removes the installed components of the application, including the untarred package. Accepts path to application registry as a first positional command line argument.support.py:
a maintenance script. The script receives as input argument the full path to the application registry.
Cluster Application Registry
The cluster application registry is a JSON file keeping information of the cluster applications installed. While the path to the folder containing the application registry may vary, the name of the file remains constant installed_apps.json
{
"nmx-telemetry"
: {
"configCallback"
: "http://0.0.0.0:9350/config"
,
"healthcheck"
: "http://0.0.0.0:9350/healthcheck"
,
"packageFilesFolder"
: "/etc/nmx/nmx-telemetry"
}
}
Standalone Application Lifecycle Example
Install the application.
python3 ./install.py $(pwd)/..
Start the application.
python3 ./start.py $(pwd)/..
Check the docker containers are up and running - nmx-t container should be present and running healthy.
docker ps | grep nmx-t
Stop the application.
python3 ./stop.py $(pwd)/..
Uninstall the cluster application.
python3 ./uninstall.py $(pwd)/..
Lifecycle Management Script Configuration
The application lifecycle management scripts could be individually configured at runtime by setting the following environment variables:
Variable name | Descriptions | Default |
NMX_LOGGER | Logger facility to use: syslog or stdout | syslog |
NMX_DEBUG | Enable debug log messages | false |
NMX_REMOVE_FILES | Let the uninstaller remove package files | true |
NMX_JOB_SPEC_NAME | Name of the job spec file in JSON format | job.json |
NMX_AS_ROOT | Check for the mandatory root privileges | true |
For example, run uninstall script, showing detailed logs to the standard output and keeping the package file:
NMX_LOGGER=stdout NMX_REMOVE_FILES=false
NMX_DEBUG=true
python3 ./stop.py $(pwd)