This is part 1 of an eventual 3 part series covering the Homelab Monitoring project brief, its hardware and eventual software setup.
Homelab Monitoring with Raspberry Pi
As mentioned in an earlier post, due to necessity my homelab is located in the loft of my victorian era house. The loft space is actually a really nice space to work in, it has plenty of head room to operate in, has good lighting and above all is well ventilated and dry.
However most of the time the hatch is going to be sealed up as a work from downstairs in my house – the only real time i’m going to need direct access to the loft space will be when I rebuild servers or need direct access to perform other maintenance tasks.
Working headless in this way isn’t going to prove an issue, I RDP in to each server when needed and can remote switch them on using HP’s built in iLO system, and then shut them down on demand using scripts or via a run menu shutdown in Windows.
One thing that I do really want to keep an eye on is the temperature in the loft space. In summer it can get a little on the warm and humid side and in winter is can be get very cold, never below zero but still cold enough that it may be an issue in the long run.
What I’d like is some kind of environmental network monitoring setup that reports the current temperature in the loft space in a convenient way.
Enter the Raspberry Pi..
For the monitor i’m planning on using a Raspberry Pi for two reasons:
- Accessible hardware and Software
Hardware and Software Accessibility
The RasPi’s hardware is deliberately hackable to do what ever you want it to do. In this instance i’m going to use the Raspberry Pi Sense Hat as it has all the features and sensors that I could possibly need for this project. It comes in a neat and tidy package and as its a Raspberry Pi it also has all the networking features built in that I need.
Choosing the RasPi and the Sense Hat also forces me to learn to code, which to be frank, is something that i’ve been putting off for a long time. I’m going to write up the code in Python which looks less scary than some of the other languages i’ve dabbled with over the years. Luckily the Sense Hat is very well documented and has plenty of coding examples that I can reverse engineer to do what I want.
The Raspberry Pi is also very cheap, with the RasPi 2 around £30 on Amazon, it also has exceptionally low running costs with 24/7 operation expected to only cost between £5 and £10 per year.
Handy extra features
While the monitor will be mainly to communicate the current temperature of the loft space, its features and functionality will only be limited by my ability to code it. If possible i’d like to also add in some extra functionality like a ping test, so I know if there has been a network interruption.
I was thinking about setting it up as a webpage hosted on the Raspberry Pi, but that relied on me checking to see if there is a problem. I’d actually prefer it to tell me when there is a problem instead so i’ll try and set it up so that it pings me a tweet with the current temperature and humidity periodically along with any other notifications that I code in.
Project overview / brief
Just to sum up, here’s my own list of requirements for the project.
- Report temperature and humidity data once an hour.
- Report average temperature and humidity data 2 to 3 times daily.
- Report successful ping checks at regular intervals.
- Report should error events occur, such as a ping test failure.
- Provide visual feedback that the code is running (as the RasPi will be running headless).
- All communications to be made via twitter.
I’m low going to do some research to see if I need anything else beyond the RasPi and the Sense Hat and then get everything ordered.