<niqui> FUCK YEAH
<niqui> this is how awesome snmpd is
<niqui> in order to show a failure that it gets from an external script, i put this in the config file:
<niqui> exec SOMEARBITRARYNAME /path/to/script arg1 arg2
<niqui> but it expects an immediate response, so since my script-to-see-if-a-database-is-being-updated takes minimally 10 seconds to run, i can’t exec it directly
<niqui> so i have to run something out of cron that runs it periodically and writes state into a file on disk
<niqui> i have it basically run “$scriptname >/dev/null ; echo $? > /var/run/whatever.state”
<niqui> then, since snmpd will understand nonzero return to be failure, i think i can do this in my snmpd.conf:
<niqui> exec SOMEARBBITRARYNAME exit `cat /var/run/whatever.state`
<niqui> except it isn’t being interpreted by the shell, and exit is a shell builtin
<niqui> so i write a script called ‘exiter’ that runs ‘exit $1′
<niqui> but then, of course the shell isn’t interpolating the backticks either
<niqui> so now my exiter script runs ‘exit `cat $1`’
* wasy admires niqui’s ENTERPRISE software
<niqui> so i have to have snmpd run a wrapper around exit to check the state written by the wrapper around the actual script that runs the check
<niqui> there are so many ways for this to break i don’t even know where to start
<niqui> but at least this is THE STANDARD
* niqui coughs