Skip to content

Instantly share code, notes, and snippets.

@lancelakey
lancelakey / wtflog.sh
Created March 14, 2012 21:34 — forked from flores/wtflog.sh
for sporadic wtfs.
#!/usr/bin/env bash
#
# because sometimes a server sporadically acts funny and we're all like wtf.
# date and -+ separated list of general os, system, and network stuff.
echo -e "#!/usr/bin/env bash\n(date; top -n1; ps axfu; iostat; vmstat; df -h; lsof -n -i; netstat -ano; w; echo -e '\n-----------------\n\n') >> /var/log/wtf.log" > /root/wtf.sh
chmod +x /root/wtf.sh
# put it in the crontab.
echo '* * * * * /root/wtf.sh' >> /var/spool/cron/crontabs/root

This was a bit of a trick to get set up, so here it is for anyone who comes across it in search results.

ZNC User Account

  • Set up the account as usual (note the username and password)
  • Set the defualt buffer size to 0. Every time the bot reconnects after a crash, it would try to respond to the commands it hear or respond in the buffer, and might crash it again.
  • Go ahead and define a network and channel for your bot. Note the network name.
  • You should now see a "ghost" for your hubot connected.
  • Look at the ZNC user list. The hubot user will show 1 network, but 0 clients.