send_gearman dirty wrapper

This is just a skeleton. It works but no  checks on input. It’s meant to be run by a cronjob, so, really, input check? 

——————————————————–

#!/bin/bash

# Mod-Gearman Passive Check Wrapper
# (few lines) coded by Giorgio Zarrelli

COMMAND=`$1`
RETURN_CODE=”$?”
SEND_BIN=’/path/to/send_gearman’
SERVER=’gearmand_server_ip:4730′
HOST=”my_passive_host_as_in_nagios”
ENCRYTION=”yes”
KEY=’my_secret_key’
SERVICE=”$2″

$SEND_BIN –server=”$SERVER” –encryption=”$ENCRYPTION” –key=”$KEY” –host=”$HOST” –service=”$SERVICE” –message=”$COMMAND” –returncode=”$RETURN_CODE”

So:

./send_gearman.sh “/path/to/nagios/plugins/libexec/check_users -w 1 -c 5” check-users