sampledoc

motd

The following template automatically generates a MOTD (message of the day) file that describes the system in terms of its Bcfg2 metadata and probe responses. It conditionally displays groups, categories, and probe responses, if there exists any data for them.

Cfg/etc/motd/motd.genshi

------------------------------------------------------------------------
                    GOALS FOR SERVER MANGED BY BCFG2
------------------------------------------------------------------------
Hostname is ${metadata.hostname}

Groups:
{% for group in metadata.groups %}\
 * ${group}
{% end %}\

{% if metadata.categories %}\
Categories:
{% for category in metadata.categories %}\
 * ${category}
{% end %}\
{% end %}\


{% if metadata.Probes %}\
Probes:
{% for probe, value in metadata.Probes.iteritems() %}\
 * ${probe} \
   ${value}
{% end %}\
{% end %}\

-------------------------------------------------------------------------
                        ITOPS MOTD
-------------------------------------------------------------------------
Please create a Ticket for any system level changes you need from IT.

This template gets the hostname, groups membership of the host, categories of the host (if any), and result of probes on the host (if any). The template formats this in with a header and footer that makes it visually more appealing.

Output

One possible output of this template would be the following:

------------------------------------------------------------------------
                    GOALS FOR SERVER MANGED BY BCFG2
------------------------------------------------------------------------
Hostname is cobra.example.com

Groups:
 * oracle-server
 * centos5-5.2
 * centos5
 * redhat
 * x86_64
 * sys-vmware

Categories:
 * os-variant
 * os
 * database-server
 * os-version


Probes:
 * arch    x86_64
 * network    intranet_network
 * diskspace    Filesystem            Size  Used Avail Use% Mounted on
/dev/mapper/VolGroup00-LogVol00
                       18G  2.1G   15G  13% /
/dev/sda1              99M   13M   82M  13% /boot
tmpfs                 3.8G     0  3.8G   0% /dev/shm
/dev/mapper/mhcdbo-clear
                      1.5T  198M  1.5T   1% /mnt/san-oracle
 * virtual    vmware

-------------------------------------------------------------------------
                        IT MOTD
-------------------------------------------------------------------------
Please create a Ticket for any system level changes you need from IT.

One way to make this even more useful, is to only include the result of certain probes. It would also be a nice feature to be able to include customer messages on a host or group level.

Table Of Contents

Previous topic

iptables

Next topic

my.cnf

This Page