diff --git a/html/pages/device/dev-data-linux.inc b/html/pages/device/dev-data-linux.inc new file mode 100644 index 0000000000..7ee3c14ab3 --- /dev/null +++ b/html/pages/device/dev-data-linux.inc @@ -0,0 +1,14 @@ + + Operating System$device[os] $device[version] ($device[features]) + Hardware $device[hardware] + Uptime " . formatuptime($device[uptime]) . " + +"); + + +?> diff --git a/html/pages/device/dev-edit.inc b/html/pages/device/dev-edit.inc new file mode 100644 index 0000000000..b9225ce091 --- /dev/null +++ b/html/pages/device/dev-edit.inc @@ -0,0 +1,85 @@ + "5") { + include("includes/edit-host.inc"); + } +} + +$device = mysql_fetch_array(mysql_query("SELECT * FROM `devices` WHERE `id` = '$_GET[id]'")); +$descr = $device['purpose']; + +if($updated && $update_message) { + print_message($update_message); +} elseif ($update_message) { + print_error($update_message); +} + + + +if($device['type'] == 'server') { $server_select = "selected"; } +if($device['type'] == 'network') { $network_select = "selected"; } +if($device['type'] == 'firewall') { $firewall_select = "selected"; } +if($device['type'] == 'workstation') { $workstation_select = "selected"; } +if($device['type'] == 'other') { $other_select = "selected"; } + +echo(" +
+ +

Edit Device

+ +
+ + + + + + + + + + + + + + + + + + + + +
Description
+ Type + + +
Disable
Ignore
Apache
+ + +
"); + + echo("
"); + +} + diff --git a/html/pages/device/dev-events.inc b/html/pages/device/dev-events.inc new file mode 100644 index 0000000000..81818272a8 --- /dev/null +++ b/html/pages/device/dev-events.inc @@ -0,0 +1,15 @@ +"); + +while($entry = mysql_fetch_array($data)) { + +include("includes/print-event.inc"); + +} +echo(""); + + ?> diff --git a/html/pages/device/dev-graphs.inc b/html/pages/device/dev-graphs.inc new file mode 100644 index 0000000000..9a7f7c2df3 --- /dev/null +++ b/html/pages/device/dev-graphs.inc @@ -0,0 +1,189 @@ +"); + + 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(""); +} + +?> + diff --git a/html/pages/device/dev-ifgraphs.inc b/html/pages/device/dev-ifgraphs.inc new file mode 100644 index 0000000000..795f34103d --- /dev/null +++ b/html/pages/device/dev-ifgraphs.inc @@ -0,0 +1,7 @@ + diff --git a/html/pages/device/dev-ifs.inc b/html/pages/device/dev-ifs.inc new file mode 100644 index 0000000000..ba0f2cf856 --- /dev/null +++ b/html/pages/device/dev-ifs.inc @@ -0,0 +1,13 @@ +"); + $i = "1"; + $interface_query = mysql_query("select * from interfaces WHERE host = '$_GET[id]' ORDER BY 'ifIndex'"); + while($interface = mysql_fetch_array($interface_query)) { + include("includes/print-interface.inc"); + } + echo("
"); + +?> diff --git a/html/pages/device/dev-overview.inc b/html/pages/device/dev-overview.inc new file mode 100644 index 0000000000..54392313e7 --- /dev/null +++ b/html/pages/device/dev-overview.inc @@ -0,0 +1,118 @@ + + "); + + +if(file_exists("includes/dev-data-" . strtolower($device[os]) . ".inc")) { + echo("
"); + echo("

Device Data

"); + include("includes/dev-data-" . strtolower($device[os]) . ".inc"); + echo("
"); +} + + +echo("
"); + +$query = "SELECT *,DATE_FORMAT(datetime, '%d/%b/%y %T') as humandate FROM `eventlog` WHERE `host` = '$_GET[id]' ORDER BY `datetime` DESC LIMIT 0,10"; +$data = mysql_query($query); + +echo("

Recent Events

+"); + +while($entry = mysql_fetch_array($data)) { + +include("includes/print-event-short.inc"); + +} +echo("
"); + +echo(""); + +if($interfaces['total']) { + + echo("
"); + echo("

Interfaces

"); + +echo(" + + + + + + +
$interfaces[total] $interfaces[up] $interfaces[down] $interfaces[disabled]
"); + + echo("
"); + + $sql = "SELECT * FROM interfaces WHERE host = '$id'"; + $query = mysql_query($sql); + while($data = mysql_fetch_array($query)) { + echo("$ifsep" . generateiflink($data, makeshortif(strtolower($data['if'])))); + $ifsep = ", "; + } + unset($ifsep); + echo("
"); + + echo("
"); + +} + +if($services['total']) { + + echo("
"); + echo("

Services

"); + +echo(" + + + + + + +
$services[total] $services[up] $services[down] $services[disabled]
"); + + + + echo("
"); + + $sql = "SELECT * FROM services WHERE service_host = '$id' ORDER BY service_type"; + $query = mysql_query($sql); + while($data = mysql_fetch_array($query)) { + if ($data[service_status] == "0" && $data[service_ignore] == "1") { $status = "grey"; } + if ($data[service_status] == "1" && $data[service_ignore] == "1") { $status = "green"; } + if ($data[service_status] == "0" && $data[service_ignore] == "0") { $status = "red"; } + if ($data[service_status] == "1" && $data[service_ignore] == "0") { $status = "blue"; } + echo("$break" . strtolower($data[service_type]) . ""); + $break = ", "; + } + + echo("
"); + +} + + + +echo(""); + +?> diff --git a/html/pages/device/dev-srv.inc b/html/pages/device/dev-srv.inc new file mode 100644 index 0000000000..507a78ebdd --- /dev/null +++ b/html/pages/device/dev-srv.inc @@ -0,0 +1,24 @@ + '0') { + + echo("
"); + $i = "1"; + $service_query = mysql_query("select * from services WHERE service_host = '$_GET[id]' ORDER BY service_type"); + while($service = mysql_fetch_array($service_query)) { + + include("includes/print-service.inc"); + } + echo("
"); + +} else { + + echo("No Services"); + +} + + +?> + diff --git a/html/pages/device/dev-syslog.inc b/html/pages/device/dev-syslog.inc new file mode 100644 index 0000000000..032032dc36 --- /dev/null +++ b/html/pages/device/dev-syslog.inc @@ -0,0 +1,15 @@ +"); + +while($entry = mysql_fetch_array($data)) { + +include("includes/print-syslog.inc"); + +} +echo(""); + + ?>