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

This website stores cookies on your computer. These cookies are used to provide a more personalized experience and to track your whereabouts around our website in compliance with the European General Data Protection Regulation. If you decide to to opt-out of any future tracking, a cookie will be setup in your browser to remember this choice for one year.

Accept or Deny