Tag Archives: xml

jails2xml ready for review!

Ok, so after som nice flow and a whole lot of code cleanup I think it is actually presentable now.
So without any further ado, get a copy at http://kosmos.ttyv0.se/attachments/download/41/jails2xml.sh , give it a try and please give me some feedback.
There are a couple of things to be added and updated, this is not “finished”. (like splitting config options at the top to a separate file and giving better granularity to the host info added to the xml.)
But I wanted the chance to get feedback as soon as possible and also might not have as much time to work on this as I would like for a while.

Short description:
This script will with its default options run through your /usr/local/etc/ezjail/ directory and add all the set options for each jail to an xml file called jails.xml in the current directory.
It will also add some info about the host system, and the time of creation of the xml.
So far tested successfully on systems running 7.2-R and 8.0-R.

An anonymized sample of a jails.xml with a single jail configured on the host:
<?xml version="1.0" encoding="iso-8859-1"?>
<exec>/bin/sh /etc/rc</exec>
<allinfo>FreeBSD xxx.xxx 8.0-RELEASE-p2 FreeBSD 8.0-RELEASE-p2 #0: Tue Jan  5 16:02:27 UTC 2010     [nohide]root@i386-builder.daemonology.net[/nohide]:/usr/obj/usr/src/sys/GENERIC  i386</allinfo>
<verbose>FreeBSD 8.0-RELEASE-p2 #0: Tue Jan  5 16:02:27 UTC 2010     [nohide]root@i386-builder.daemonology.net[/nohide]:/usr/obj/usr/src/sys/GENERIC </verbose>
<generated>Tue Apr  6 20:02:39 CEST 2010</generated>

And just to make sure I am clear about this. This is for FreeBSD systems running jails via the ezjail administration framework.


work started on some jail stuff

I have been thinking about writing something to htmlize statistics and information about jails for awhile now.
Last night I got caught up in some creative flow and spent best part of the night writing a parser for the ezjail config dir -> xml.
It is ugly, but it works.
But this is pretty weird behaviour since I am enrolled to study at 1.75*normal pace.. -Which means I should have been studiyng or atleast sleeping.

Anyway, the plan is to write a php class that will then parse this xml and some other stats and create the useful output.

Watch this space for more info and eventually code and downloads.