diff options
Diffstat (limited to 'doc/server/plugins/generators/examples/genshi/motd.txt')
-rw-r--r-- | doc/server/plugins/generators/examples/genshi/motd.txt | 98 |
1 files changed, 98 insertions, 0 deletions
diff --git a/doc/server/plugins/generators/examples/genshi/motd.txt b/doc/server/plugins/generators/examples/genshi/motd.txt new file mode 100644 index 000000000..6f4a891d1 --- /dev/null +++ b/doc/server/plugins/generators/examples/genshi/motd.txt @@ -0,0 +1,98 @@ +.. -*- mode: rst -*- + +====== + 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 +======================== + +.. code-block:: none + + ------------------------------------------------------------------------ + 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. |