How I Created A Simple Axis Camera Health Monitor

Having video surveillance is great, but you need to make sure the cameras are running 24/7. Naturally, a camera can’t notify you when it dies, so to check if it is alive, you need to monitor the camera periodically. But doing so is a pain in the ass, and so with a little web server coding I was able to set up a monitor for a camera in the office in a day or so.

I’ve got an old PC running Ubuntu sitting in my basement, it’s serves as a LAMP-stack (Linux Apache MySQL and PHP), as well doing a few other chores for me. With the server in place I cooked up a small project called “Sentinel”. Using a few lines of PHP, SQL and a CRON script it’s pretty easy to do.

My tired work-horse
My tired work-horse

Basically, I’ve created a table that hold “beacons” on the MySQL server, periodically, I sweep the beacon table, and check the age of the newest beacon. If the beacon is too old, I send out an email. The script to create tables and store beacons is outside the scope of this post, but I’ll share a few simple ideas. To sweep the beacon table periodically and send emails I used CRON with curl – this way I could code my beacon check code in PHP (using PHP/Pear I can send emails). I created a CRON entry that will use curl to open a web page every hour. When the server gets the request, it will execute the PHP script, and thus I get periodic execution of PHP code. Perhaps there’s an easier way, but this worked out fine.

I created a simple dashboard, that allows me to see the beacons in a simple and quick manner.


The first 3 systems are not getting any beacons, but the 4th one is fine, and has been fine for a while. To dump a beacon on my server, all the camera needs to do is to periodically open a URL with some parameters (sysid and comment). Some of the Axis cameras support this quite nicely..

First, set up a recipient that is a HTTP recipient


Then, set up a recurring schedule

Recurring Schedule

Then, create a rule

Create Rule

Rule Setup

I’m not sure what other cameras support this functionality, I’m sure there are other cameras that will do this. The point is that once you start digging around in the toolbox, you can accomplish pretty cool things with a bit of effort. Sure, this isn’t commercialized, and it’s a hassle to configure hundreds of cameras this way. There ARE commercial tools available out there, that will let you do what I describe here.