There are some scripts.

Maybe I'll elaborate some day...

make-nagios-hosts.pl

The following comes from the POD documentation embedded within the script:


NAME

make-nagios-hosts.pl - Use the what_xen database to generate hosts.conf


SYNOPSIS

make-nagios-hosts.pl [-H host] [-d database] [-l login file] configuration


ARGUMENTS

-H host

The host on which the MySQL server containing the what_xen database is running.

-d database

The name of the MySQL database to perform queries in.

-l login file

File containing the authentication information used to connect to the MySQL server. This should contain two lines, the first being a MySQL user, and the second being the user's MySQL password.

configuration

The configuration/template file to base the output on.


CONFIGURATION FORMAT

The configuration file consists of comments and several different types of declarations. It is line oriented, although, for readability purposes, a line break can be ignored by proceding it with a '\' character.

Comments are started with a "##" character sequence. A comment lasts until the end of the next line that does not end with '\' character. Currently, there is no way to include a literal "##" sequence. If this becomes a problem, somebody will need to fix this script.

Declarations must start in the first column of the configuration file. Any extra whitespace between declaration parameters is generally ignored. The following declarations are possible:

# arbitrary text

This line will be copied verbatim to an area at the beginning of the generated output file.

@ hostname

This directive specifies the name of the Xen DomU on which Nagios runs.

  • + hostname

    Indicates that hostname is a Xen Dom0, even if it isn't found in the machines table of the database. The machine will be added to generated output file.

  • + hostname

    Indicates that hostname is an extra, non-Xen machine that should be added to the generated output file.

    - hostname

    Indicates that hostname should not be included in the generated output file. If the machine is a Xen Dom0, none of the Xen DomUs running on it will be included either.

    ! nagios-directive arbitrary value

    Sets the default value for nagios-directive. All generated Nagios host stanzas will set the specified value for the nagios-directive, unless there is a machine-specific override.

    hostname ! nagios-directive arbitrary value

    Sets a machine-specific override for nagios-directive. The specified machine's Nagios host stanza will set the specified value for nagios-directive, instead of any default value given with a plain "!" declaration. If "#" is given instead of a Nagios directive, all text after the "#" will be included verbatim in a comment at the top of the machine's Nagios host stanza.


    AUTHOR

    This document and its corresponding perl script were written by Keith Bare. If the script breaks, he's probably the person most likely able to fix it.


    CategoryServices CategoryClubServices

    Services/What Xen (last edited 2013-10-27 04:28:50 by scgruber@CLUB.CC.CMU.EDU)