/usr/share/bcfg2/xsl-transforms/overview-stats-mail.xsl is in bcfg2-server 1.2.2-2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 | <?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">Subject: BCFG Nightly Statistics<xsl:text>
</xsl:text>Report Run @ <xsl:value-of select="@time" />
<xsl:variable name="cleannodes" select="/Report/Node[Statistics/@state='clean']"/>
<xsl:variable name="dirtynodes" select="/Report/Node[count(Statistics/Bad)>0]"/>
<xsl:variable name="modifiednodes" select="/Report/Node[count(Statistics/Modified)>0]"/>
<xsl:variable name="stalenodes" select="/Report/Node[count(Statistics/Stale)>0]"/>
<xsl:variable name="unpingablenodes" select="/Report/Node[Client/@pingable='N']"/>
<xsl:variable name="pingablenodes" select="/Report/Node[Client/@pingable='Y']"/>
Summary:
<xsl:text> </xsl:text><xsl:value-of select="count($cleannodes)" /> nodes are clean.
<xsl:text> </xsl:text><xsl:value-of select="count($dirtynodes)" /> nodes are dirty.
<xsl:text> </xsl:text><xsl:value-of select="count($modifiednodes)" /> nodes were modified in the last run. (includes both good and bad nodes)
<xsl:text> </xsl:text><xsl:value-of select="count($stalenodes[count(.|$pingablenodes)= count($pingablenodes)])" /> nodes did not run within the last 24 hours but were pingable.
<xsl:text> </xsl:text><xsl:value-of select="count($unpingablenodes)" /> nodes were not pingable.
<xsl:text> </xsl:text>----------------------------
<xsl:text> </xsl:text><xsl:value-of select="count(/Report/Node)" /> Total<xsl:text>
</xsl:text>
<xsl:if test="count($cleannodes) > 0">
CLEAN:
<xsl:for-each select="Node">
<xsl:sort select="Client/@name"/>
<xsl:if test="count(Statistics/Good) > 0">
<xsl:text> </xsl:text><xsl:value-of select="Client/@name" /><xsl:text>
</xsl:text>
</xsl:if>
</xsl:for-each><xsl:text>
</xsl:text>
</xsl:if>
<xsl:if test="count($dirtynodes) > 0">
DIRTY:
<xsl:for-each select="Node">
<xsl:sort select="Client/@name"/>
<xsl:if test="count(Statistics/Bad) > 0">
<xsl:text> </xsl:text><xsl:value-of select="Client/@name" /><xsl:text>
</xsl:text>
</xsl:if>
</xsl:for-each><xsl:text>
</xsl:text>
</xsl:if>
<xsl:if test="count($modifiednodes) > 0">
MODIFIED:
<xsl:for-each select="Node">
<xsl:sort select="Client/@name"/>
<xsl:if test="count(Statistics/Modified) > 0">
<xsl:text> </xsl:text><xsl:value-of select="Client/@name" /><xsl:text>
</xsl:text>
</xsl:if>
</xsl:for-each><xsl:text>
</xsl:text>
</xsl:if>
<xsl:if test="count($stalenodes[count(.|$pingablenodes)= count($pingablenodes)]) > 0">
STALE:
<xsl:for-each select="Node">
<xsl:sort select="Client/@name"/>
<xsl:if test="count(Statistics/Stale)-count(Client[@pingable='N']) > 0">
<xsl:text> </xsl:text><xsl:value-of select="Client/@name" /><xsl:text>
</xsl:text>
</xsl:if>
</xsl:for-each><xsl:text>
</xsl:text>
</xsl:if>
<xsl:if test="count($unpingablenodes) > 0">
UNPINGABLE:
<xsl:for-each select="Node">
<xsl:sort select="Client/@name"/>
<xsl:if test="count(Client[@pingable='N']) > 0">
<xsl:text> </xsl:text><xsl:value-of select="Client/@name" /><xsl:text>
</xsl:text>
</xsl:if>
</xsl:for-each><xsl:text>
</xsl:text>
</xsl:if>
</xsl:template>
</xsl:stylesheet>
|