Skip to content

About

Temperature monitor for 1-wire devices controlled from single-board pc's

Resources

Code of conduct

Stars

4 stars

Watchers

2 watching

Forks

Repository files navigation

Poor Admin's Monitor

For my fellow sysadmins who would like to be responsible and monitor server room temperature but professional monitor appliances are too expensive.

The plan here is pretty simple, all you need is:

  • Some sort of x86/ARM capable single-board computer like RaspberryPI with GPIO pins
  • A few components, the star of the show is 1-Wire temperature sensor like MAX31820
  • Basic soldering experience

Design

1-Wire ambient temperature sensing devices are cheap (~$1CAD/each), easy to control (1-wire protocol drivers are readily available) and one can chain a lot of them on a single wire. I'm using UTP since every server room has plenty spare.

I'm chose a standalone C++ web framework to avoid running the bloat that are NGINX/Apache2 + Django/PHP/... on an rpi. But deep down I just wanted to try something new.

Building

  • Download/clone Drogon: https://github.com/an-tao/drogon
  • Follow its installation steps, before running cmake add this line to drogon's CMakeList.txt to fix linking errors on RaspberryPI
target_link_libraries(${PROJECT_NAME} PUBLIC atomic)
  • Install drogon
  • Download/clone this code, do usual
$ mkdir build
$ cd build
$ cmake ..
$ make

Running

  • initialize database
sqlite3 database.db
> .read sqlite3.sql
* * * * *       /home/pi/poor_admins_monitor/poll_devices.py /home/pi/poor_admins_monitor/database.db
  • while database is filling up with first data, rename config.json.template to config.json and adjust settings to your liking
  • run web server with
./poor_admins_monitor
  • Point browser to:
    • http://host:port/api/v1/device/list
    • http://host:port/api/v1/device/get/1
    • http://host:port/api/v1/device/get/1/history

Future features

  • Advertise service over avahi
  • Configuration script to assign each device a verbose name and location
  • Add systemd timer example file for a <1m polling interval (impossible in cron)

Thanks to

  • Drogon for an awesome C++ web framework
  • Pure.css for an elegant lightweight css scaffold
  • Chart.js for slick charts

Gallery

Main page with graphed temperatures

Dashboard

About

Temperature monitor for 1-wire devices controlled from single-board pc's

Resources

Code of conduct

Stars

4 stars

Watchers

2 watching

Forks

Releases

Packages

Used by

Contributors

Languages