NGINX Agent is a companion daemon for your NGINX Open Source or NGINX Plus instance. It enables:
- Remote management of NGINX configurations
- Collection and reporting of real-time NGINX performance and operating system metrics
- Notifications of NGINX events
NGINX Agent runs as a companion process on a system running NGINX. It provides gRPC and REST interfaces for configuration management and metrics collection from the NGINX process and operating system. NGINX Agent enables remote interaction with NGINX using common Linux tools and unlocks the ability to build sophisticated monitoring and control systems that can manage large collections of NGINX instances.
NGINX Agent provides an API interface for submission of updated configuration files. Upon receipt of a new file, it checks the output of
nginx -V to determine the location of existing configurations. It then validates the new configuration with
nginx -t before applying it via a signal HUP to the NGINX master process.
NGINX Agent interfaces with NGINX process information and parses NGINX logs to calculate and report metrics. When interfacing with NGINX Plus, NGINX Agent pulls relevant information from the NGINX Plus API. Reported metrics may be aggregated by Prometheus and visualized with tools like Grafana.
When running alongside an open source instance of NGINX, NGINX Agent requires that NGINX Access and Error logs are turned on and contain all default variables.
For NGINX Agent to work properly with an NGINX Plus instance, the API needs to be configured in that instance’s nginx.conf. See Instance Metrics Overview for more details. Once NGINX Plus is configured with the
/api/ endpoint, the Agent will automatically use it on startup.
NGINX Agent allows a gRPC connected control system to register a listener for a specific event. The control mechanism is then invoked when NGINX Agent sends an associated system signal. The source of a notification can be either the NGINX instance or NGINX Agent itself. Here’s a list of currently supported events:
|Agent process started
|Agent process stopped
|NGINX master process detected on system
|NGINX master process stopped
|NGINX master process reloaded successfully
|NGINX master process failed to reload
|New NGINX worker process started
|NGINX worker process stopped
|Successfully applied new NGINX configuration
|Failed to apply new NGINX configuration
|Successfully rolled back NGINX configuration
|Failed to roll back NGINX configuration