Nagios config -- not xml?

Ian Stokes-Rees i.stokes-rees1 at physics.ox.ac.uk
Mon Jan 27 11:33:32 CET 2003


Very interesting that this XML debate has come up.  I spent several days
last week re-writing some of my core Nagios config files in XML then using
XSLT to transform them into the current Nagios format.

What does XML buy you?

1. Ability to write a schema to check that you have your syntax correct.
(OK, pre-flight check _probably_ does most of this already, but I'm sure an
XML schema with a schema validating parser would be MUCH easier)

2. Single, standard, format, rather than current split format (i.e. some
files are flat VARIABLE_NAME VALUE format, and some are pseudo object
definitions with "define NAME {...}".

3. Much simpler layout to avoid massive cross-referencing which _does_ do
your head in (this was the reason I started re-writing my configs in XML).

4. Collapse 5 different config files into 1 (OK, maybe 2 if you want to keep
CGI or Resource separate).  Currently there is:

	i) Main nagios.cfg file
	ii) resource.cfg file
	iii) hosts.cfg file (object definitions -- probably pointing to
cfg_file and cfg_dir meaning lots of others files are used as well)
	iv) cgi.cfg
	v) extended config file.

5. Make use of network definitions for other monitoring or maintenance
applications.

Below, you can see an example of my new "hosts" file which describes nodes
in the network I am monitoring.  XML provides a tree structure, but can be
"enhanced" to graphs by using cross references.   Trees are a perfect
starting point for allowing the XML itself to represent the basic network
topology.  Furthermore, if I want a new service, I just add <service
type="SERVICE-NAME" /> to the particular node and, voila, that node now has
that service defined for it.  All the details about the IP address or node
name are "in context" from the XML, and the "generic" service template is
used.  If I want a custom service definition for that node, instead of
having <service type="..."/> I would have

<service name="CUSTOM-SERVICE">
	<!-- Service definition details go in here -->
</service>

Anyway, it seems like there are interested parties in making this happen --
I certainly do not feel that the current configuration system is scalable to
extremely large systems (hundreds nodes) quickly and easily.

Here is a taste of my XML:

    <node name="nagios" group="true">
        <contactgroup>admins</contactgroup>
        <node name="particle-physics-oxford" group="true">
            <node name="clusters">
                <node name="edg-testbed" group="true">
                    <node   name="tbce01" type="linux">
                        <alias>Computing Element 01</alias>
                        <address>163.1.243.105</address>
                        <service type="ping" />
                        <node   name="tbwn01" type="linux">
                            <alias>Worker Node 01</alias>
                            <address>163.1.243.155</address>
                            <service type="ping" />
                        </node>
                    </node>
                    <node   name="tbse01" type="linux">
                        <alias>Storage Element 01</alias>
                        <address>163.1.244.55</address>
                        <service type="ping" />
                    </node>

-- 
Ian Stokes-Rees                     i.stokes-rees at physics.ox.ac.uk
Particle Physics, Oxford            http://www-pnp.physics.ox.ac.uk/~stokes/

> -----Original Message-----
> From: Kurt Werle [mailto:kurt at twoface.shiftmanager.net] 
> Sent: 24 January 2003 20:09
> To: nagios-users at lists.sourceforge.net
> Subject: [Nagios-users] Nagios config -- not xml?
> 
> 
> I've recently installed nagios and really like it.  That 
> said, configuring
> it is a royal pain.  I'm wondering why the config files are the
> traditional unix block style -- it seems like it would be 
> really nice to
> have it in xml.  This would make it much easier to write configuration
> tools.
> 
> Thanks for a great tool,
> Kurt
> ---
> kwerle at pobox.com
> http://www.pobox.com/~kwerle/
> Tired of spam? Control your Mailserver (or .forward)? 
http://tess.sf.net



-------------------------------------------------------
This SF.NET email is sponsored by:
SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See!
http://www.vasoftware.com
_______________________________________________
Nagios-users mailing list
Nagios-users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users


-------------------------------------------------------
This SF.NET email is sponsored by:
SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See!
http://www.vasoftware.com




More information about the Users mailing list