$device_query = mysql_query("select * from devices WHERE id = '$_GET[id]'");
while($device = mysql_fetch_array($device_query)) {
$hostname = $device[hostname];
$bg="#ffffff";
echo("
");
switch ($device['os']) {
case "ProCurve":
echo("
Processor Utilisation
");
$graph_type = "cpu"; include ("includes/print-device-graph.php");
echo("
");
echo("
Memory Usage
");
$graph_type = "mem"; include ("includes/print-device-graph.php");
echo("
");
echo("
Device Uptime
");
$graph_type = "uptime"; include ("includes/print-device-graph.php"); break;
echo("
");
break;
case "Windows":
$graph_type = "cpu";
include ("includes/print-device-graph.php");
$memgraph = memgraphWin ($device[hostname] . "-mem.rrd", $device[hostname] . "-mem.png", $day, $now, 335, 100);
$loadgraph = loadgraphWin ($device[hostname] . "-load.rrd", $device[hostname] . "-load.png", $day, $now, 335, 100);
$cpugraphm = cpugraphWin ($device[hostname] . "-cpu.rrd", $device[hostname] . "-cpu-m.png", $month, $now, 335, 100);
$memgraphm = memgraphWin ($device[hostname] . "-mem.rrd", $device[hostname] . "-mem-m.png", $month, $now, 335, 100);
$loadgraphm = loadgraphWin ($device[hostname] . "-load.rrd", $device[hostname] . "-load-m.png", $month, $now, 335, 100);
$usersgraph = usersgraphWin ($device[hostname] . "-sys.rrd", $device[hostname] . "-users.png", $day, $now, 335, 100);
$usersgraphm = usersgraphWin ($device[hostname] . "-sys.rrd", $device[hostname] . "-users-m.png", $month, $now, 335, 100);
$procsgraph = procsgraphWin ($device[hostname] . "-sys.rrd", $device[hostname] . "-procs.png", $day, $now, 335, 100);
$procsgraphm = procsgraphWin ($device[hostname] . "-sys.rrd", $device[hostname] . "-procs-m.png", $month, $now, 335, 100);
break;
case "FreeBSD":
case "NetBSD":
case "Linux":
case "m0n0wall":
case "Voswall":
case "DragonFly":
case "OpenBSD":
case "pfSense":
echo("
Processor Utilisation
");
$graph_type = "cpu"; include ("includes/print-device-graph.php");
echo("
");
if($device[os] == "m0n0wall" || $device[os] == "pfSense" || $device[os] == "Voswall" || $device[monowall]) {
echo("
Device Uptime
");
$graph_type = "uptime"; include ("includes/print-device-graph.php"); break;
echo("
");
}
if($device['os'] != "NetBSD") {
echo("
Memory Utilisation
");
$graph_type = "mem"; include ("includes/print-device-graph.php");
echo("
");
}
if(mysql_result(mysql_query("SELECT count(storage_id) FROM storage WHERE host_id = '$device[id]'"),0)) {
echo("
Storage
");
$graph_type = "unixfs"; include ("includes/print-device-graph.php");
echo("
");
}
if(mysql_result(mysql_query("SELECT count(*) FROM temperature WHERE temp_host = '$device[id]'"),0)) {
echo("
Temperatures
");
$graph_type = "temp"; include ("includes/print-device-graph.php");
echo("
");
}
echo("
IP Statistics
");
$graph_type = "ip_graph"; include ("includes/print-device-graph.php");
echo("
");
echo("
TCP Statistics
");
$graph_type = "tcp_graph"; include ("includes/print-device-graph.php");
echo("
");
echo("
UDP Statistics
");
$graph_type = "udp_graph"; include ("includes/print-device-graph.php");
echo("
");
echo("
ICMP Statistics
");
$graph_type = "icmp_graph"; include ("includes/print-device-graph.php");
echo("
");
echo("
System Load
");
$graph_type = "load"; include ("includes/print-device-graph.php");
echo("
");
echo("
Users Logged On
");
$graph_type = "users"; include ("includes/print-device-graph.php");
echo("
");
echo("
Running Processes
");
$graph_type = "procs"; include ("includes/print-device-graph.php");
echo("
");
if($device[postfix] == '1') {
echo("
Postfix Mail Statistics
");
$graph_type = "postfix"; include ("includes/print-device-graph.php");
echo("
");
echo("
Postfix Mail Error Statistics
");
$graph_type = "postfixerrors"; include ("includes/print-device-graph.php");
echo("
");
}
if($device[courier] == '1') {
echo("
Postfix Mail Statistics
");
$graph_type = "courier"; include ("includes/print-device-graph.php");
echo("
");
}
if($device[apache] == '1') {
echo("
Apache Hits
");
$graph_type = "apachehits"; include ("includes/print-device-graph.php");
echo("
");
echo("
Apache Traffic
");
$graph_type = "apachebits"; include ("includes/print-device-graph.php");
echo("
");
}
echo("
Device Uptime
");
$graph_type = "uptime"; include ("includes/print-device-graph.php");
echo("
");
break;
case "IOS":
echo("
CPU Usage
");
$graph_type = "cpu"; include ("includes/print-device-graph.php");
echo("
Memory Usage
");
echo("
");
$graph_type = "mem"; include ("includes/print-device-graph.php");
echo("
");
if(mysql_result(mysql_query("SELECT count(*) FROM temperature WHERE temp_host = '$device[id]'"),0)) {
echo("
Temperatures
");
$graph_type = "temp"; include ("includes/print-device-graph.php");
echo("
");
}
echo("
IP Statistics
");
$graph_type = "ip_graph"; include ("includes/print-device-graph.php");
echo("
");
echo("
TCP Statistics
");
$graph_type = "tcp_graph"; include ("includes/print-device-graph.php");
echo("
");
echo("
UDP Statistics
");
$graph_type = "udp_graph"; include ("includes/print-device-graph.php");
echo("
");
echo("
ICMP Statistics
");
$graph_type = "icmp_graph"; include ("includes/print-device-graph.php");
echo("
");
echo("
Uptime
");
$graph_type = "uptime"; include ("includes/print-device-graph.php");
break;
case "Snom":
echo("
Calls
");
$graph_type = "calls"; include ("includes/print-device-graph.php");
}
if($memgraph) {
echo("

");
}
if($storagegraph) {
echo("$storagegraph");
}
if($loadgraph) {
echo("

");
}
if($tempgraph) {
echo("

");
}
if($mailsgraph) {
echo("

");
}
if($mailerrorgraph) {
echo("

");
}
if($couriergraph) {
echo("

");
}
if($ahitsgraph) {
echo("

");
}
if($abitsgraph) {
echo("

");
}
if($usersgraph) {
echo("

");
}
if($procsgraph) {
echo("

");
}
if($uptimegraph) {
echo("

");
}
echo("
");
}
?>