Script for monitoring a system using Nagios

A couple of years ago we got solar panels installed on the roof of the house. It looks like it is going to be a good investment.

For the last year I have had automatic upload of my production data set up to go to Here is a link to my data on the site - go take a look.
Sometimes the automatic uploading fails. And it can take me a while - weeks - to notice that there is an issue.

I have finally managed to get a reasonable setup with my Nagios installation that will detect if data is missing for my system on
The important piece that I have in place is a script for use with Nagios that will check if my system on, identified by a System ID, has data available for today or not.
If there is no data, the script will return a CRITICAL status that Nagios know how to work with. if there is data avalable, the script returns an OK status.
The script uses the API that is available for working with is great!
Here is what I now see in my Nagios services status page:

The way I have configured my Nagios installation, if three checks (with 10-minute intervals) fail, I will get:

  • A red LED light on my Blink(1) which is plugged into my Nagios server.
  • A message by Pushover service to my Android device(s).

Some information on that alert configuration is here: Nerd alert: Home server with Nagios, Pushover and Blink(1) warnings.

You can call the script without using Nagios, in order to check if it works.
The syntax goes like this:

For instance
./ 87654 12345

This would check the system with ID 12345. The APIKEY (87654 in the example) is a key that is needed in order to be allowed to use the API.
Both the APIKEY and SYSTEMID are values you get from your account.

There is a third, optional, parameter that controls which day you want to check for data. If you leave it out, the check will be for today. If you put a number in the third parameter, the number will be the number of days to subtract from today.
So for instance if you use this command
./ 87654 12345 1

you will bee checking if has data for yesterday

I have put the Nagios script up on Nagios Exchange.
This is my first shot at creating at Nagios script, so any constructive criticism is welcome.