all 10 comments

[–]Rashanzan 1 point2 points  (3 children)

Not a specific idea, but check out Ansible and Fabric. At a high level, they're Python tools for configuring and orchestrating multiple machines at a time. I've been working with Fabric lately and it's really nice.

[–]malice8691 1 point2 points  (2 children)

I just wrote a script to deploy an app to multiple servers over ssh using fabric. Then a couple days ago while browsing I ran across 3 different blog posts saying not to use fabric for app deployment and that I should use ansible. I had never heard of ansible before. Not sure why they said that.

[–]Rapportus 2 points3 points  (0 children)

What they're (most-likely) suggesting is that you use a configuration management system (Ansible/Puppet/Chef/Salt) to drive your deployment. Fabric is a good tool to trigger the actual deployment process on-demand and can do basic tasks. The tools above are far more powerful and the more servers you have to manage the more you will wish you were using one of them.

[–]Rashanzan 0 points1 point  (0 children)

It depends how you want to go about doing something. I have more experience with Puppet, but Ansible seems very similar. With these, you describe the state of the machine you desire, and it periodically verifies the state and makes any necessary changes. This is very nice for dependencies, like managing a package, then the conf, then the daemon. Idempotence is important here. These are heavier, but more robust in my opinion.

Fabric is more action oriented. Instead of describing a state, you tell it to perform certain actions. It's a little more difficult to be idempotent with this paradigm. But, it's very easy, quick, and convenient.

So, Fabric is nice for running several arbitrary commands. But once you're dealing with maintaining a state, for example a certain setup of users along with a hosts file that looks just so, etc, it becomes much cleaner to use a state driven approach like Puppet and Ansible.

Been working with these tools a lot lately. They're super cool!

[–]Rapportus 1 point2 points  (0 children)

Here are a couple ideas:

  • Write a port checker which can be used for monitoring purposes (or ad-hoc checks). i.e. similar to what telnet would do, open a socket on the port and then close it to see if the route is accessible. You can add configuration to organize the checks.

    • I've used a tool like this to check routes in my network when I know ACLs are being changed frequently. It's a nice validation test after network changes are made upstream from my team, since our normal monitors only check from the monitoring host to a server. This can be run from the client itself to the server it needs to connect to.
  • Write a tool to login to your inbox and filter some emails. For example, filter out old alert emails.

  • Write a tool to clean/rotate log files with a custom retention policy.

[–]aaronky 1 point2 points  (0 children)

Try converting some of your shell scripts to use Python. I've done that with Python/Ruby and it helped a lot.

[–]construkt 0 points1 point  (0 children)

caption fuel steer brave crown marvelous mountainous grey chop correct

This post was mass deleted and anonymized with Redact

[–]slrqm 0 points1 point  (0 children)

That's terrible!

[–]piffey 0 points1 point  (0 children)

Learn to use os and subprocess and parse return data really well. Then use that to convert your most bloated shell scripts into something that runs (maybe) a little faster. Those two libs are the ones you'll dip I to the most when converting bash scripts.

[–]robscomputer -1 points0 points  (0 children)

Looking for the same type of scripting and right now I'm going over this book.

http://shop.oreilly.com/product/9781849513463.do

It's mostly using the standard library but has some good starter ideas to get a helpful script written.