12

I have about 20 linux servers which I need to document the configuration of. I do not mean the detailed configuration of services, but rather user accounts, databases, databases accounts, ip addresses, physical location, SSH port etc. etc. I know all this data is stored in config files, but I want to centralize it all. I am considering just creating a spreadsheet to record this data, but was wondering if there is something better (perhaps a small php/mysql app) which would be more structured and complete than a hacked together spreadsheet.

What do you use?

wzzrd
  • 10,269
  • 2
  • 32
  • 47
Michelle
  • 913
  • 5
  • 20
  • 30
  • I hadn't thought to much about this before but it would be useful. The spreadsheet approach is probably not ideal. It's easy to get it out of date. Automated has to be the way to go. – hookenz Jun 13 '10 at 21:48

7 Answers7

9

I assume this is a long term documentation effort, not just trying to capture a snapshot of the current configuration.

The wiki works now and might keep you sane for a while but if your environment changes quickly you will have a serious problem. You will always have to make sure the cron jobs are properly written, run in a timely fashion, get written for new services, are compatible with new versions of software, etc.

Consider using an configuration management tool like Puppet or Cfengine. At least put whatever data you collect under version control (like Mercurial, git, or Subversion).

Your configuration data is coming in from everywhere instead of being centralized. A wiki will always lag the current state of your machines. You need to centralize the configuration data; make it flow from the center out to the edges. But it is true that sometimes you have to go out and capture configuration data. Cfengine can do audits, Puppet might. Look at this Wikipedia article listing other configuration managers.

Allen
  • 1,315
  • 7
  • 12
4

You might want to try cfg2html, which dumps your configuration to an HTML file, which you can then fetch at regular intervals and serve from a central server.

wzzrd
  • 10,269
  • 2
  • 32
  • 47
4

Next time you tweak a machine, you should install etckeeper on it first. That way you will keep a log of configuration changes.

What distro are you using? There are some quite convenient tools for managing and auditing conffiles, and they generally depend on the package manager.

Tobu
  • 4,367
  • 1
  • 23
  • 31
2

My suggestion would be just to build a wiki to centralize information and get a script to edit pages so that configuration files are updated on the wiki automatically through a cron job.

If you use moin, you should check http://moinmo.in/ScriptMarket/PutPageScript .

This way you get:

  1. Centralized documentation.

  2. Up-to-date system configuration.

  3. History of configuration changes.

jneves
  • 1,043
  • 6
  • 15
  • I like this solution, very flexible. It would be nice if there were already some scripts available to update the wiki. – Michelle Jun 13 '10 at 09:47
1

A spreadsheet is basically a two-dimension grid. I consider it not to be the best data structure for such things. I prefer trees, so I use outliners to manage trees.

My favourite one is leo. If you want something that would work on a server that has no X, have a look at htb (seems to be abandoned), or at VOoM vim plugin.

All these tools use plain text files or XML as backend. Teamed with some version control, they make a powerful combination.

Another alternative would be fossil. It is a distributed version control tool with built-in wiki and ticket tracker. It's a single binary which can also work as CGI and serve a web interface, thus making it available over network. fossil as a mini-CMS for a website is very powerful.

halp
  • 2,098
  • 1
  • 19
  • 13
0

One approach is to start with a configuration file that reads well enough to be transformed into a running configuration or documentation. This is an example of how I manage PostgreSQL instances:

# writer   : The master where connections are enabled
# queryN   : Standby servers

databases:
  localharvestdb:
    role_assignment:
      writer: 172.16.0.3
      query: 172.16.0.2
    major_version: 11
    comments: |
      The master uses a replication slot that must be created manually

  pgprobe:
    role_assignment:
      writer: 172.16.0.5
    major_version: 12
     

Then write a script that can read this data and emit system configuration and another script that can format some summary documentation.

Two projects that allow you to build your own configuration from scripts are

eradman
  • 150
  • 4
0

We have 4 data centers in 3 countries. We have over 500 production servers. Like some ppl said above, we use wiki and attach spreadsheet files on wiki. The good thing about that is, when you update your spreadsheet and attach it back on your wiki, it keeps the history of that. Like who updated the file and when.

But we also lock down our wiki, users can't see almost any page unless they are logged in. Also, the page where spreadsheet file is installed is controlled using tags which uses accesscontrol extensions.

-N

Nikolas Sakic
  • 492
  • 2
  • 8