Using Splunk to Monitor Network Health

Splunk> Winning the War on Error

I’ve been using Splunk professionally over the last several years, and I’ve become a big fan of using it for my data processing needs. Splunk is very very good about ingesting just about any kind of event data, optionally extracting fields at search time, and providing tools to graph that data, find trends, and see what is really happening on your platform. This is important when your platform consists of thousands of servers, as it does at my day job!

While Splunk can handle events in timestamp key=value key2=value2 format, it also has support for dozens of standardized formats such as syslog, Apache logs, etc. If your data is in a customized format, no problem! Splunk can extract that data at either index or search time! Finally, there’s the Search Processing Language, which is like SQL but for your event data. With SPL, you can run queries, generate graphs, and combine them all programatically.

So yeah, I’m a huge fan of Splunk. One thing I use it for out of the of office is to graph the health of my Internet connection. This is useful both for when I’m at home and when I am traveling–I just feed the output of ping into Splunk and then I can get graphs of packet loss and network latency.

Let’s just jump into an example screen–here’s what I saw when I was a friend’s place and I uploaded a video to YouTube:

Continue reading “Using Splunk to Monitor Network Health”

www.cheopard.com

What is a cheopard?

A typical cheetah, laying on its back.
A typical cheetah.

It’s a cross or hybrid of a leopard and a cheetah. It combines the good qualities of both species.

Generally speaking, a cheopard must be at least 28% cheetah.

So what are the good qualities of leopards?

Leopards are smart. They drag their prey up into trees and feast on it over several days. Efficient!

They are also strong–they can carry more than their body weight. That’s badass.

Leopards have also been known to steal kills from other predators. Even cheetahs are not safe from Leopard Larceny!

Leopards are the hot shit of big cats.

So what are the good qualities of cheetahs?

Pretty much this:

And that’s it. End of list!

Why did you register cheopard.com?

Because it was a nice short domain name that was available.

How did I get to this page?

You probably met me at a furry convention and I gave you this link.

If you have any questions, or are an actual cheetah, don’t hesitate to reach out or leave a comment below.

Fixing The Cover Image Height In WordPress’s Twenty Seventeen Theme

Overall, I am pretty happy with the Twenty Seventeen theme that ships with WordPress, but one thing that really drives me crazy is that whatever cover image you upload takes up nearly 100% of the entire web browser when viewing on a desktop or laptop.  I find it darn near infuriating, because I have to scroll down just to click on a menu link or see content.  That ain’t right.

I mean, just look at this:

We can do better.

Continue reading “Fixing The Cover Image Height In WordPress’s Twenty Seventeen Theme”

Fixing the Homepage Post Width in WordPress’s Twenty Seventeen Theme

I’m still relatively new to WordPress, but one of the things that really got me worked up was the width issue on the front page of my website.  I mean, just look at this:

I am screaming internally.

So I did some Google searches and actually didn’t have much luck.  There were no settings in WordPress that I could change, and the CSS settings that I found just didn’t work.

Continue reading “Fixing the Homepage Post Width in WordPress’s Twenty Seventeen Theme”

Saying Goodbye to Drupal and Hello to WorldPress!

Way back in 2005, I converted my website (and its predecessor) over to Drupal.  Drupal has served me well for the last 13 years, but due to the direction in which Drupal as a product has moved, I do not feel it is the right choice for me anymore.

“U wot m8?”

So I instead checked out WordPress, and was rather happy with it.  It does one thing (blogging) really really well, instead of trying to be the “kitchen sink” like Drupal.  As of this writing, I’ve ported over just about all of the content I wanted to port over, and have since switched www.dmuth.org to point to this WordPress Install.

Along the way, I learned some thing about how to set up and configure WordPress, let me share them with you:

Looking forward to running this platform for the next 13 years. 🙂

— Doug

WordPress 5 in Docker with Nginx and LetsEncrypt

TL;DR If you are comfortable with Docker and Docker Compose, you can go straight to the GitHub repo and get started.  For the everyone else, read on…

WordPress + Docker = <3

When I stood up this website, I wanted to do so in Docker, but I ran into an issue: the official WordPress Docker image runs Apache.  Apache is a nice webserver for small amounts of traffic, but it does not scale well.  As more concurrent connections come into a server running Apache, more copies of the httpd process are forked, which causes RAM usage to go up.  Having RAM usage regularly go up and down  is not ideal.

Fortunately, there is a better way.  The Nginx webserver, combined with PHP running in FPM mode scales much better as the memory usage is more constant, which means that peak loads on the server won’t cause you to thrash the swapfile.  Encryption would also be nice, so I wanted to have some SSL going as well.

I couldn’t find any existing solutions, so I built one!  In this post, I’m going to walk through each piece of the puzzle.

Continue reading “WordPress 5 in Docker with Nginx and LetsEncrypt”

What’s Taking Up So Much Space in AWS S3?

I’m a big fan of Amazon S3 for storage, and I like it so much that I use Odrive to sync folders from my hard drive into S3 use S3 to store copies of all of my files from Dropbox as a form of backup.  I only have about 20 GB of data that I truly care about, so that should be less than a dollar per month for hosting, right? Well…

“You are not your job or how much data you have in S3!”

Close to 250 GB billed for last month. How did that happen?

Continue reading “What’s Taking Up So Much Space in AWS S3?”

Dockerizing Discord’s Music Bot in Amazon ECS

I’m a big fan of the Discord Musicbot, and run it on some Discord servers that I admin. Wanting to run it on a server, I first created an Ansible playbook and launched a server on Digital Ocean. But after a few months, I noticed that the server was sitting over 90% idle. Surely there had to be a better way.

So I next tried Docker, and created a Dockerized version of the Musicbot. I was quite happy with how much easier it was to spin up the bot, but still didn’t want to run it on a dedicated server on Digital Ocean. Aside from having unused capacity, if that machine were to go down, I’d have to do something manually.

I thought about running it in some sort of hosted Docker cluster, and came across Amazon’s container service. So this post is about creating your own cluster in ECS and hosting a Docker container in it. I found the process slightly confusing when I did it the first time, and wanted to share my experience here.

Continue reading “Dockerizing Discord’s Music Bot in Amazon ECS”

Examining 12 Months of SEPTA API Queries

With the release of SEPTA’s new app, I’ve suddenly been flooded with questions about their API. People wanted to know how stable it was.

Well, I don’t work for SEPTA, which means I don’t have insight into their operations, but I can perform some analytics based on what I have, which is approximately 18 months of Regional Rail train data, read every minute by SEPTA Stats.

Overall Stats

This is all of the data that I have in Septa Stats currently:

  • Events Since Inception: 26,924,887 events
  • First Event: Mar 1, 2016 12:00:01 AM
  • Last Event: Nov 16, 2017 10:33:53 PM

That’s way more events than minutes in that timeframe, and the reason for that is each API query is split into a separate event for each train. So if an API call returns status for 20 trains, that gets split into 20 different events. This is done because Splunk has a much easier time working with JSON that isn’t a giant array. 🙂

Continue reading “Examining 12 Months of SEPTA API Queries”