diff options
-rw-r--r-- | reports/xsl-transforms/overview-stats-email.xsl | 28 | ||||
-rw-r--r-- | reports/xsl-transforms/overview-stats-html.xsl | 21 | ||||
-rw-r--r-- | reports/xsl-transforms/overview-stats-rss.xsl | 28 |
3 files changed, 48 insertions, 29 deletions
diff --git a/reports/xsl-transforms/overview-stats-email.xsl b/reports/xsl-transforms/overview-stats-email.xsl index 6a80bfe95..4938cab8b 100644 --- a/reports/xsl-transforms/overview-stats-email.xsl +++ b/reports/xsl-transforms/overview-stats-email.xsl @@ -4,20 +4,26 @@ <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[count(Statistics/Good)>0]"/> +<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[HostInfo/@pingable='N']"/> +<xsl:variable name="pingablenodes" select="/Report/Node[HostInfo/@pingable='Y']"/> Summary: -<xsl:text> </xsl:text><xsl:value-of select="count(/Report/Node/Statistics/Good)" /> nodes are clean. -<xsl:text> </xsl:text><xsl:value-of select="count(/Report/Node/Statistics/Bad)" /> nodes are dirty. -<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:text> </xsl:text><xsl:value-of select="count(/Report/Node/Statistics/Stale)" /> nodes did not run this calendar day. -<xsl:text> </xsl:text><xsl:value-of select="count(/Report/Node/HostInfo[@pingable='N'])" /> nodes were not pingable. +<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 this calendar day 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(/Report/Node/Statistics/Good) > 0"> +<xsl:if test="count($cleannodes) > 0"> CLEAN: <xsl:for-each select="Node"> <xsl:sort select="HostInfo/@fqdn"/> @@ -29,7 +35,7 @@ CLEAN: </xsl:text> </xsl:if> -<xsl:if test="count(/Report/Node/Statistics/Bad) > 0"> +<xsl:if test="count($dirtynodes) > 0"> DIRTY: <xsl:for-each select="Node"> <xsl:sort select="HostInfo/@fqdn"/> @@ -41,7 +47,7 @@ DIRTY: </xsl:text> </xsl:if> -<xsl:if test="count(/Report/Node/Statistics/Modified) > 0"> +<xsl:if test="count($modifiednodes) > 0"> MODIFIED: <xsl:for-each select="Node"> <xsl:sort select="HostInfo/@fqdn"/> @@ -54,11 +60,11 @@ MODIFIED: </xsl:if> -<xsl:if test="count(/Report/Node/Statistics/Stale) > 0"> +<xsl:if test="count($stalenodes[count(.|$pingablenodes)= count($pingablenodes)]) > 0"> STALE: <xsl:for-each select="Node"> <xsl:sort select="HostInfo/@fqdn"/> -<xsl:if test="count(Statistics/Stale) > 0"> +<xsl:if test="count(Statistics/Stale)-count(HostInfo[@pingable='N']) > 0"> <xsl:text> </xsl:text><xsl:value-of select="HostInfo/@fqdn" /><xsl:text> </xsl:text> </xsl:if> @@ -67,7 +73,7 @@ STALE: </xsl:if> -<xsl:if test="count(/Report/Node/HostInfo[@pingable='N']) > 0"> +<xsl:if test="count($unpingablenodes) > 0"> UNPINGABLE: <xsl:for-each select="Node"> <xsl:sort select="HostInfo/@fqdn"/> diff --git a/reports/xsl-transforms/overview-stats-html.xsl b/reports/xsl-transforms/overview-stats-html.xsl index 69087ea82..404f4b5f3 100644 --- a/reports/xsl-transforms/overview-stats-html.xsl +++ b/reports/xsl-transforms/overview-stats-html.xsl @@ -2,6 +2,13 @@ xmlns="http://www.w3.org/1999/xhtml"> <xsl:output method="xml" media-type="text/html" doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN" doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"/> <xsl:template match="Report"> + <xsl:variable name="cleannodes" select="/Report/Node[count(Statistics/Good)>0]"/> + <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[HostInfo/@pingable='N']"/> + <xsl:variable name="pingablenodes" select="/Report/Node[HostInfo/@pingable='Y']"/> + <html> <head> <title><xsl:value-of select="@name" /></title> @@ -17,7 +24,7 @@ <h2>Summary:</h2> <p class="indented"><xsl:value-of select="count(/Report/Node)" /> Nodes were included in your report.</p> - <xsl:if test="count(/Report/Node/Statistics/Good) > 0"> + <xsl:if test="count($cleannodes) > 0"> <div class="clean"> <span class="nodelisttitle"><a href="javascript:toggleLayer('goodsummary');" title="Click to Expand" class="commentLink"><xsl:value-of select="count(/Report/Node/Statistics/Good)" /></a> nodes are clean.<br /></span> <div class="items" id="goodsummary"><ul class="plain"> @@ -32,7 +39,7 @@ </div> </xsl:if> - <xsl:if test="count(/Report/Node/Statistics/Bad) > 0"> + <xsl:if test="count($dirtynodes) > 0"> <div class="bad"> <span class="nodelisttitle"><a href="javascript:toggleLayer('badsummary');" title="Click to Expand" class="commentLink"><xsl:value-of select="count(/Report/Node/Statistics/Bad)" /></a> nodes are bad.<br /></span> @@ -47,7 +54,7 @@ </div> </xsl:if> - <xsl:if test="count(/Report/Node/Statistics/Modified) > 0"> + <xsl:if test="count($modifiednodes) > 0"> <div class="modified"> <span class="nodelisttitle"><a href="javascript:toggleLayer('modifiedsummary');" title="Click to Expand" class="commentLink"><xsl:value-of select="count(/Report/Node/Statistics/Modified)" /></a> nodes were modified in the last run. (includes both good and bad nodes)<br /></span> @@ -62,14 +69,14 @@ </div> </xsl:if> - <xsl:if test="count(/Report/Node/Statistics/Stale) > 0"> + <xsl:if test="count($stalenodes[count(.|$pingablenodes)= count($pingablenodes)]) > 0"> <div class="warning"> - <span class="nodelisttitle"><a href="javascript:toggleLayer('stalesummary');" title="Click to Expand" class="commentLink"><xsl:value-of select="count(/Report/Node/Statistics/Stale)" /></a> nodes did not run this calendar day.<br /></span> + <span class="nodelisttitle"><a href="javascript:toggleLayer('stalesummary');" title="Click to Expand" class="commentLink"><xsl:value-of select="count($stalenodes[count(.|$pingablenodes)= count($pingablenodes)])" /></a> nodes did not run this calendar day but were pingable.<br /></span> <div class="items" id="stalesummary"><ul class="plain"> <xsl:for-each select="Node"> <xsl:sort select="HostInfo/@fqdn"/> - <xsl:if test="count(Statistics/Stale) > 0"> + <xsl:if test="count(Statistics/Stale)-count(HostInfo[@pingable='N']) > 0"> <tt><xsl:value-of select="HostInfo/@fqdn" /></tt><br/> </xsl:if> </xsl:for-each> @@ -79,7 +86,7 @@ - <xsl:if test="count(/Report/Node/HostInfo[@pingable='N']) > 0"> + <xsl:if test="count($unpingablenodes) > 0"> <div class="warning"> <span class="nodelisttitle"><a href="javascript:toggleLayer('unpingablesummary');" title="Click to Expand" class="commentLink"><xsl:value-of select="count(/Report/Node/HostInfo[@pingable='N'])" /></a> nodes were not pingable.<br /></span> diff --git a/reports/xsl-transforms/overview-stats-rss.xsl b/reports/xsl-transforms/overview-stats-rss.xsl index d9aba6a0d..433589b83 100644 --- a/reports/xsl-transforms/overview-stats-rss.xsl +++ b/reports/xsl-transforms/overview-stats-rss.xsl @@ -8,20 +8,26 @@ <title>BCFG Nightly Statistics</title> <description><pre> Report Run @ <xsl:value-of select="@time" /> +<xsl:variable name="cleannodes" select="/Report/Node[count(Statistics/Good)>0]"/> +<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[HostInfo/@pingable='N']"/> +<xsl:variable name="pingablenodes" select="/Report/Node[HostInfo/@pingable='Y']"/> Summary: -<xsl:text> </xsl:text><xsl:value-of select="count(/Report/Node/Statistics/Good)" /> nodes are clean. -<xsl:text> </xsl:text><xsl:value-of select="count(/Report/Node/Statistics/Bad)" /> nodes are dirty. -<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:text> </xsl:text><xsl:value-of select="count(/Report/Node/Statistics/Stale)" /> nodes did not run this calendar day. -<xsl:text> </xsl:text><xsl:value-of select="count(/Report/Node/HostInfo[@pingable='N'])" /> nodes were not pingable. +<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 this calendar day 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(/Report/Node/Statistics/Good) > 0"> +<xsl:if test="count($cleannodes) > 0"> CLEAN: <xsl:for-each select="Node"> <xsl:sort select="HostInfo/@fqdn"/> @@ -33,7 +39,7 @@ CLEAN: </xsl:text> </xsl:if> -<xsl:if test="count(/Report/Node/Statistics/Bad) > 0"> +<xsl:if test="count($dirtynodes) > 0"> DIRTY: <xsl:for-each select="Node"> <xsl:sort select="HostInfo/@fqdn"/> @@ -45,7 +51,7 @@ DIRTY: </xsl:text> </xsl:if> -<xsl:if test="count(/Report/Node/Statistics/Modified) > 0"> +<xsl:if test="count($modifiednodes) > 0"> MODIFIED: <xsl:for-each select="Node"> <xsl:sort select="HostInfo/@fqdn"/> @@ -58,11 +64,11 @@ MODIFIED: </xsl:if> -<xsl:if test="count(/Report/Node/Statistics/Stale) > 0"> +<xsl:if test="count($stalenodes[count(.|$pingablenodes)= count($pingablenodes)]) > 0"> STALE: <xsl:for-each select="Node"> <xsl:sort select="HostInfo/@fqdn"/> -<xsl:if test="count(Statistics/Stale) > 0"> +<xsl:if test="count(Statistics/Stale)-count(HostInfo[@pingable='N']) > 0"> <xsl:text> </xsl:text><xsl:value-of select="HostInfo/@fqdn" /><xsl:text> </xsl:text> </xsl:if> @@ -71,7 +77,7 @@ STALE: </xsl:if> -<xsl:if test="count(/Report/Node/HostInfo[@pingable='N']) > 0"> +<xsl:if test="count($unpingablenodes) > 0"> UNPINGABLE: <xsl:for-each select="Node"> <xsl:sort select="HostInfo/@fqdn"/> |