#!/bin/bash
#
# Munin plugin using the munin_api module and submodules to log Drupal info.
#
# (c) 2011 Ouest Systèmes Informatiques (OSInet)
#
# Licensed under the General Public License version 2 or later.
#
# This plugin uses CURL to access the Drupal instance over HTTP. For most 
# plugin modules, this could also work in CLI mode using Drush, and a Drush
# plugin implementation is a no-brainer. However, in most cases, this will be a 
# lower performance option, because CLI code is not cached in APC itself, 
# causing extra server load to fetch the files from disk everytime, whereas they 
# will normally be cache in APC itself when using HTTP access.

SUB=$(basename $0 | sed s/drupal_/munin_/)

CURL="/usr/bin/env curl"

case $1 in
  config)
    $CURL http://$HOST/munin_api/$SUB/config
    exit 0;;
  esac

$CURL http://$HOST/munin_api/$SUB