# Alert for nginx not running

**URL:** <https://community.netdata.cloud/t/alert-for-nginx-not-running/4621>\
**Category:** Help\
**Tags:** configuration, agent, alerts, notifications\
**Created:** [August 28, 2023, 11:01am UTC](https://community.netdata.cloud/t/alert-for-nginx-not-running/4621 "2023-08-28T11:01:00Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![avrapal](https://yyz1.discourse-cdn.com/flex029/user_avatar/community.netdata.cloud/avrapal/32/3119_2.png) [@avrapal](https://community.netdata.cloud/u/avrapal)\
**Post date:** [August 28, 2023, 11:01am UTC](https://community.netdata.cloud/t/alert-for-nginx-not-running/4621/1 "2023-08-28T11:01:00Z")

</div>

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:

```auto
    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.  
~

---

<div class="post-metadata">

**Author:** ![Manolis\_Vasilakis](https://yyz1.discourse-cdn.com/flex029/user_avatar/community.netdata.cloud/manolis_vasilakis/32/820_2.png) [@Manolis\_Vasilakis](https://community.netdata.cloud/u/Manolis_Vasilakis)\
**Post date:** [August 29, 2023, 7:48am UTC](https://community.netdata.cloud/t/alert-for-nginx-not-running/4621/2 "2023-08-29T07:48:54Z")

</div>

Hi @avrapal

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

---

<div class="post-metadata">

**Author:** ![avrapal](https://yyz1.discourse-cdn.com/flex029/user_avatar/community.netdata.cloud/avrapal/32/3119_2.png) [@avrapal](https://community.netdata.cloud/u/avrapal)\
**Post date:** [August 29, 2023, 8:59am UTC](https://community.netdata.cloud/t/alert-for-nginx-not-running/4621/3 "2023-08-29T08:59:20Z")

</div>

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