| 32 | 
   | 
     $attributeName = getValue("attributeName", $alert); | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 33 | 
   | 
     $timeTillNextAlert = getValue("timeTillNextAlert", $alert); | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 34 | 
   | 
     $initialAlertTime = getValue("initialAlertTime", $alert); | 
 
 
 
 
 
 
 
 
 
 
 
 | 35 | 
 < | 
     echo "<b>$alertLevel</b>$alert<br>"; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 35 | 
 > | 
  | 
 
 
 
 
 
 | 36 | 
 > | 
     echo <<<EOT | 
 
 
 
 
 
 | 37 | 
 > | 
      | 
 
 
 
 
 
 | 38 | 
 > | 
     <table border="0" width="500"> | 
 
 
 
 
 
 | 39 | 
 > | 
       <tr> | 
 
 
 
 
 
 | 40 | 
 > | 
         <td><b>$attributeName</b></td> | 
 
 
 
 
 
 | 41 | 
 > | 
         </td> </td> | 
 
 
 
 
 
 | 42 | 
 > | 
       <tr> | 
 
 
 
 
 
 | 43 | 
 > | 
         <td>Alert level:</td> | 
 
 
 
 
 
 | 44 | 
 > | 
         <td><b>$alertLevelNames[$alertLevel]</b></td> | 
 
 
 
 
 
 | 45 | 
 > | 
       </tr> | 
 
 
 
 
 
 | 46 | 
 > | 
       <tr> | 
 
 
 
 
 
 | 47 | 
 > | 
         <td>Last alert time:</td> | 
 
 
 
 
 
 | 48 | 
 > | 
         <td>$lastAlert</td> | 
 
 
 
 
 
 | 49 | 
 > | 
       </tr> | 
 
 
 
 
 
 | 50 | 
 > | 
       <tr> | 
 
 
 
 
 
 | 51 | 
 > | 
         <td colspan="2"> | 
 
 
 
 
 
 | 52 | 
 > | 
           <font size="2"> | 
 
 
 
 
 
 | 53 | 
 > | 
             $source has exceeded the threshold of $thresholdValue | 
 
 
 
 
 
 | 54 | 
 > | 
             for $attributeName with a value of <b>$value</b>. | 
 
 
 
 
 
 | 55 | 
 > | 
              | 
 
 
 
 
 
 | 56 | 
 > | 
           </font> | 
 
 
 
 
 
 | 57 | 
 > | 
         </td> | 
 
 
 
 
 
 | 58 | 
 > | 
       </tr> | 
 
 
 
 
 
 | 59 | 
 > | 
       <tr> | 
 
 
 
 
 
 | 60 | 
 > | 
         <td>Initial alert time:</td> | 
 
 
 
 
 
 | 61 | 
 > | 
         <td>$initialAlertTime</td> | 
 
 
 
 
 
 | 62 | 
 > | 
       </tr> | 
 
 
 
 
 
 | 63 | 
 > | 
       <tr> | 
 
 
 
 
 
 | 64 | 
 > | 
         <td>Time until next alert:</td> | 
 
 
 
 
 
 | 65 | 
 > | 
         <td>$timeTillNextAlert</td> | 
 
 
 
 
 
 | 66 | 
 > | 
       </tr> | 
 
 
 
 
 
 | 67 | 
 > | 
     </table> | 
 
 
 
 
 
 | 68 | 
 > | 
      | 
 
 
 
 
 
 | 69 | 
 > | 
 EOT; | 
 
 
 
 
 
 | 70 | 
 > | 
  | 
 
 
 
 
 
 | 71 | 
 > | 
     printLine(""); | 
 
 
 
 
 
 | 72 | 
 > | 
  | 
 
 
 
 
 
 
 
 
 
 
 
 | 73 | 
   | 
 } | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 74 | 
   | 
  | 
 
 
 
 
 
 
 
 
 | 75 | 
 + | 
 function printReports($machine) { | 
 
 
 
 
 
 
 
 
 | 76 | 
 + | 
    # Get a list of all files in the machine's directory. | 
 
 
 
 
 
 
 
 
 | 77 | 
 + | 
    include("alerts_config.inc.php"); | 
 
 
 
 
 
 
 
 
 | 78 | 
 + | 
    $alertArray = getdirArray("$alertDirectory/$machine", 'rsort'); | 
 
 
 
 
 
 
 
 
 | 79 | 
 + | 
         | 
 
 
 
 
 
 
 
 
 | 80 | 
 + | 
    foreach($alertArray as $file_name) { | 
 
 
 
 
 
 
 
 
 | 81 | 
 + | 
        $input = file("$alertDirectory/$machine/$file_name"); | 
 
 
 
 
 
 
 
 
 | 82 | 
 + | 
        $input = $input[0]; | 
 
 
 
 
 
 
 
 
 | 83 | 
 + | 
        $alerts[] = $input; | 
 
 
 
 
 
 
 
 
 | 84 | 
 + | 
    } | 
 
 
 
 
 
 
 
 
 | 85 | 
 + | 
         | 
 
 
 
 
 
 
 
 
 | 86 | 
 + | 
    foreach ($alerts as $alert) { | 
 
 
 
 
 
 
 
 
 | 87 | 
 + | 
        printAlert($machine, $alert); | 
 
 
 
 
 
 
 
 
 | 88 | 
 + | 
    } | 
 
 
 
 
 
 
 
 
 | 89 | 
 + | 
 } | 
 
 
 
 
 
 
 
 
 | 90 | 
 + | 
  | 
 
 
 
 
 
 
 
 
 | 91 | 
 + | 
  | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 92 | 
   | 
 ?> | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 93 | 
   | 
  | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 94 | 
   | 
 <? include($titleHTML); ?> | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 119 | 
   | 
  | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 120 | 
   | 
        printLine(""); | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 121 | 
   | 
  | 
 
 
 
 
 
 
 
 
 
 
 
 | 122 | 
 < | 
        # Get a list of all files in the machine's directory. | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 69 | 
 < | 
        $alertArray = getdirArray("$alertDirectory/$machine", 'rsort'); | 
 
 
 
 
 
 
 
 
 
 | 122 | 
 > | 
        printReports($machine); | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 123 | 
   | 
         | 
 
 
 
 
 
 
 
 
 
 | 71 | 
 – | 
        foreach($alertArray as $file_name) { | 
 
 
 
 
 
 
 
 
 
 | 72 | 
 – | 
            $input = file("$alertDirectory/$machine/$file_name"); | 
 
 
 
 
 
 
 
 
 
 | 73 | 
 – | 
            $input = $input[0]; | 
 
 
 
 
 
 
 
 
 
 | 74 | 
 – | 
            $alerts[] = $input; | 
 
 
 
 
 
 
 
 
 
 | 75 | 
 – | 
        } | 
 
 
 
 
 
 
 
 
 
 | 76 | 
 – | 
         | 
 
 
 
 
 
 
 
 
 
 | 77 | 
 – | 
        foreach ($alerts as $alert) { | 
 
 
 
 
 
 
 
 
 
 | 78 | 
 – | 
            printAlert($machine, $alert); | 
 
 
 
 
 
 
 
 
 
 | 79 | 
 – | 
        } | 
 
 
 
 
 
 
 
 
 
 | 80 | 
 – | 
  | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 124 | 
   | 
    } | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 125 | 
   | 
  | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 126 | 
   | 
 ?> | 
 
 
 
 
 
 
 
 
 
 | 84 | 
 – | 
  | 
 
 
 
 
 
 
 
 
 
 | 85 | 
 – | 
 <? printLine(""); ?> | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 127 | 
   | 
  | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 128 | 
   | 
 <? include($bottomHTML); ?> |