Parsing Nagios Performance Data

Recently I was adding features to Trash Panda, a local monitoring system project I probably never should have started. I thought it might be interesting to do something with the performance data many Nagios plugins send back as part of service check results. Performance data is additional data about the service that can be useful as history for how the service is performing. Stuff like disk space metrics, TCP return times, and other types of numeric values. The format is standardized and could then be easily piped into a database or other storage area for later use. This post documents my efforts from loops within loops to something bordering on efficient.

I do want to note I did try and find a tool for this before building something from scratch. There are some command line tools but nothing in a library format. Since the Trash Panda project is written in Python that’s really what I needed.

7 min read

Dynamic Pandas Data Slicing

Recently I wanted to modify a Python data analysis script I use regularly at work into more of a general purpose tool. The script uses the Pandas Python library to slice up data in CSV files based on some specific time periods. The issue I had is that these time periods changed often, and I was sick of mucking about in the script to constantly tweak them. I needed a way to specify the time periods at runtime instead of hard coding them.

This turned out to be more complicated than I envisioned so I figured I’d document it all for anyone interested (most likely myself in a year when I forget). Note: this post is not a primer on Pandas, or data slicing, if you want more info on that check the Pandas documentation.

8 min read

Automatic Cat Feeder

We recently got a second cat. It’s been a lot of fun but one thing I didn’t realize is how much more two cats were going to eat. With one cat a bowl of food lasted 2-3 days before needing refilling, with two it seems to be running low every day. To make matters worse we keep our cat food bowl in the laundry room so the food doesn’t get stolen by the dog. The phrase “out of sight, out of mind” definitely applies here and I’ll be honest they’ve run out of food enough times that something had to change.

I had two options. The first was the easy option - just get a bigger bowl. The second was the fun option - buy or build an automatic cat feeder. Obviously I went with the fun option.

13 min read

QR Code Media Player

We were recently trying to organize some of the clutter in our home and I started in on the video game and Blue Ray/DVD collection. For Blue Ray/DVDs (henceforth referred to as just DVDs) we’re in the same boat as a lot of households, we just don’t use them. Streaming is a good amount of our media consumption but I take movies we’ve purchased and rip them to our NAS so we can play them back via Kodi. Since the entire collection is digitized what often happens is we look at the DVD rack, select a movie we want, and then find it via Kodi and play it there.

Inspired by many Home Assistant related NFC “jukebox” type projects I thought it would be fun to combine the physical with the digital. I wanted to use the physical disc to trigger the playback of the digital file. Since Kodi has a JSON-RPC API being able to trigger playback based on a tag or code seemed doable.

QR Code

9 min read

Monitoring SNMP Traps

In my profession life I recently purchased an Infrasensing Base Unit along with a door contact sensor. These are pretty interesting IoT devices that accept a wide variety of sensors. My intention was to connect this to our network monitoring system, Icinga, to monitor the status of a network cabinet door.

Upon playing around with the device I decided the best way to get timely alerts from the sensor was to utilize SNMP traps instead of polling for the status. While I have a lot of experience polling SNMP systems I’d never dug into traps before. Going down the rabbit hole of getting this going turned in to a pretty neat little project that can be utilized to translate SNMP trap payloads into something Icinga can accept for service checks.

sensor page

8 min read

Home Assistant Voice Custom Intents

In 2023 Home Assistant is dedicated to making their smart home platform more capable of text and voice interaction through the Year of the Voice. Essentially this is expanding on the capabilities of Home Assistant to interpret human text and speech into smart home actions. This provides more possibilities for existing voice assistants like Alexa and Google Home; while also providing an alternative through Home Assistant’s own Assist platform.

While a number of built-in intent phrases have been added, I’ve been experimenting with adding my own trigger phrases and intents. For the most part this was just following the documentation however there were a few things that weren’t clear, or just didn’t work as expected. I’m documenting these here for future reference, and for anyone else struggling through the same thing. Hopefully as this part of Home Assistant matures adding these custom actions will become more clear.

Assist Chat

9 min read

Portable Face Finder

As a side project I’ve been working on a portable Python program to find if specific people, using facial recognition, are in a collection of images. The idea for this grew out of a joke but the more I thought about it I realized it had some real applications.

A co-worker of mine was having trouble finding images of specific individuals within a large folder of images. Over the years this folder had gotten overgrown and photos were in random sub-folders sorted by date, location, or event. It was hard to find photos of specific people without digging through a lot of images to see if they were in them. I jokingly suggested we use some facial recognition software to comb through the folder and just flag all instances of the person they were looking for. I held on to the idea over the next few days thinking about how something like this would function.

The idea itself is pretty boilerplate stuff for any image tool, like Google Photos or on Facebook. These will recognize the faces and do all the heavy lifting for you. My real interest lay in situations where having an offline solution to this problem would be useful. Family pictures on a parent’s computer or in this case employee photos not part of a unified imaging solution. I imagined there was some utility being able to throw in a USB drive, launch a script, and identify photos of interest based on looking for specific faces.

deepface image detector example

8 min read

Crowd Sourced Quote Generator

I have an LED Sign in my office that displays information like the weather, currently playing music, and other stuff. One day I added a random movie quote to the rotating text just for fun. A few days later I swapped it out for another one. As you can imagine, an idea hit. What if I could randomly add a new quote every few days? There must be a web service to pull quotes from, right?

Hence began my search for an existing service to pull movie and TV show quotes from. I found a few options, but I came up short of what I wanted. Many sites cataloged movies, but not quotes. Others had quotes but no method to pull them programmatically. The IMDB in particular looked the best but their “quotes” were often several lines of dialog from the film. Plus I just didn’t want to mess around with integrating with them since it’s a proprietary site.

At this point I figured I could either a) drop this idea or b) try and build something. Something as simple as text file with a bunch of favorite quotes in it would have worked but I didn’t want to have to generate all the content myself. I thought it might be fun to build something my friends and family could add quotes to as well. It would have the added bonus of making the quotes more diverse than just things I thought up.

Landing Page

10 min read

Automate Doorbell with ESPHome

Disclaimer: This is not about replacing your doorbell with a video camera doorbell using an ESP32. There are lots of tutorials about doing that if that’s what you’re after.

For a long time I’ve hated my doorbell chime. It doesn’t get used much, but when it does I hate it. The noise is annoying and over the years our dogs have picked up on it and it triggers them to rush to the door when they hear it. I’ve always wanted to make the chime sound different or try and automate it in some way but it was a back-burner project. Recently though my wife starting working from home and the chime is disrupting online meetings. It’s loud and then the dogs bark and scramble for the door, not the most professional.

I decided to finally tackle it and see if I could replace the chime with an ESP32 to provide more flexibility and automation behind the simple push button.

7 min read

Home Assistant Update Notifications

Starting with version 2022.4, Home Assistant has support for Update entity types. Using this entity type, devices (or Home Assistant itself) can let the user know of updates to software and firmware. At it’s most basic level this acts as a binary sensor to tell you if an update is available (when on). The update entity also has lots of information such as the currently installed version, the new version available, release notes URL, additional service calls and much more.

The documentation for the Update entity includes a basic automation for how to receive notifications for when an update is available. The problem with this example is it only works for a specific Update entity (like Home Assistant Core updates). I wanted a solution to let me know when an update to any update entity was available. I found this can be done with a bit of thought and a Template sensor.

4 min read