Author Topic: Syslog/SMTP client  (Read 942 times)

syrinxtech

  • Sr. Member
  • ****
  • Posts: 347
  • Country: us
    • Syrinx Technologies
Syslog/SMTP client
« on: February 11, 2018, 08:57:31 AM »
We just finished up a project for a client building a computer room sensor platform.  It can provide temp/humidity/motion detection and water leak detection.  It is actually built on the Particle Photon platform since it provides built-in wireless.  It provides local data on a 20x4 LCD screen and offers the following remote features:

1.  All data is logged to Freeboard.
2.  Emails are sent for various alert conditions:
  - High/low temp
  - Water leak detection
  - Motion detection
  - Water leak cable unplugged
3. Through Particle functions, you can remotely change the high/low temp thresholds, disable/enable motion detection, print a weekly status email and obtain the last email status via Postman or curl.
4. Sylog logging.

In working on this project, I wanted to limit the number of 3rd party services (ie, Freeboard, IFTTT, etc.) that the project depended on.  In order to do this, I wrote native clients for both SMTP and syslog.  Therefore, I can send both emails and syslog messages without the use of any 3rd party service.  My syslog client currently supports RFC3164, but I am working on adding support for RFC5424 as well.

Once an error condition occurs, emails are sent on a 5-minute basis until the issue is corrected.  The only exception is when you disable motion detection (for times when you're working in the area and don't want to trigger false positives), that timer is set to 1 hour.  The time is synched via the Internet once at night at midnight and once a week on Monday morning a status email is delivered that can be printed and stored for compliance purposes.

The nice thing about the Particle family is that it runs standard Wiring code so everything ports to/from the Arduino/Moteino world transparently.  Obviously there are software features available in the Particle not found in the Arduino world, but it makes for an interesting platform.

syrinxtech

  • Sr. Member
  • ****
  • Posts: 347
  • Country: us
    • Syrinx Technologies
Re: Syslog/SMTP client
« Reply #1 on: February 11, 2018, 02:12:52 PM »
Even though my syslog server, Kiwi, doesn't support it yet, I went ahead and coded the option to use either RFC3164 or RFC5424 style messages.

I'm going to look around and see if any of the Mac or Linux-based syslog servers support the newer standard so I can test.