Warning Light is a lightweight daemon running on NEMS 1.4.1+. It is a different type of notification system exclusive to NEMS Linux.

NEMS Warning Light: Hardware

If the state of your monitored hosts should change, Warning Light could be used to trigger a visual response by way of a tower signal lamp via GPIO, for example.

  1. OK: Solid green light
  2. WARNING: Solid orange light
  3. UNKNOWN: Flashing orange light
  4. CRITICAL: Short siren every 15 minutes, solid red light.

Warning Light uses nems-api to monitor the status of your NEMS Linux server.

Warning Light can be connected directly to a supported NEMS Linux server, or eventually (not yet available) to a supplemental device running the NEMS Tools Distro with network access, even through the Internet.

System Requirements

Warning Light can be connected directly to the GPIO of your Raspberry Pi-based NEMS Linux server. If your NEMS server is a different platform or GPIO to the server is not convenient, you can connect your Warning Light to a supported device (such as a Raspberry Pi Zero) and install NEMS Tools GPIO Extender Receiver OS, which will allow you to add an unlimited number of GPIO receivers to your NEMS server, regardless of platform.

Technical Info for Makers

GPIO Pin Assignments

On any Raspberry Pi NEMS Linux server or NEMS Tools GPIO Extender receiver, the pinout is as follows:

  • OK state → Pin 24
  • UNKNOWN or WARN state → Pin 23
  • CRIT state → Pin 18

Please Note: When the final version is released, it will most likely use the I2C protocol (unless I decide to create a USB version instead of GPIO-based). However, these GPIO pins will remain functional in order to provide an alternate means of connecting for tinkerers.

Pins are LOW (0) by default, and will turn HIGH (1) appropriately in event of a state change. For example, if your NEMS Linux server is in OK state, Pin 24 will be HIGH while pins 23 and 18 will be LOW.

The pinout should remain the same, though I may expand it to support a siren signal or passive alarm buzzer. I'd suggest using these pins to trip a 5V relay, powering a higher-voltage indicator such as a signal lamp.

Please share what you create. I'd love to see your designs to make NEMS Warning Light work in your environment.

NEMS Tools GPIO Extender

If your NEMS Linux server is not powered by a Raspberry Pi, or if it is not located where you'd like your NEMS Warning Light, plugging a NEMS Warning Light device into the GPIO isn't possible. That's where the NEMS Tools GPIO Extender comes in.

To use the NEMS Tools GPIO Extender, you'll need any Raspberry Pi to act as the receiver, but your NEMS Linux server can be any supported platform, including Virtual Appliance. A Pi Zero WH would do very nicely for the task. Since the GPIO Extender receiver is separate from your NEMS Linux server, you can add Raspberry Pi's GPIO to your ODROID-N2 NEMS Server, for example. Or install your NEMS Warning Light on a ceiling-mounted unit closer to the area where your technicians work, connected to the GPIO Extender server (your NEMS Linux server) over wifi. Or install your NEMS Warning Light on the other side of the world: Since the NEMS Tools GPIO Extender is IP-based, it can be anywhere as long as it has network access to your NEMS Linux server (TCP port 9595).

To top it off, you can use an unlimited number of NEMS Tools GPIO Extender receivers with a single NEMS Linux Server.

Your NEMS Linux 1.5 server is already running the NEMS Tools GPIO Extender server on port 9595.

NEMS Tools GPIO Extender Receiver OS is coming late July, 2019.

NEMS Warning Light: Webhook

Send notifications directly to your webhook. For example, have your NEMS Linux server post alerts directly to your company Discord channel.

To use NEMS Warning Light's webhook feature, simply add your webhook URL to NEMS SST.

Webhook functionality requires NEMS Linux 1.5+. NEMS only sends webhooks. It does not receive them.

Currently Supported Webhooks:

  • Discord
  • Slack
  • Microsoft Office 365 / Teams

If you would like support added for another webhook, please simply put it in as a feature request in the Community Forum.

Configuring Webhooks

Microsoft Office 365 / Teams

Test Your Webhook

sudo nems-webhooktest

NEMS Warning Light: Log Files

You can monitor what is happening with Warning Light by tailing the log file.

tail -f /var/log/nems/nems-tools/warninglight

You can view the current state of NEMS Warning Light:

cat /var/log/nems/nems-tools/currentstate
  • features/nems-tools/warninglight.txt
  • Last modified: 2019/09/06 14:45
  • by Robbie Ferguson