Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env python
"""
SNMP helper for HAproxy implementing EXCELIANCE-MIB with
`pass_persist` protocol. Data are retrieved from multiple instances of
haproxy using HTTP.
"""
def toOid(oid):
"""Convert a string to tuple OID"""
@qixtand
qixtand / gist:7364575
Created November 8, 2013 00:59
A wrapper script to invoke the newrelic_resque_agent and capture it's PID for monit monitoring. Adapted from example 7.3.2 from http://tldp.org/LDP/Bash-Beginners-Guide/html/sect_07_03.html.
#!/bin/bash
LOGFILE=/var/log/newrelic/newrelic-resque-agent.log
PIDFILE=/var/run/newrelic-resque-agent.pid
CONFIGFILE=/etc/newrelic/newrelic_resque_agent.yml
case $1 in
start)
exec 2>&1 /usr/bin/newrelic_resque_agent --config $CONFIGFILE run 1> $LOGFILE &
echo $! > $PIDFILE