Alert for nginx not running

Hello Netdata Gurus,

I am terribly sorry if my beginner question appears like I have not read the documentation but I have been struggling with how to enable an email alert that triggers when my nginx server is not running.

This is my alert configuration:

    alarm: nginx_processess_updown
       on: apps.processes
    class: Workload
     type: Webserver
component: Nginx
    hosts: *
   lookup: sum -5s foreach httpd
    units: %
    every: 5s
     warn: $this < 10
     crit: $this < 1
     info: nginx down
       to: sysadmin

The alarm is active and not silenced per http://localhost:19999/api/v1/alarms?all . When I stop the nginx server the alarm does not change its state. Perhaps my lookup is not correct?

Also, I would greatly appreciate it if you could show me how to write an alarm using the systemd collector using systemd.service_unit_state

Thank you very much.
~

Hi @avrapal

Can you try this lookup line: lookup: sum -5s unaligned of httpd ?

@Manolis_Vasilakis Thank you very much! This works. Much appreciated.