7

What is the best way to compare the OS configuration of two (or more) RHEL 5.X servers? Are there any tools/packages available to do this? Note, I am mostly looking for tunables OS (kernel parameters, etc).

I would like to add the reason why we are looking to do this:

  1. We have a large zLinux footprint and would like to compare our 'standard build' to that of a distro provided by a vendor. zLinux is somewhat a specialized architecture and often has different recommended settings than that of x86_64.

  2. If we have a highly available cluster of servers, to compare/ensure that the OS configurations are consistent between them.

Note: I'm not looking for a centralized solution like puppet or chef. I agree these are the optimal solutions are definitely on the roadmap, but not what I'm looking for right now :)

Patrick
  • 81
  • 1
  • 2
  • 7

5 Answers5

1

It's not completely comprehensive, but rpm can provide a good start. You can get the list of installed packages:

rpm -qa > pkgs.txt

Using standard UNIX tools such as wc and cmp, you can tell which packages are / are not on the two machines.

After that, you can use the --verify option to see if any of the configuration files are different:

rpm --verify cat pkgs.txt

See the rpm man page for information on the information reported by the --verify flag.

Tony Miller
  • 111
  • 4
  • Thanks for your answer! We are not worried so much about packages (although that is certainly important), we are more concerned with the tunables in this specialized environment. – Patrick Jul 12 '11 at 13:55
1

The best way is a centralized solution because "the OS configuration" doesn't exist. Linux doesn't know a registry so the config is spread all over the file system. That makes it pretty hard to do what you want.

That said, you can simply copy the directory /etc of all servers into one place and then compare them with diff -uNr

That should give you 90% of the config but you will also get lots of false negatives.

Aaron Digulla
  • 974
  • 3
  • 15
  • 25
  • I agree. Centralized is the best solution. But, in this case, we do have a 'standard build' so we do have something to compare. – Patrick Jul 12 '11 at 13:53
1

Mount the OS root partitions in /mnt/osA and /mnt/osB

diff -rq /mnt/osA /mnt/osB would give you some output similar to Solaris' lucompare

You could then diff the more concerning files closely, like sysctl.conf, httpd.conf, etc.

And how could I forget Blueprint! With Blueprint you can run against a system and get a recipe of what has changed from the default install.

Jodie C
  • 743
  • 6
  • 9
0

Unless your programs and tools adhere to the suggested directory layout and all configuration ends up in /etc, then there is no easy way to "diff" your OS installs.

opyate
  • 101
  • 2
0

sysctl may be your friend. Something along the lines of:

for host in foo.example.com bar.example.com ; do
  ssh root@$host sysctl -a > $host.conf
done

And then you diff. :)

Bittrance
  • 3,070
  • 3
  • 24
  • 27