Archive for May, 2010

Puppetcamp Europe

May 26 2010

Floo IT BVBA is an avid aficionado of Puppet, which is rapidly becoming the de-facto standard in open source configuration management.

Tomorrow and the day after, we will be attending Puppetcamp Europe in Ghent, Belgium!

Hope to see you there!

No responses yet

Combining two nagios checks into one

May 24 2010

Last week I felt the need to combine the output of two nagios checks into one to check the state of my puppet clients. Because I couldn’t find any fast enough, I decided to write one quickly.

I thought I’d share this with the world, should anyone need this too…

#!/bin/bash
# A simple nagioscheck to combine 2 checks
#

cmd=$@
script=$0

OK=0
WARN=1
CRIT=2
UNKNOWN=3

usage () {
  echo "check_combine usage"
  echo "check_combine check1 check1_params -- check2 check2_params"
}

parse () {
  check1=$(echo $cmd | sed -e "s/\$script //" -e "s/ -- .*//")
  check2=$(echo $cmd | sed -e "s/\$script //" -e "s/.* -- //")
}

execute () {
  output1=$($check1)
  code1=$?
  output2=$($check2)
  code2=$?
}

analyse(){
  code=$code1$code2

  case "$code" in
    "00"|"01"|"02"|"03"|"11"|"22"|"33")
       echo $output2
       exit $code2
       ;;
    "10"|"20"|"21"|"23"|"30"|"31")
       echo $output1
       exit $code1
       ;;
    "12"|"13"|"32")
       echo $output2
       exit $code2
       ;;
     esac
}

parse
execute
analyse

No responses yet

New site

May 24 2010

I finally found the time to revamp the Floo IT BVBA site. I hope to be able to update this blog as soon as possible with useful tips I encounter during the projects I’m working on.

No responses yet