Using a wiki to simplify administration

At work we have an internal wiki (based on mediawiki) that we use for a lot of our internal documentation. When I have my systems administrator hat on, I like to automate day to day administration as much as I can. For example, backup configuration (and monitoring / alerting) and another example is email group maintenance.

Traditionally both these tasks required that a configuration file be edited on the machine in question, which means working out which machine, remembering a login for that machine, remembering where the configuration file is kept and its syntax.

I have started to replace those with wiki pages.

For example, we now have a wiki page that is used to maintain our internal email groups. It uses a very simple syntax (subset of the wiki syntax) to describe each group, which both serves to produce a nicely formatted wiki pages for purposes of documentation and be easily parse-able by a machine (script) that will update the actual email group configuration on the mail server. The wiki page also includes documentation at the top which tells the ordinary (non-sysadmin) users how to edit the email groups on this page, so now anyone can maintain the email groups, or add their own. We put a few restrictions in the script that parses this page, such that a select few email groups were fixed (still maintained on the server not via the wiki) and external email groups still need an administrator to configure our external email service.

Another example was the network wide backup system we use (built around ssh and rdiff-backup) which required that configuration details be available to every machine that uses the backup system. The solution was to store the global configuration in our internal wiki. The backup scripts, after auto-updating themselves from subversion, pull the configuration from the backup configuration wiki page. Again, the format is simple, so easy to parse and maintain. We make a simple edit to a wiki page and its instantly available to all the backup scripts. We could have used a database for this, but wget (the means by which we pull information from the wiki) is simpler to use.

Note that we use the ?action=render or ?action=raw query option when pulling the configs from wiki to get a plain text version of the page or page source. In the case of ?action=render we simply use wrap the configuration in pre tags, so it displays in the wiki using a fixed font, and is pulled from the wiki as some plain text with pre tags top/bottom which are easily ignored. For ?action=raw we just look for certain patterns in the output that identifies where a group definition can be found, specifically we look for ^=== (three =’s signs at the beginning of the line) which signals the start of a group definition, a blank line being the end.


About austinfrance

Technical Developer @ RedSky IT / Explorer Software
This entry was posted in Uncategorized. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s