|
1 |
<?php
|
|
2 |
/*
|
|
3 |
* vérifie le recensement des serveurs a la recherche d'une modification de carte
|
|
4 |
* reseau ...
|
|
5 |
*/
|
|
6 |
|
|
7 |
if(!defined('GLPI_ROOT')){
|
|
8 |
define('GLPI_ROOT', '../../..');
|
|
9 |
}
|
|
10 |
include_once (GLPI_ROOT . "/inc/includes.php");
|
|
11 |
|
|
12 |
checkRight("config","w");
|
|
13 |
global $DB;
|
|
14 |
|
|
15 |
commonHeader("anet_epacks",$_SERVER['PHP_SELF'],"config","plugins");
|
|
16 |
|
|
17 |
//on récupère la liste des serveurs
|
|
18 |
$query = "SELECT DISTINCT(FK_serveur) FROM glpi_plugin_anet_epacks_recencement";
|
|
19 |
|
|
20 |
$result = $DB->query($query);
|
|
21 |
print "<h3>Détection des modifications de cartes réseaux (sur les 6 derniers mois)</h3>\n";
|
|
22 |
|
|
23 |
print "<table style=\"text-align: left; padding-left: 40px;\">";
|
|
24 |
print " <tr> <th>Date</th><th>Nom</th><th>mac0</th><th>mac1</th></tr>\n";
|
|
25 |
while($data=$DB->fetch_array($result)) {
|
|
26 |
$fks = $data[0];
|
|
27 |
$query2 = "SELECT id,ladate,site,mac0,mac1,FK_serveur FROM glpi_plugin_anet_epacks_recencement WHERE (TO_DAYS(NOW()) - TO_DAYS(ladate) <= 180) AND FK_serveur='" . $fks . "' GROUP BY mac0;";
|
|
28 |
$result2 = $DB->query($query2);
|
|
29 |
|
|
30 |
if($DB->numrows($result2) > 1)
|
|
31 |
while($data2=$DB->fetch_array($result2)) {
|
|
32 |
//on récupère les packs activés et dont l'entitée finale est connue
|
|
33 |
print " <tr> <td>" . $data2[1] . "</td><td>" . $data2[2] . "</td><td>" . $data2[3] . "</td><td>" . $data2[4] . "</td></tr>\n";
|
|
34 |
}
|
|
35 |
|
|
36 |
unset($query2);
|
|
37 |
unset($result2);
|
|
38 |
|
|
39 |
$query2 = "SELECT id,ladate,site,mac0,mac1,FK_serveur FROM glpi_plugin_anet_epacks_recencement WHERE (TO_DAYS(NOW()) - TO_DAYS(ladate) <= 180) AND FK_serveur='" . $fks . "' GROUP BY mac1;";
|
|
40 |
$result2 = $DB->query($query2);
|
|
41 |
|
|
42 |
if($DB->numrows($result2) > 1)
|
|
43 |
while($data2=$DB->fetch_array($result2)) {
|
|
44 |
//on récupère les packs activés et dont l'entitée finale est connue
|
|
45 |
print " <tr> <td>" . $data2[1] . "</td><td>" . $data2[2] . "</td><td>" . $data2[3] . "</td><td>" . $data2[4] . "</td></tr>\n";
|
|
46 |
}
|
|
47 |
}
|
|
48 |
print "</table>";
|
|
49 |
|
|
50 |
|
|
51 |
|
|
52 |
commonFooter();
|
|
53 |
?>
|