The Guru College

Nagios Check Plugin For Google App Dashboard

UPDATE: I’ve fixed the plugin download link

UPDATE #2: Updated the plugin to work correctly for “Admin control panel / API”

I’ve written a Nagios check plugin for the Google App Status Dashboard. It’s written in perl, and has two dependancies: the JSON perl module (I’m calling JSON::PP, the pure-perl version), as well as a copy of the open source application curl to pull the JSON data file from Google’s servers. Curl needs to be in your default path – which it is on OSX, RedHat, Ubuntu and OpenSolaris – which are the distributions I care about these days.

If you run the check command with no arguments, it returns an UNKNOWN state. Using the -s "App Name" argument, you can specify what you want to check. If you don’t supply data with the -s flag, or misspell the name of the App, you instead get a list of available applications back – queried live from the JSON feed. This way, as more Apps are added, it’s easy to get the status of them. (Note that all of the app names have spaces in them, so you will need to use quotes around the name.)

``UPDATE: I’ve fixed the plugin download link

UPDATE #2: Updated the plugin to work correctly for “Admin control panel / API”

I’ve written a Nagios check plugin for the Google App Status Dashboard. It’s written in perl, and has two dependancies: the JSON perl module (I’m calling JSON::PP, the pure-perl version), as well as a copy of the open source application curl to pull the JSON data file from Google’s servers. Curl needs to be in your default path – which it is on OSX, RedHat, Ubuntu and OpenSolaris – which are the distributions I care about these days.

If you run the check command with no arguments, it returns an UNKNOWN state. Using the -s "App Name" argument, you can specify what you want to check. If you don’t supply data with the -s flag, or misspell the name of the App, you instead get a list of available applications back – queried live from the JSON feed. This way, as more Apps are added, it’s easy to get the status of them. (Note that all of the app names have spaces in them, so you will need to use quotes around the name.)

``

The perfdata returned is the number of messages for a service that aren’t resolved. This means that each follow up message about a service issue increases the count. Once the serivce issue is cleared, the count drops back to 0, and the service returns “OK” again. The check only ever returns UNKNOWN, OK, and WARNING states. A later version will distinguish between a service disruption and a service outage, but this was all I needed at the moment.

Download check_google_apps.pl

Who Knew? | Home | Pictures of the Day