diff options
-rw-r--r-- | reports/xsl-transforms/nodes-digest-www.xsl | 40 | ||||
-rw-r--r-- | reports/xsl-transforms/overview-stats-rss.xsl | 28 | ||||
-rw-r--r-- | reports/xsl-transforms/timing-summary-www.xsl | 4 | ||||
-rw-r--r-- | reports/xsl-transforms/xsl-transform-includes/html-templates.xsl | 4 | ||||
-rw-r--r-- | reports/xsl-transforms/xsl-transform-includes/text-templates.xsl | 2 | ||||
-rw-r--r-- | src/sbin/GenerateHostInfo | 20 | ||||
-rw-r--r-- | src/sbin/StatReports | 15 |
7 files changed, 57 insertions, 56 deletions
diff --git a/reports/xsl-transforms/nodes-digest-www.xsl b/reports/xsl-transforms/nodes-digest-www.xsl index 9585738c9..95026120f 100644 --- a/reports/xsl-transforms/nodes-digest-www.xsl +++ b/reports/xsl-transforms/nodes-digest-www.xsl @@ -10,8 +10,8 @@ <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']"/> + <xsl:variable name="unpingablenodes" select="/Report/Node[Client/@pingable='N']"/> + <xsl:variable name="pingablenodes" select="/Report/Node[Client/@pingable='Y']"/> <html> <head> @@ -48,10 +48,10 @@ <div class="items" id="goodsummary"><ul class="plain"> <xsl:for-each select="Node"> - <xsl:sort select="HostInfo/@fqdn"/> + <xsl:sort select="Client/@name"/> <xsl:if test="count(Statistics/Good) > 0"> <li><b>Node: </b> - <tt><a href="#{HostInfo/@fqdn}"><xsl:value-of select="HostInfo/@fqdn" /></a></tt></li> + <tt><a href="#{Client/@name}"><xsl:value-of select="Client/@name" /></a></tt></li> </xsl:if> </xsl:for-each> </ul></div> @@ -64,10 +64,10 @@ <div class="items" id="badsummary"><ul class="plain"> <xsl:for-each select="Node"> - <xsl:sort select="HostInfo/@fqdn"/> + <xsl:sort select="Client/@name"/> <xsl:if test="count(Statistics/Bad) > 0"> <li><b>Node: </b> - <tt><a href="#{HostInfo/@fqdn}"><xsl:value-of select="HostInfo/@fqdn" /></a></tt></li> + <tt><a href="#{Client/@name}"><xsl:value-of select="Client/@name" /></a></tt></li> </xsl:if> </xsl:for-each> </ul></div> @@ -79,10 +79,10 @@ <span class="nodelisttitle"><a href="javascript:toggleLayer('extrasummary');" title="Click to Expand" class="commentLink"><xsl:value-of select="count(/Report/Node/Statistics/Extra)" /></a> nodes have extra configuration. (includes both good and bad nodes)<br /></span> <div class="items" id="extrasummary"><ul class="plain"> <xsl:for-each select="Node"> - <xsl:sort select="HostInfo/@fqdn"/> + <xsl:sort select="Client/@name"/> <xsl:if test="count(Statistics/Extra) > 0"> <li><b>Node: </b> - <tt><a href="#{HostInfo/@fqdn}"><xsl:value-of select="HostInfo/@fqdn" /></a></tt></li> + <tt><a href="#{Client/@name}"><xsl:value-of select="Client/@name" /></a></tt></li> </xsl:if> </xsl:for-each> </ul></div> @@ -96,10 +96,10 @@ <div class="items" id="modifiedsummary"><ul class="plain"> <xsl:for-each select="Node"> - <xsl:sort select="HostInfo/@fqdn"/> + <xsl:sort select="Client/@name"/> <xsl:if test="count(Statistics/Modified) > 0"> <li><b>Node: </b> - <tt><a href="#{HostInfo/@fqdn}"><xsl:value-of select="HostInfo/@fqdn" /></a></tt></li> + <tt><a href="#{Client/@name}"><xsl:value-of select="Client/@name" /></a></tt></li> </xsl:if> </xsl:for-each> </ul></div> @@ -111,10 +111,10 @@ <span class="nodelisttitle"><a href="javascript:toggleLayer('vstalesummary');" title="Click to Expand" class="commentLink"><xsl:value-of select="count($stalenodes[count(.|$pingablenodes)= count($pingablenodes)])" /></a> nodes did not run within the last 24 hours but were pingable.<br /></span> <div class="items" id="vstalesummary"><ul class="plain"> <xsl:for-each select="Node"> - <xsl:sort select="HostInfo/@fqdn"/> - <xsl:if test="count(Statistics/Stale)-count(HostInfo[@pingable='N']) > 0"> + <xsl:sort select="Client/@name"/> + <xsl:if test="count(Statistics/Stale)-count(Client[@pingable='N']) > 0"> <li><b>Node: </b> - <tt><a href="#{HostInfo/@fqdn}"><xsl:value-of select="HostInfo/@fqdn" /></a></tt></li> + <tt><a href="#{Client/@name}"><xsl:value-of select="Client/@name" /></a></tt></li> </xsl:if> </xsl:for-each> </ul></div> @@ -127,10 +127,10 @@ <div class="items" id="stalesummary"><ul class="plain"> <xsl:for-each select="Node"> - <xsl:sort select="HostInfo/@fqdn"/> + <xsl:sort select="Client/@name"/> <xsl:if test="count(Statistics/Stale) > 0"> <li><b>Node: </b> - <tt><a href="#{HostInfo/@fqdn}"><xsl:value-of select="HostInfo/@fqdn" /></a></tt></li> + <tt><a href="#{Client/@name}"><xsl:value-of select="Client/@name" /></a></tt></li> </xsl:if> </xsl:for-each> </ul></div> @@ -138,16 +138,16 @@ </div> </xsl:if> - <xsl:if test="count(/Report/Node[HostInfo/@pingable='N']) > 0"> + <xsl:if test="count(/Report/Node[Client/@pingable='N']) > 0"> <div class="down"> - <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 down.<br /></span> + <span class="nodelisttitle"><a href="javascript:toggleLayer('unpingablesummary');" title="Click to Expand" class="commentLink"><xsl:value-of select="count(/Report/Node/Client[@pingable='N'])" /></a> nodes were down.<br /></span> <div class="items" id="unpingablesummary"><ul class="plain"> <xsl:for-each select="Node"> - <xsl:sort select="HostInfo/@fqdn"/> - <xsl:if test="count(HostInfo[@pingable='N']) > 0"> + <xsl:sort select="Client/@name"/> + <xsl:if test="count(Client[@pingable='N']) > 0"> <li><b>Node: </b> - <tt><a href="#{HostInfo/@fqdn}"><xsl:value-of select="HostInfo/@fqdn" /></a></tt></li> + <tt><a href="#{Client/@name}"><xsl:value-of select="Client/@name" /></a></tt></li> </xsl:if> </xsl:for-each> </ul></div> diff --git a/reports/xsl-transforms/overview-stats-rss.xsl b/reports/xsl-transforms/overview-stats-rss.xsl index c4c689a99..1df5e29cf 100644 --- a/reports/xsl-transforms/overview-stats-rss.xsl +++ b/reports/xsl-transforms/overview-stats-rss.xsl @@ -12,8 +12,8 @@ Report Run @ <xsl:value-of select="@time" /> <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']"/> +<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. @@ -30,9 +30,9 @@ Summary: <xsl:if test="count($cleannodes) > 0"> CLEAN: <xsl:for-each select="Node"> -<xsl:sort select="HostInfo/@fqdn"/> +<xsl:sort select="Client/@name"/> <xsl:if test="count(Statistics/Good) > 0"> -<xsl:text> </xsl:text><xsl:value-of select="HostInfo/@fqdn" /><xsl:text> +<xsl:text> </xsl:text><xsl:value-of select="Client/@name" /><xsl:text> </xsl:text> </xsl:if> </xsl:for-each><xsl:text> @@ -42,9 +42,9 @@ CLEAN: <xsl:if test="count($dirtynodes) > 0"> DIRTY: <xsl:for-each select="Node"> -<xsl:sort select="HostInfo/@fqdn"/> +<xsl:sort select="Client/@name"/> <xsl:if test="count(Statistics/Bad) > 0"> -<xsl:text> </xsl:text><xsl:value-of select="HostInfo/@fqdn" /><xsl:text> +<xsl:text> </xsl:text><xsl:value-of select="Client/@name" /><xsl:text> </xsl:text> </xsl:if> </xsl:for-each><xsl:text> @@ -54,9 +54,9 @@ DIRTY: <xsl:if test="count($modifiednodes) > 0"> MODIFIED: <xsl:for-each select="Node"> -<xsl:sort select="HostInfo/@fqdn"/> +<xsl:sort select="Client/@name"/> <xsl:if test="count(Statistics/Modified) > 0"> -<xsl:text> </xsl:text><xsl:value-of select="HostInfo/@fqdn" /><xsl:text> +<xsl:text> </xsl:text><xsl:value-of select="Client/@name" /><xsl:text> </xsl:text> </xsl:if> </xsl:for-each><xsl:text> @@ -67,9 +67,9 @@ MODIFIED: <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)-count(HostInfo[@pingable='N']) > 0"> -<xsl:text> </xsl:text><xsl:value-of select="HostInfo/@fqdn" /><xsl:text> +<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> @@ -80,9 +80,9 @@ STALE: <xsl:if test="count($unpingablenodes) > 0"> UNPINGABLE: <xsl:for-each select="Node"> -<xsl:sort select="HostInfo/@fqdn"/> -<xsl:if test="count(HostInfo[@pingable='N']) > 0"> -<xsl:text> </xsl:text><xsl:value-of select="HostInfo/@fqdn" /><xsl:text> +<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> diff --git a/reports/xsl-transforms/timing-summary-www.xsl b/reports/xsl-transforms/timing-summary-www.xsl index 838995243..2b8b94699 100644 --- a/reports/xsl-transforms/timing-summary-www.xsl +++ b/reports/xsl-transforms/timing-summary-www.xsl @@ -36,7 +36,7 @@ <th class="sortable">Total</th> </tr> <xsl:apply-templates select="Node"> - <xsl:sort select="HostInfo/@fqdn" order="ascending"/> + <xsl:sort select="Client/@name" order="ascending"/> <xsl:sort select="@name"/> </xsl:apply-templates> </table> @@ -54,7 +54,7 @@ <xsl:template match="Node"> <xsl:if test="count(Statistics/OpStamps) > 0"> <tr> - <td class="sortable"><xsl:value-of select="HostInfo/@fqdn" /></td><!--node name--> + <td class="sortable"><xsl:value-of select="Client/@name" /></td><!--node name--> <td class="sortable"><xsl:value-of select="format-number(number(Statistics/OpStamps/@config_parse - Statistics/OpStamps/@config_download),'#.##')"/></td><!--parse--> <td class="sortable"><xsl:value-of select="format-number(number(Statistics/OpStamps/@probe_upload - Statistics/OpStamps/@start),'#.##')"/></td><!--probe download--> <td class="sortable"><xsl:value-of select="format-number(number(Statistics/OpStamps/@inventory - Statistics/OpStamps/@initialization),'#.##')"/></td><!--inventory--> diff --git a/reports/xsl-transforms/xsl-transform-includes/html-templates.xsl b/reports/xsl-transforms/xsl-transform-includes/html-templates.xsl index 45f85c592..7e9e08055 100644 --- a/reports/xsl-transforms/xsl-transform-includes/html-templates.xsl +++ b/reports/xsl-transforms/xsl-transform-includes/html-templates.xsl @@ -3,10 +3,10 @@ <xsl:template match="Node"> <xsl:if test="count(Statistics/Good)+count(Statistics/Bad)+count(Statistics/Extra)+count(Statistics/Modified)+count(Statistics/Stale) > 0"> - <div class="nodebox" name="{HostInfo/@fqdn}"> + <div class="nodebox" name="{Client/@name}"> <span class="notebox">Time Ran: <xsl:value-of select="Statistics/@time" /></span> <span class="configbox">(<xsl:value-of select="Client/@profile" />)</span> - <h2>Node: <span class="nodename"><xsl:value-of select="HostInfo/@fqdn" /></span></h2> + <h2>Node: <span class="nodename"><xsl:value-of select="Client/@name" /></span></h2> <xsl:apply-templates select="Statistics" /> </div> </xsl:if> diff --git a/reports/xsl-transforms/xsl-transform-includes/text-templates.xsl b/reports/xsl-transforms/xsl-transform-includes/text-templates.xsl index c346b8bec..8b820415b 100644 --- a/reports/xsl-transforms/xsl-transform-includes/text-templates.xsl +++ b/reports/xsl-transforms/xsl-transform-includes/text-templates.xsl @@ -5,7 +5,7 @@ <xsl:text> - </xsl:text>Node:<xsl:value-of select="HostInfo/@fqdn" /><xsl:text> + </xsl:text>Node:<xsl:value-of select="Client/@name" /><xsl:text> </xsl:text>Time Ran: <xsl:value-of select="Statistics/@time" />.<xsl:text> </xsl:text>(<xsl:value-of select="Client/@profile" />) <xsl:apply-templates select="Statistics" /> diff --git a/src/sbin/GenerateHostInfo b/src/sbin/GenerateHostInfo index 04d257e8a..e6d166877 100644 --- a/src/sbin/GenerateHostInfo +++ b/src/sbin/GenerateHostInfo @@ -31,14 +31,14 @@ if __name__ == '__main__': c = ConfigParser() c.read(['/etc/bcfg2.conf']) configpath = "%s/etc/report-configuration.xml" % c.get('server', 'repository') - hostinfopath = "%s/etc/hostinfo.xml" % c.get('server', 'repository') - metadatapath = "%s/etc/metadata.xml" % c.get('server', 'repository') + #hostinfopath = "%s/etc/hostinfo.xml" % c.get('server', 'repository') + clientdatapath = "%s/Metadata/clients.xml" % c.get('server', 'repository') sendmailpath = c.get('statistics','sendmailpath') - metaElement = parse(metadatapath) - hostlist = [client.get('name') for client in metaElement.findall("Client")] + clientElement = parse(clientdatapath) + hostlist = [client.get('name') for client in clientElement.findall("Client")] - HostInfo = Element("HostInformation") + #HostInfo = Element("HostInformation") pids = {} fullnames = {} null = open('/dev/null', 'w+') @@ -60,17 +60,19 @@ if __name__ == '__main__': chost = pids[cpid] del pids[cpid] if status == 0: - SubElement(HostInfo, "HostInfo", name=chost, fqdn=chost, pingable='Y') + #SubElement(HostInfo, "HostInfo", name=chost, fqdn=chost, pingable='Y') + clientElement.xpath("/Clients/Client[@name=%s]"%chost).set("pingable",'Y') else: if chost.count('.') > 0: fullnames[chost.split('.')[0]] = chost hostlist.append(chost.split('.')[0]) else: - SubElement(HostInfo, "HostInfo", name=fullnames[chost], fqdn=fullnames[chost], pingable='N') + #SubElement(HostInfo, "HostInfo", name=fullnames[chost], fqdn=fullnames[chost], pingable='N') + clientElement.xpath("/Clients/Client[@name=%s]"%chost).set("pingable",'N') except: pass - fout = open(hostinfopath, 'w') - fout.write(pretty_print(HostInfo)) + fout = open(clientdatapath, 'w') + fout.write(pretty_print(clientElement)) fout.close() diff --git a/src/sbin/StatReports b/src/sbin/StatReports index 439998718..d08d38a57 100644 --- a/src/sbin/StatReports +++ b/src/sbin/StatReports @@ -30,8 +30,7 @@ def generatereport(rspec, nrpt): pattern = re.compile( '|'.join([item.get("name") for item in reportspec.findall('Machine')])) for node in nodereprt.findall('Node'): - if not (node.findall("HostInfo") and node.findall("Statistics") and - node.find("HostInfo").get("fqdn") and pattern.match(node.get('name'))): + if not (node.findall("Statistics") and pattern.match(node.get('name'))): # don't know enough about node nodereprt.remove(node) continue @@ -173,12 +172,12 @@ if __name__ == '__main__': #See if hostinfo.xml exists, and is less than 23.5 hours old - try: - hostinstat = os.stat(hostinfopath) - if (time() - hostinstat[9])/(60*60) > 23.5: - os.system('GenerateHostInfo')#Generate HostInfo needs to be in path - except OSError: - os.system('GenerateHostInfo')#Generate HostInfo needs to be in path + #try: + #hostinstat = os.stat(hostinfopath) + #if (time() - hostinstat[9])/(60*60) > 23.5: + os.system('GenerateHostInfo')#Generate HostInfo needs to be in path + #except OSError: + # os.system('GenerateHostInfo')#Generate HostInfo needs to be in path '''Reads Data & Config files''' |