watch-workers.applescript 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. set broker to "h8.opera.com"
  2. set workers to {"h6.opera.com", "h8.opera.com", "h9.opera.com", "h10.opera.com"}
  3. set clock to "h6.opera.com"
  4. tell application "iTerm"
  5. activate
  6. set myterm to (make new terminal)
  7. tell myterm
  8. set number of columns to 80
  9. set number of rows to 50
  10. repeat with workerhost in workers
  11. set worker to (make new session at the end of sessions)
  12. tell worker
  13. set name to workerhost
  14. set foreground color to "white"
  15. set background color to "black"
  16. set transparency to 0.1
  17. exec command "/bin/sh -i"
  18. write text "ssh root@" & workerhost & " 'tail -f /var/log/celeryd.log'"
  19. end tell
  20. end repeat
  21. set celerybeat to (make new session at the end of sessions)
  22. tell celerybeat
  23. set name to "celerybeat.log"
  24. set foreground color to "white"
  25. set background color to "black"
  26. set transparency to 0.1
  27. exec command "/bin/sh -i"
  28. write text "ssh root@" & clock & " 'tail -f /var/log/celerybeat.log'"
  29. end tell
  30. set rabbit to (make new session at the end of sessions)
  31. tell rabbit
  32. set name to "rabbit.log"
  33. set foreground color to "white"
  34. set background color to "black"
  35. set transparency to 0.1
  36. exec command "/bin/sh -i"
  37. write text "ssh root@" & broker & " 'tail -f /var/log/rabbitmq/rabbit.log'"
  38. end tell
  39. tell the first session
  40. activate
  41. end tell
  42. end tell
  43. end tell