ViewVC Help
View File | Revision Log | Show Annotations | Revision Graph | Root Listing
root/i-scream/projects/cms/source/reports/php/alerts/alerts.php
(Generate patch)

Comparing projects/cms/source/reports/php/alerts/alerts.php (file contents):
Revision 1.2 by pjm2, Thu Mar 15 10:55:03 2001 UTC vs.
Revision 1.4 by pjm2, Thu Mar 15 16:53:59 2001 UTC

# Line 32 | Line 32 | function printAlert($machine, $alert) {
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>&nbsp;</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); ?>
95  
96 < <? printLine("Display alerts about all hosts, or a host"); ?>
96 > <? printLine("Display the latest alerts for a host"); ?>
97  
98   <form method="<? echo $formMethod ?>" action="<? echo $thisPage ?>">
99   <?
# Line 63 | Line 117 | function printAlert($machine, $alert) {
117  
118   <? if ($machine) {
119  
120 <       # Get a list of all files in the machine's directory.
67 <       $alertArray = getdirArray("$alertDirectory/$machine", 'rsort');
68 <      
69 <       foreach($alertArray as $file_name) {
70 <           $input = file("$alertDirectory/$machine/$file_name");
71 <           $input = $input[0];
72 <           $alerts[] = $input;
73 <       }
74 <      
75 <       foreach ($alerts as $alert) {
76 <           printAlert($machine, $alert);
77 <       }
120 >       printLine("");
121  
122 +       printReports($machine);
123 +      
124     }
125  
126   ?>
82
83 <? printLine(""); ?>
127  
128   <? include($bottomHTML); ?>

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines