I have a chart created that exposes the nginx workers and it works just fine. However I wanted to create an alert that cross references the go.d and charts.d in the calculation
Here is my Alert
on: nginx.connections
every: 5s
calc: $active * 100 / ${chart:nginx_worker_connections.worker_connections:max_connections}
warn: $this > 0.1
crit: $this > 0.2
info: Nginx connection usage: $this% (Active: $active, Worker Limit: ${chart:nginx_worker_connections.worker_connections:max_connections})
to: sysadmin
Here is the created chart.
localhost:19999/api/v1/data?chart=nginx_worker_connections.worker_connections
{
"labels":["time","max_connections"],
"data":[
[1753475078,1024],
[1753475077,1024],
Logs
spawn-plugins[842120]: SPAWN SERVER: child with pid 843385 (request 14) exited with exit code 1: /bin/sh -c "exec '/usr/libexec/netdata/plugins.d/alarm-notify.sh' 'sysadmin' 'exampledomain.com' '1723338740' '1723162860' '20' '1753801789' 'nginx_connection_alert' 'nginx_remote.connections' 'CLEAR' 'UNINITIALIZED' 'nan' 'nan' 'line=11,file=/etc/netdata/health.d/nginx_connections.conf' '0' '0' 'connections' 'Nginx connection usage: _this% (Active: _active, Worker Limit: _{chart:nginx_worker_connections.worker_connections:max_connections})' '' '' '_this > 0.1' '[ _{this} = nan ] ' '0' '0' '' '' 'Unknown' 'sudo /etc/netdata/edit-config health.d/nginx_connections.conf=11=exampledomain.com' '4b958486-74df-4dc0-a0c7-77a0821a1aac' '88566368-c5cd-429d-aa99-715dbf2988d0' 'nginx_connection_alert' 'nginx.connections' '' ''"
I’ve set the threshold too low just for testing. Normally it will only have 1 to 2 active nginx connections
Calculation does not seem to work. What am I missing?