diff options
author | Joey Hagedorn <hagedorn@mcs.anl.gov> | 2005-12-19 22:54:25 +0000 |
---|---|---|
committer | Joey Hagedorn <hagedorn@mcs.anl.gov> | 2005-12-19 22:54:25 +0000 |
commit | d4469be76426ccedba2bdd591ee38b5742266a21 (patch) | |
tree | 7b782ccd047d30a654541736aae6f8cb00cd4a73 /reports/xsl-transforms/nodes-digest-mail.xsl | |
parent | 5b7caaeb85b8600550d49cc51ce556c61e88ac2f (diff) | |
download | bcfg2-d4469be76426ccedba2bdd591ee38b5742266a21.tar.gz bcfg2-d4469be76426ccedba2bdd591ee38b5742266a21.tar.bz2 bcfg2-d4469be76426ccedba2bdd591ee38b5742266a21.zip |
Modified StatReports to implement new naming convention for xsl-transforms and reports.
Xsl files can be arbitrarily added by user as long as they adhere to naming convention:
<delivery-type>-<delivery mechanism>.xsl
git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@1631 ce84e21b-d406-0410-9b95-82705330c041
Diffstat (limited to 'reports/xsl-transforms/nodes-digest-mail.xsl')
-rw-r--r-- | reports/xsl-transforms/nodes-digest-mail.xsl | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/reports/xsl-transforms/nodes-digest-mail.xsl b/reports/xsl-transforms/nodes-digest-mail.xsl new file mode 100644 index 000000000..2aeea1ed4 --- /dev/null +++ b/reports/xsl-transforms/nodes-digest-mail.xsl @@ -0,0 +1,47 @@ +<?xml version="1.0"?> +<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" xmlns="http://www.w3.org/1999/xhtml"> + <xsl:include href="xsl-transform-includes/text-templates.xsl" /> + <xsl:output method="text" indent="no" media-type="text/plain" /> + <xsl:template match="Report"> + <xsl:choose> + <xsl:when test="count(/Report/Node/Statistics/Bad) > 0">Subject: BCFG Nightly Errors (<xsl:value-of select="@name" />) + </xsl:when> + <xsl:otherwise>Subject: BCFG Nightly Good (<xsl:value-of select="@name" />) + </xsl:otherwise> +</xsl:choose> +<xsl:text> +</xsl:text>Report Run @ <xsl:value-of select="@time" /> + +SUMMARY: +<xsl:text> </xsl:text> +<xsl:value-of select="count(/Report/Node)" /> nodes were included in your report.<xsl:text> +</xsl:text> +<xsl:if test="count(/Report/Node)-count(/Report/Node/Statistics/Good) = 0"> + <xsl:text> </xsl:text>All machines are configured to specification. +</xsl:if><xsl:if test="count(/Report/Node/Statistics/Good) > 0"> +<xsl:text> </xsl:text> +<xsl:value-of select="count(/Report/Node/Statistics/Good)" /> nodes are clean. +</xsl:if> +<xsl:if test="count(/Report/Node/Statistics/Bad) > 0"> + <xsl:text> </xsl:text> + <xsl:value-of select="count(/Report/Node/Statistics/Bad)" /> nodes are bad. +</xsl:if> +<xsl:if test="count(/Report/Node/Statistics/Extra) > 0"> + <xsl:text> </xsl:text> + <xsl:value-of select="count(/Report/Node/Statistics/Extra)" /> nodes contain extra configuration. (includes both good and bad nodes) +</xsl:if> +<xsl:if test="count(/Report/Node/Statistics/Modified) > 0"> + <xsl:text> </xsl:text> + <xsl:value-of select="count(/Report/Node/Statistics/Modified)" /> nodes were modified in the last run. (includes both good and bad nodes) +</xsl:if> +<xsl:if test="count(/Report/Node/Statistics/Stale) > 0"> + <xsl:text> </xsl:text> + <xsl:value-of select="count(/Report/Node/Statistics/Stale)" /> nodes did not run within the last 24 hours. +</xsl:if> +DETAILS: +<xsl:apply-templates select="Node"> + <xsl:sort select="Statistics/@state" order="descending"/> + <xsl:sort select="@name"/> +</xsl:apply-templates> +</xsl:template> +</xsl:stylesheet>
\ No newline at end of file |