func-command: handy in a pinch
January 26, 2011
during our outage and other fun on sunday/monday in fedora I had call to use func-command to give me some info. Thought I’d post that here.
needed to find all the hosts that were mounting a certain machine via nfs:
func-command ‘grep phx2-3.storage /proc/mounts’
returned that quickly.
ditto with finding out which systems were mounting it via iscsi.
Now – the objection here is ‘can’t you do this with ssh?’. That’s true except with ssh for many of the commands I would need to:
1. enable ssh as root or sudo first and muck with all that
2. and then parse that all back.
func-command handles that for me.
Also func records all the commands it runs in its audit log:
2011-01-23 22:45:54,966 – 10.1.16.10 puppet1 3550176746 command.run called with (‘grep phx2-3.storage /proc/mounts’,)
Thought it was cool and that I would mention it.