Why is this working on my server, but fails on yours? This kind of question is quite common. After careful checks and side-by-side tests, we may or may not find the difference. The root cause may be a packages conflict, mismatched versions, corrupted files, or something magical.
How we can quickly detect the noticeable differences between two servers?
Let's examine the common differences:
- OS flavor. The OS version may be different. Say, the system may work on Ubuntu 14.04 64-bit, but fails on Ubuntu 12.04 32-bit. The server may have less memory than we expect, etc.
- Software Packages. Missing packages, extra packages installed which cause conflicts, wrong installation versions, etc.
- Libraries. Wrong JDK version, some .jar libraries are missing, etc.
- Config files. Incorrect setting in config files.
Luckily all this information can be discovered by using multiple existing commands. For example, we can get all OS details by probing
/proc filesystem or commands like
free/df/lscpu , etc. All software installed after OS installation can be found like this. Jar libraries usually are placed under the
$CLASSPATH folder, etc.
Apparently it demands a lot of learning and experience to get familiar with all these tools. Furthermore, humans are slow and error-prone.
What if we design a command-line tool to automate the check and compare process?
We need it to:
- Dump detailed information into txt files.
- Categorize different checks into typical scenarios, like OS, Java, Python, etc.
- Diff the generated list by category.
Based on this idea, here comes list_os_packages cli tool in Github.
For better user experience, we can wrap up it as a Jenkins job: CompareMachinesReport.
Like our blog posts? Discuss with us on LinkedIn, Wechat, or NewsLetter.