AI, Monitoring, and Open Source: A PingLite Tale
PingLite is a project I have been working on for some time now, it represents a few things: my frustration with existing monitoring tools, my wanting to relearn C++ (which I haven’t used in well over a decade), and an exercise in tinkering with Artificial Intelligence as a coding aid. In this article, I’ll discuss each point separately and wrap it up by introducing the final product of my labors.
Frustration with Existing Monitoring Tools
There are a million and one monitoring tools out there, and as much as I don’t want to add another name to the market, they are either too complicated to setup for common household use or require money to use. I am impatient in that I want my monitoring to be able to be configured easily, but cheap because I don’t want to pay out the nose for what I actually want.
The tool I am replacing is a tool called “Cronitor”, it is nearly perfect for my needs.
- It monitors and alerts me in my preferred avenue when my sites require attention:
- The site is down.
- The SSL/TLS certificate is expiring soon and needs to be renewed.
- It alerts me when my site recovers from being down.
There are some limitations though:
- Only 5 monitors are free.
- Free monitors only check on a 5 minute cadence.
Other tools like UptimeRobot also do the same things, but without paying you only get so many features or are limited to frequencies that can be slow to respond in a high stakes situation. With all of this in mind, I decided I wanted to make my own minimal tool to get the information I care about at a frequency I am comfortable with.
Relearning C++
The last time I used C++ was back in college when C++11 was the standard. I won’t say I was the best at understanding some of the concepts back then , such as pointers, so I thought this would be a great way to hopefully solidify some of them in my mind. I also wished to use containerization to ensure a consistent build and make sure that my system, if it isn’t an ideal system anyway, wouldn’t contaminate the binary or prevent anyone down the road from achieving the same result on their machine.
The compilation environment, as a clean environment, is pushed to docker hub for anyone’s use as well. You can find it in the links section at the bottom of the article. It is rebuilt automatically every weekend to allow the AlmaLinux base, as well as the components of the compiler, to be updated. The components added currently are gcc-c++, make, and libcurl-devel.
Exercise in AI as a Coding Aid
I will admit, I have been a slow adopter of Artificial Intelligence. I have been unsure of how secure it is, how accurate it is, or if it can even provide useful information. With this in mind, even though I did use AI, I followed standard security practices and did not blindly copy paste. Every line was looked over to ensure that it wouldn’t do anything bad, and when code was used from AI, it was tested thoroughly before it left the development branch into the nightly or stable branches.
The AI I used was Gemini, I’m sure everyone has their preferences on which AI model is better at one thing or another, but this is what I used. It was able to recommend tools, such as INIH and LibCURL, which were absolutely crucial to this project working as I intended. It even did provide some useful snippets of code. However, the bulk of the code it wrote itself was complete trash and did not compile. If it did compile it did not function as it should have and was extremely troublesome to troubleshoot.
The primary use I found for it was inputting compile errors and it quickly pointing me to a solution. Sometimes the solutions were bad, but it was a direction that I could go off of. Additionally I was able to interact with it to tell it the solution was bad and it would correct to a less incorrect solution. It is important to note that after a while troubleshooting the same issue, the “hallucinations” that AI is famous for became too much and the responses to that particular line of inquiry were just complete junk that was overcomplicated and utterly useless.
If you are reading this article solely for my review on AI, then here it is. It, as a tool for troubleshooting and tossing around ideas is great, but for the love of everything holy and unholy alike, do not use it as a coder. The code it gives you, from my experience, is ripe with errors and untrustworthy at this stage of its development. I’m sure many folk will use it to “vibe code”, but for things that others will use or depend on, it is not the right tool and a trained developer is still necessary.
The Final Product / Introducing PingLite.xyz
With the combination of: relearning a tool, playing with a new one, and aiming for a solidified outcome, PingLite is the final product. I have my simple configuration file, json payload, and locations for a temp file and log file if I wish. I set PingLite to run as a CRON task every minute, and now I am notified when my sites go down or when the SSL certs are about to expire.
The downsides are that if my local machine goes down or cannot access the internet I am unable to send the notification. However most individuals at the industrial scale have this settled already by using designated datacenters, or cloud nodes, with redundancy and/or external monitoring. Therefore for my purposes, this small program I have created, fits all of my needs. I still use Cronitor as an external monitoring tool, specifically to ensure that my machine can connect to the internet and the internet can connect to my machine. Therefore I am only using 2 of my free monitors, and am able to monitor all of my websites.
I think I’m covered as a home user with this, about as well as any small to medium size business would be with any other tool. What do you think?