Vladimir Melnik

Just another WordPress website

How to run commands on different servers with different login credentials

Wouldn’t it be lovely if you could run some command on a bunch of servers?

Of course, you can! Most of us would do something like that:

But what if there are dozens of servers with different usernames to log-in with, different SSH-keys to use and even different ports to connect to? It would be quite convenient to use some conficuration file with all these login-details:

And here goes the script:

Now you can do something like that:

If I ever update this script with some new features, you could always get the latest verion from GitHub: https://gist.github.com/melnik13/be1160a5bf73e246cd5f.

Enjoy your great power, but don’t forget about great responsibility comes with it! 🙂

How to monitor which files are growing faster than other ones?

If you ever needed a tool to get to know which files are growing faster than other ones, you probably will be quite satisfied with this simple bash-script.

Simply put it to your crontab:

Resulting reports will be put to /var/spool/diskhogs/report_*. You also can generate any reports by yourself, just use sqlite:

This query will generate the report for all files in the /var/lib/libvirt/images directory for the last 10 days.

If there are any updates, you could get them from GitHub: https://gist.github.com/melnik13/7ad33c57aa33742b9854.

Happy monitoring! 🙂