<br/> <br/> <br/> <? } $AllparamDescription = get_parameter_description($kmCategory, "$paramSelected"); if ($AllparamDescription == 0) { $sumParms = count ($totalParameters); } else { $sumParms = count($AllparamDescription); } ?> <BR/> <fieldset> <legend>Descriptions (<?php print howmany ($sumParms,"Parameter","Parameters") ?>)</legend> <br/> <br/> <? if ($paramSelected) { # get the description of the parameter selected, if select_all is selected display them all echo "<TABLE BORDER><p>"; echo "<TR><TH>Parameter Name</TH><TH>Application Class</TH><TH>Description</TH><TH>Collector</TH></TR>"; sort($AllparamDescription); foreach ($AllparamDescription as $indParamDescription) { $indParamDescription = str_replace ("___", "\M", $indParamDescription); $indParamDescriptionArray = explode ("\M", $indParamDescription); $indParamSelected = $indParamDescriptionArray[0];
echo "Agent Removed from Rogue List <br>"; } $myReport = $_GET["myReport"]; if ($myReport) { $reportType = $_GET["reportType"]; $totalAgentsToProcess = get_all_hosts_for_user($_SESSION['user']); } run_report($reportType, $totalAgentsToProcess, $filterList,$dataPointTime,$filterAppClassSelect); $timeEnd = time(); $timeToComplete = $timeEnd - $timeStart; #</fieldset> ?> <BR><BR> <p class="silver">Report completed in <?php print howmany($timeToComplete, "second.", "seconds."); ?> </p> </body> </html> <INPUT TYPE="hidden" NAME=removeRogue> <INPUT TYPE="hidden" NAME=reportType VALUE="<?php print $reportType; ?> "> </form>
function run_out_of_compliance($totalAgentsToProcess) { #set_time_limit(120); $whereHosts = create_where_statement_for_all_hosts($totalAgentsToProcess); $cmd = "DROP TABLE IF EXISTS ooc1"; run_sql_cmd($cmd); // We need to exclude that $cmd = " CREATE TABLE ooc1 AS ( SELECT * FROM ooc WHERE variable != '/AS/EVENTSPRING/PARAM_SETTINGS/STATUSFLAGS/paramSettingsStatusFlag' )"; run_sql_cmd($cmd); if (count($totalAgentsToProcess) < 500) { $query = " SELECT ga.agentid agentid, display_name, port, count(*) Mismatches FROM ooc1 ooc1 LEFT OUTER JOIN goodagents ga ON ooc1.agentid = ga.agentid WHERE ga.agentid IS NOT NULL AND $whereHosts GROUP BY agentid ORDER BY display_name;"; } else { $query = " SELECT ga.agentid agentid, display_name, port, count(*) Mismatches FROM ooc1 ooc1 LEFT OUTER JOIN goodagents ga ON ooc1.agentid = ga.agentid WHERE ga.agentid IS NOT NULL GROUP BY agentid ORDER BY display_name;"; } $result = run_query($query); $numNonCompliant = count($result); $totalAgentsToProcess = count($totalAgentsToProcess); $percentage = round($numNonCompliant / $totalAgentsToProcess * 100); if ($numNonCompliant < 1) { $titleString = "All Hosts Are in Compliance"; } else { $titleString = "Out of Compliance Report ($percentage% [$numNonCompliant of ".howmany($totalAgentsToProcess,"host","hosts")."])"; } ?> <h3><?php print $titleString; ?></h3> <fieldset> <legend>Non-compliant servers</legend> <TABLE class="report"> <TR><TH>HOSTNAME</TH><TH>MISMATCHED RULES</TH></TR> <? if (count($result)) { $reportData = "hostname, Mismatched Rules Count\n"; } foreach ($result as $value) { $resultArray = explode ("___", $value); $reportData = $reportData . "$resultArray[1],$resultArray[3]\n"; ?> <TR> <TD><a href="oocDetails.php?agentId=<?php print "$resultArray[0]&hostName=$resultArray[1]&portNumber=$resultArray[2]"; ?>" target="_blank"><?php print "$resultArray[1]"; ?></a> </TD> <TD><a href="oocDetails.php?agentId=<?php print "$resultArray[0]&hostName=$resultArray[1]&portNumber=$resultArray[2]"; ?>" target="_blank"><?php print "$resultArray[3]"; ?></a> </TD> </TR> <?php } ?> </TABLE> </fieldset> <? return $reportData; }