diff --git a/060-to-current.sql b/060-to-current.sql
index ce485aa96..e861e3863 100644
--- a/060-to-current.sql
+++ b/060-to-current.sql
@@ -65,4 +65,6 @@ ALTER TABLE `interfaces` DROP `in_errors`;
ALTER TABLE `interfaces` DROP `out_errors`;
CREATE TABLE IF NOT EXISTS `cmpMemPool` ( `cmp_id` int(11) NOT NULL auto_increment, `Index` varchar(8) NOT NULL, `cmpName` varchar(32) NOT NULL, `cmpValid` varchar(8) NOT NULL, `device_id` int(11) NOT NULL, `cmpUsed` int(11) NOT NULL, `cmpFree` int(11) NOT NULL, `cmpLargestFree` int(11) NOT NULL, `cmpAlternate` tinyint(4) default NULL, PRIMARY KEY (`cmp_id`), KEY `device_id` (`device_id`)) ENGINE=MyISAM DEFAULT CHARSET=latin1;
CREATE TABLE IF NOT EXISTS `hrDevice` ( `hrDevice_id` int(11) NOT NULL auto_increment, `device_id` int(11) NOT NULL, `hrDeviceIndex` int(11) NOT NULL, `hrDeviceDescr` text NOT NULL, `hrDeviceType` text NOT NULL, `hrDeviceErrors` int(11) NOT NULL, `hrDeviceStatus` text NOT NULL, `hrProcessorLoad` tinyint(4) default NULL, PRIMARY KEY (`hrDevice_id`), KEY `device_id` (`device_id`)) ENGINE=MyISAM DEFAULT CHARSET=latin1;
-
+ALTER TABLE `entPhysical` ADD `entPhysicalHardwareRev` VARCHAR( 16 ) NULL AFTER `entPhysicalName` ,ADD `entPhysicalFirmwareRev` VARCHAR( 16 ) NULL AFTER `entPhysicalHardwareRev` ,ADD `entPhysicalSoftwareRev` VARCHAR( 16 ) NULL AFTER `entPhysicalFirmwareRev` ,ADD `entPhysicalAlias` VARCHAR( 32 ) NULL AFTER `entPhysicalSoftwareRev` ,ADD `entPhysicalAssetID` VARCHAR( 32 ) NULL AFTER `entPhysicalAlias` ,ADD `entPhysicalIsFRU` VARCHAR( 8 ) NULL AFTER `entPhysicalAssetID`;
+ALTER TABLE `devices` ADD `last_discovered` timestamp NULL DEFAULT NULL AFTER `last_polled`;
+ALTER TABLE `devices` CHANGE `lastchange` `uptime` BIGINT NULL DEFAULT NULL;
diff --git a/DATABASE-CHANGES b/DATABASE-CHANGES
deleted file mode 100644
index 3f5030d39..000000000
--- a/DATABASE-CHANGES
+++ /dev/null
@@ -1,2 +0,0 @@
-Since 0.6.0
- interfaces table added field `ifName` VARCHAR(64)
diff --git a/discovery.php b/discovery.php
index 8375e2ad6..8599b76aa 100755
--- a/discovery.php
+++ b/discovery.php
@@ -46,7 +46,9 @@ $devices_discovered = 0;
$device_query = mysql_query("SELECT * FROM `devices` WHERE status = '1' $where ORDER BY device_id DESC");
while ($device = mysql_fetch_array($device_query)) {
- echo($device['hostname'] ."\n");
+ echo($device['hostname'] . " ".$device['device_id']." ".$device['os']." ");
+ if($os_groups[$device[os]]) {$device['os_group'] = $os_groups[$device[os]]; echo "(".$device['os_group'].")";}
+ echo("\n");
## Discover Interfaces
include("includes/discovery/interfaces.php");
@@ -73,8 +75,7 @@ while ($device = mysql_fetch_array($device_query)) {
if($device['os'] == "JunOS") { include("includes/discovery/bgp-peers.php"); }
-
- if($device['os'] == "IOS" || $device['os'] == "IOS XE" || $device['os'] == "CatOS" || $device['os'] == "ASA") {
+ if($device['os'] == "powerconnect" || $device['os'] == "ios" || $device['os'] == "iosxe" || $device['os'] == "catos" || $device['os'] == "asa" || $device['os'] == "pix") {
include("includes/discovery/cisco-vlans.php");
include("includes/discovery/bgp-peers.php");
include("includes/discovery/cisco-mac-accounting.php");
@@ -86,8 +87,12 @@ while ($device = mysql_fetch_array($device_query)) {
include("includes/discovery/cisco-cdp.inc.php");
}
+ $update_query = "UPDATE `devices` SET ";
+ $update .= " `last_discovered` = NOW()";
+ $update_query .= " WHERE `device_id` = '" . $device['device_id'] . "'";
+ $update_result = mysql_query($update_query);
+
echo("\n"); $devices_discovered++;
- mysql_query("DELETE FROM `devices_attribs` WHERE `device_id` = '".$device['device_id']."' AND `attrib_type` = 'discover'");
}
$end = utime(); $run = $end - $start;
diff --git a/html/graph.php b/html/graph.php
index 4a2ee770a..877ea1bd7 100644
--- a/html/graph.php
+++ b/html/graph.php
@@ -72,162 +72,7 @@ if($_GET['debug']) {
imagepng($im);
imagedestroy($im);
}
- } else {
-
- switch ($type) {
- case 'cisco_entity_sensor':
- $graph = graph_entity_sensor ($_GET['a'], $graphfile, $from, $to, $width, $height, $title, $vertical);
- break;
- case 'fortigate_sessions':
- $graph = graph_fortigate_sessions ($hostname . "/fortigate-sessions.rrd", $graphfile, $from, $to, $width, $height, $title, $vertical);
- break;
- case 'fortigate_cpu':
- $graph = graph_fortigate_cpu ($hostname . "/fortigate-cpu.rrd", $graphfile, $from, $to, $width, $height, $title, $vertical);
- break;
- case 'fortigate_memory':
- $graph = graph_fortigate_memory ($hostname . "/fortigate-memory.rrd", $graphfile, $from, $to, $width, $height, $title, $vertical);
- break;
- case 'netscreen_sessions':
- $graph = graph_netscreen_sessions ($hostname . "/netscreen-sessions.rrd", $graphfile, $from, $to, $width, $height, $title, $vertical);
- break;
- case 'netscreen_cpu':
- $graph = graph_netscreen_cpu ($hostname . "/netscreen-cpu.rrd", $graphfile, $from, $to, $width, $height, $title, $vertical);
- break;
- case 'netscreen_memory':
- $graph = graph_netscreen_memory ($hostname . "/netscreen-memory.rrd", $graphfile, $from, $to, $width, $height, $title, $vertical);
- break;
- case 'multi_bits_duo':
- $groups = array($_GET['interfaces'], $_GET['interfaces_b']);
- $graph = graph_multi_bits_duo ($groups, $graphfile, $from, $to, $width, $height, $title, $vertical, $inverse, $legend);
- break;
- case 'multi_bits_trio':
- $groups = array($_GET['interfaces'], $_GET['interfaces_b'], $_GET['interfaces_c']);
- $graph = graph_multi_bits_trio ($groups, $graphfile, $from, $to, $width, $height, $title, $vertical, $inverse, $legend);
- break;
- case 'adsl_rate':
- $graph = graph_adsl_rate ($hostname. "/adsl-4.rrd", $graphfile, $from, $to, $width, $height);
- break;
- case 'adsl_snr':
- $graph = graph_adsl_snr ($hostname. "/adsl-4.rrd", $graphfile, $from, $to, $width, $height);
- break;
- case 'adsl_atn':
- $graph = graph_adsl_atn ($hostname. "/adsl-4.rrd", $graphfile, $from, $to, $width, $height);
- break;
- case 'global_bits':
- $graph = graph_global_bits ("global_bits.png", $from, $to, $width, $height);
- break;
- case 'mac_acc_int':
- $graph = graph_mac_acc_interface ($_GET['if'], $graphfile, $from, $to, $width, $height, $title, $vertical);
- break;
- case 'mac_acc_pkts':
- $graph = graph_mac_pkts ($_GET['id'], $graphfile, $from, $to, $width, $height, $title, $vertical);
- break;
- case 'mac_acc':
- case 'mac_acc_bits':
- $graph = graph_mac_acc ($_GET['id'], $graphfile, $from, $to, $width, $height, $title, $vertical);
- break;
- case 'unixfs_dev':
- $graph = unixfsgraph_dev ($device_id, $graphfile, $from, $to, $width, $height, $title, $vertical);
- break;
- case 'unixfs':
- $graph = unixfsgraph ($_GET['id'], $graphfile, $from, $to, $width, $height, $title, $vertical);
- break;
- case 'bgp_updates':
- $bgpPeerIdentifier = mysql_result(mysql_query("SELECT bgpPeerIdentifier FROM bgpPeers WHERE bgpPeer_id = '".$_GET['peer']."'"),0);
- $graph = bgpupdatesgraph ($hostname . "/bgp-" . $bgpPeerIdentifier . ".rrd", $graphfile, $from, $to, $width, $height, $title, $vertical);
- break;
- case 'cbgp_prefixes':
- $bgpPeerIdentifier = mysql_result(mysql_query("SELECT bgpPeerIdentifier FROM bgpPeers WHERE bgpPeer_id = '".$_GET['peer']."'"),0);
- $graph = graph_cbgp_prefixes ($hostname . "/cbgp-" . $bgpPeerIdentifier . ".".$_GET['afi'].".".$_GET['safi'].".rrd", $graphfile, $from, $to, $width, $height, $title, $vertical);
- break;
- case 'calls':
- $graph = callsgraphSNOM ($hostname . "/data.rrd", $graphfile, $from, $to, $width, $height, $title, $vertical);
- break;
- case 'dev_cpmCPU':
- $graph = graph_device_cpmCPU ($device_id, $graphfile, $from, $to, $width, $height, $title, $vertical);
- break;
- case 'cpmCPU':
- $graph = graph_cpmCPU ($_GET['id'], $graphfile, $from, $to, $width, $height, $title, $vertical);
- break;
- case 'temp':
- $graph = temp_graph ($_GET['id'], $graphfile, $from, $to, $width, $height, $title, $vertical);
- break;
- case 'dev_temp':
- $graph = temp_graph_dev ($device_id, $graphfile, $from, $to, $width, $height, $title, $vertical);
- break;
- case 'cempMemPool':
- $graph = graph_cempMemPool ($_GET['id'], $graphfile, $from, $to, $width, $height, $title, $vertical);
- break;
- case 'mem':
- if($os == "Linux" || $os == "FreeBSD" || $os == "DragonFly" || $os == "OpenBSD" || $os == "NetBSD" ) {
- $graph = memgraphUnix ($hostname . "/mem.rrd", $graphfile, $from, $to, $width, $height, $title, $vertical);
- } elseif($os == "IOS" || $os == "IOS XE") {
- $graph = graph_device_cempMemPool ($device_id, $graphfile, $from, $to, $width, $height, $title, $vertical);
- } elseif($os == "CatOS") {
- $graph = memgraph ($hostname . "/mem.rrd", $graphfile, $from, $to, $width, $height, $title, $vertical);
- } elseif($os == "Windows") {
- } elseif($os == "ProCurve") {
- $graph = memgraphHP ($hostname . "/mem.rrd", $graphfile, $from, $to, $width, $height, $title, $vertical);
- }
- break;
- case 'load':
- if($os == "Linux" || $os == "FreeBSD" || $os == "DragonFly" || $os == "OpenBSD" || $os == "NetBSD" ) {
- $graph = loadgraphUnix ($hostname . "/load.rrd", $graphfile, $from, $to, $width, $height, $title, $vertical);
- } elseif($os == "IOS" || $os == "IOS XE") {
- $graph = loadgraph ($hostname . "/load.rrd", $graphfile, $from, $to, $width, $height, $title, $vertical);
- } elseif($os == "Windows") {
- $graph = loadgraphwin ($hostname . "/load.rrd", $graphfile, $from, $to, $width, $height, $title, $vertical);
- }
- break;
- case 'users':
- if($os == "Linux" || $os == "FreeBSD" || $os == "DragonFly" || $os == "OpenBSD" || $os == "NetBSD" ) {
- $graph = usersgraphUnix ($hostname . "/sys.rrd", $graphfile, $from, $to, $width, $height, $title, $vertical);
- } elseif($os == "Windows") {
- $graph = usersgraphwin ($hostname . "/sys.rrd", $graphfile, $from, $to, $width, $height, $title, $vertical);
- }
- break;
- case 'procs':
- if($os == "Linux" || $os == "FreeBSD" || $os == "DragonFly" || $os == "OpenBSD" || $os == "NetBSD" ) {
- $graph = procsgraphUnix ($hostname . "/sys.rrd", $graphfile, $from, $to, $width, $height, $title, $vertical);
- } elseif($os == "Windows") {
- $graph = procsgraphwin ($hostname . "/sys.rrd", $graphfile, $from, $to, $width, $height, $title, $vertical);
- }
- break;
- case 'unixfs':
- if($os == "Linux" || $os == "FreeBSD" || $os == "DragonFly" || $os == "OpenBSD" || $os == "NetBSD" ) {
- $graph = unixfsgraph ($device_id, $graphfile, $from, $to, $width, $height, $title, $vertical);
- }
- break;
- case 'postfix':
- case 'mail':
- if($os == "Linux" || $os == "FreeBSD" || $os == "DragonFly" || $os == "OpenBSD") {
- $graph = mailsgraphUnix ($hostname . "/mailstats.rrd", $graphfile, $from, $to, $width, $height, $title, $vertical);
- }
- break;
- case 'mailerrors':
- case 'postfixerrors':
- if($os == "Linux" || $os == "FreeBSD" || $os == "DragonFly" || $os == "OpenBSD") {
- $graph = mailerrorgraphUnix ($hostname, $graphfile, $from, $to, $width, $height, $title, $vertical);
- }
- break;
- case 'courier':
- if($os == "Linux" || $os == "FreeBSD" || $os == "DragonFly" || $os == "OpenBSD") {
- $graph = couriergraphUnix ($hostname . "/courierstats.rrd", $graphfile, $from, $to, $width, $height, $title, $vertical);
- }
- break;
- case 'apachehits':
- if($os == "Linux" || $os == "FreeBSD" || $os == "DragonFly" || $os == "OpenBSD") {
- $graph = apachehitsgraphUnix ($hostname . "/apache.rrd", $graphfile, $from, $to, $width, $height, $title, $vertical);
- }
- break;
- case 'apachebits':
- if($os == "Linux" || $os == "FreeBSD" || $os == "DragonFly" || $os == "OpenBSD") {
- $graph = apachebitsgraphUnix ($hostname . "/apache.rrd", $graphfile, $from, $to, $width, $height, $title, $vertical);
- }
- break;
- default:
- break;
- } // End SWITCH
+ }
if($graph) {
header('Content-type: image/png');
@@ -245,7 +90,7 @@ if($_GET['debug']) {
$delete = `rm $graphfile`;
- } // End IF
+# } // End IF
?>
diff --git a/html/images/observer-icon.png b/html/images/observer-icon.png
new file mode 100644
index 000000000..0f9aa5563
Binary files /dev/null and b/html/images/observer-icon.png differ
diff --git a/html/images/os/catos.png b/html/images/os/catos.png
index 9736d08bc..19a35e0c0 100644
Binary files a/html/images/os/catos.png and b/html/images/os/catos.png differ
diff --git a/html/images/os/junos.png b/html/images/os/junos.png
index b1b9e60cc..62551caa5 100644
Binary files a/html/images/os/junos.png and b/html/images/os/junos.png differ
diff --git a/html/images/os/powerconnect.png b/html/images/os/powerconnect.png
new file mode 100644
index 000000000..9fffd8c50
Binary files /dev/null and b/html/images/os/powerconnect.png differ
diff --git a/html/images/os/screenos.png b/html/images/os/screenos.png
index 5b19be5b9..62551caa5 100644
Binary files a/html/images/os/screenos.png and b/html/images/os/screenos.png differ
diff --git a/html/includes/error-no-perm-dev.inc.php b/html/includes/error-no-perm-dev.inc.php
new file mode 100644
index 000000000..20bf8fd1b
--- /dev/null
+++ b/html/includes/error-no-perm-dev.inc.php
@@ -0,0 +1 @@
+

Insufficient permissions to view this page
diff --git a/html/includes/graphs/device_hrstorage.inc.php b/html/includes/graphs/device_hrstorage.inc.php
index 64ad6bf64..4d7f7ad2a 100644
--- a/html/includes/graphs/device_hrstorage.inc.php
+++ b/html/includes/graphs/device_hrstorage.inc.php
@@ -12,8 +12,8 @@ include("common.inc.php");
if($iter=="1") {$colour="CC0000";} elseif($iter=="2") {$colour="008C00";} elseif($iter=="3") {$colour="4096EE";
} elseif($iter=="4") {$colour="73880A";} elseif($iter=="5") {$colour="D01F3C";} elseif($iter=="6") {$colour="36393D";
} elseif($iter=="7") {$colour="FF0084"; $iter = "0"; }
- $descr = str_pad($fs[hrStorageDescr], 14);
- $descr = substr($descr,0,14);
+ $descr = substr(str_pad($fs[hrStorageDescr], 12),0,12);
+ $descr = str_replace(":","\:",$descr);
$rrd = $config['rrd_dir'] . "/$hostname/hrStorage-".$fs['hrStorageIndex'].".rrd";
$rrd_options .= " DEF:$fs[storage_id]=$rrd:used:AVERAGE";
$rrd_options .= " DEF:$fs[storage_id]s=$rrd:size:AVERAGE";
diff --git a/html/includes/graphs/device_ipSystemStats.inc.php b/html/includes/graphs/device_ipSystemStats.inc.php
new file mode 100644
index 000000000..fab9591fd
--- /dev/null
+++ b/html/includes/graphs/device_ipSystemStats.inc.php
@@ -0,0 +1,67 @@
+
diff --git a/html/includes/graphs/device_memory_procurve.inc.php b/html/includes/graphs/device_memory_procurve.inc.php
index 5565029b6..2092be742 100644
--- a/html/includes/graphs/device_memory_procurve.inc.php
+++ b/html/includes/graphs/device_memory_procurve.inc.php
@@ -1,5 +1,7 @@
diff --git a/html/includes/hostbox.inc b/html/includes/hostbox.inc
index bca797253..b505c2973 100644
--- a/html/includes/hostbox.inc
+++ b/html/includes/hostbox.inc
@@ -12,12 +12,14 @@
$image = getImage($device['device_id']);
+ $device['os_text'] = $os_text[$device[os]];
+
echo("
| $image |
" . generatedevicelink($device) . "
$device[sysName] |
- $device[os]
+ | $device[os_text]
$device[version] |
$device[hardware]
$device[features] |
diff --git a/html/includes/print-interface.inc.php b/html/includes/print-interface.inc.php
index abaa17185..86509c132 100644
--- a/html/includes/print-interface.inc.php
+++ b/html/includes/print-interface.inc.php
@@ -78,7 +78,7 @@
# if($interface[ifDuplex] != unknown) { echo("Duplex " . $interface['ifDuplex'] . ""); } else { echo("-"); }
- if($device['os'] == "IOS" || $device['os'] == "IOS XE") {
+ if($device['os'] == "ios" || $device['os'] == "iosxe") {
if($interface['ifTrunk']) {
echo("" . $interface['ifTrunk'] . "");
} elseif ($interface['ifVlan']) {
diff --git a/html/includes/print-menubar.php b/html/includes/print-menubar.php
index fb3850ea6..a21af2db2 100644
--- a/html/includes/print-menubar.php
+++ b/html/includes/print-menubar.php
@@ -10,8 +10,8 @@
$query_a = mysql_query("SELECT * FROM `devices`");
while($device = mysql_fetch_array($query_a)) {
if($device['status'] == 0 && $device['ignore'] == '0') { $this_alert = "1"; } elseif($device['ignore'] == '0') {
- if(mysql_result(mysql_query("SELECT count(service_id) FROM services WHERE service_status = '0' AND service_host = '$device[id]'"),0)) { $this_alert = "1"; }
- if(mysql_result(mysql_query("SELECT count(*) FROM interfaces WHERE `ifOperStatus` = 'down' AND `ifAdminStatus` = 'up' AND device_id = '" . $device[device_id] . "'"),0)) { $this_alert = "1"; }
+ if(mysql_result(mysql_query("SELECT count(service_id) FROM services WHERE service_status = '0' AND service_host = '".$device['device_id']."'"),0)) { $this_alert = "1"; }
+ if(mysql_result(mysql_query("SELECT count(*) FROM interfaces WHERE `ifOperStatus` = 'down' AND `ifAdminStatus` = 'up' AND device_id = '" . $device['device_id'] . "'"),0)) { $this_alert = "1"; }
}
if($this_alert) {
$device_alerts++;
diff --git a/html/includes/warn-deleted-interfaces.inc.php b/html/includes/warn-deleted-interfaces.inc.php
new file mode 100644
index 000000000..057655f16
--- /dev/null
+++ b/html/includes/warn-deleted-interfaces.inc.php
@@ -0,0 +1,5 @@
+
diff --git a/html/pages/customers.php b/html/pages/customers.php
index 36e1b8ea7..faa978b5c 100644
--- a/html/pages/customers.php
+++ b/html/pages/customers.php
@@ -54,7 +54,7 @@
$prev_customer = $customer;
}
- if($device['os'] == "IOS") {
+ if($device['os'] == "ios") {
if($interface['ifTrunk']) { $vlan = "" . $interface['ifTrunk'] . "";
} elseif ($interface['ifVlan']) { $vlan = "VLAN " . $interface['ifVlan'] . "";
diff --git a/html/pages/device/graphs.inc.php b/html/pages/device/graphs.inc.php
index 3010bd909..d599664a4 100644
--- a/html/pages/device/graphs.inc.php
+++ b/html/pages/device/graphs.inc.php
@@ -7,28 +7,24 @@ while($device = mysql_fetch_array($device_query)) {
echo("");
- $os = strtolower(str_replace(" ", "_", $device['os']));
if(is_file($config['install_dir'] . "/html/pages/device/graphs/os-$os.inc.php")) {
include($config['install_dir'] . "/html/pages/device/graphs/os-$os.inc.php");
}
+ if($os_groups[$device[os]]) {$os_group = $os_groups[$device[os]];}
+
+ if(is_file($config['install_dir'] . "/html/pages/device/graphs/os-".$device['os'].".inc.php")) {
+ /// OS Specific
+ include($config['install_dir'] . "/html/pages/device/graphs/os-".$device['os'].".inc.php");
+ }elseif($os_group && is_file($config['install_dir'] . "/html/pages/device/graphs/os-".$os_group.".inc.php")) {
+ /// OS Group Specific
+ include($config['install_dir'] . "/html/pages/device/graphs/os-".$os_group.".inc.php");
+ } else {
+
+
+
switch ($device['os']) {
- case "JunOS":
- echo("
Processor Utilisation
");
- $graph_type = "device_cpu"; include ("includes/print-device-graph.php");
- if(mysql_result(mysql_query("SELECT count(*) FROM temperature WHERE temp_host = '" . $device['device_id'] . "'"),0)) {
- echo("
Temperatures
");
- $graph_type = "dev_temperatures"; include ("includes/print-device-graph.php");
- echo("
");
- }
-
- include("graphs/netstats.inc.php");
- include("graphs/uptime.inc.php");
-
- break;
-
-
- case "Fortigate":
+ case "fortigate":
echo("
Processor Utilisation
");
$graph_type = "fortigate_cpu"; include ("includes/print-device-graph.php");
echo("
Memory Usage
");
@@ -41,7 +37,7 @@ while($device = mysql_fetch_array($device_query)) {
break;
- case "BCM96348":
+ case "bcm96348":
echo("
ADSL Attainable Rate
");
$graph_type = "adsl_rate"; include ("includes/print-device-graph.php");
echo("
");
@@ -57,7 +53,7 @@ while($device = mysql_fetch_array($device_query)) {
break;
- case "ScreenOS":
+ case "screenos":
echo("
Processor Utilisation
");
$graph_type = "netscreen_cpu"; include ("includes/print-device-graph.php");
echo("
Memory Usage
");
@@ -82,106 +78,14 @@ while($device = mysql_fetch_array($device_query)) {
$graph_type = "device_uptime"; include ("includes/print-device-graph.php"); break;
echo("
");
- break;
- case "Windows":
-
- echo("
CPU Usage
");
- $graph_type = "device_cpu";
- include ("includes/print-device-graph.php");
-
- echo("
Memory Utilisation
");
- $graph_type = "device_memory"; include ("includes/print-device-graph.php");
- echo("
");
-
- if(mysql_result(mysql_query("SELECT count(storage_id) FROM storage WHERE host_id = '" . $device['device_id'] . "'"),0)) {
- echo("
Storage
");
- $graph_type = "device_hrstorage"; include ("includes/print-device-graph.php");
- echo("
");
- }
-
- if(mysql_result(mysql_query("SELECT count(*) FROM temperature WHERE temp_host = '" . $device['device_id'] . "'"),0)) {
- echo("
Temperatures
");
- $graph_type = "device_temperatures"; include ("includes/print-device-graph.php");
- echo("
");
- }
-
- include("graphs/netstats.inc.php");
- include("graphs/uptime.inc.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 = "device_cpu"; include ("includes/print-device-graph.php");
- echo("
");
- if($device[os] == "m0n0wall" || $device[os] == "pfSense" || $device[os] == "Voswall" || $device[monowall]) {
- echo("
IP Statistics
");
- $graph_type = "device_ip"; include ("includes/print-device-graph.php");
- echo("
");
- echo("
Device Uptime
");
- $graph_type = "device_uptime"; include ("includes/print-device-graph.php");
- break;
- }
- if($device['os'] != "NetBSD") {
- echo("
Memory Utilisation
");
- $graph_type = "device_memory"; include ("includes/print-device-graph.php");
- echo("
");
- }
-
- if(mysql_result(mysql_query("SELECT count(storage_id) FROM storage WHERE host_id = '" . $device['device_id'] . "'"),0)) {
- echo("
Storage
");
- $graph_type = "device_hrstorage"; include ("includes/print-device-graph.php");
- echo("
");
- }
-
- if(mysql_result(mysql_query("SELECT count(*) FROM temperature WHERE temp_host = '" . $device['device_id'] . "'"),0)) {
- echo("
Temperatures
");
- $graph_type = "device_temperatures"; include ("includes/print-device-graph.php");
- echo("
");
- }
-
- include("graphs/netstats.inc.php");
- include("graphs/uptime.inc.php");
-
- echo("
System Load
");
- $graph_type = "device_load"; include ("includes/print-device-graph.php");
- echo("
");
- echo("
Users Logged On
");
- $graph_type = "device_hrusers"; include ("includes/print-device-graph.php");
- echo("
");
- echo("
Running Processes
");
- $graph_type = "device_hrprocesses"; include ("includes/print-device-graph.php");
- echo("
");
- break;
-
- case "CatOS":
- break;
-
- case "IOS":
- case "IOS XE":
break;
case "Snom":
echo("
Calls
");
$graph_type = "snom_calls"; include ("includes/print-device-graph.php");
}
+}
+
if($memgraph) {
echo("

");
}
diff --git a/html/pages/device/graphs/cpu.inc.php b/html/pages/device/graphs/cpu.inc.php
new file mode 100644
index 000000000..e10347e58
--- /dev/null
+++ b/html/pages/device/graphs/cpu.inc.php
@@ -0,0 +1,7 @@
+Processor Utilisation
");
+ $graph_type = "device_cpu"; include ("includes/print-device-graph.php");
+
+
+?>
diff --git a/html/pages/device/graphs/hrprocesses.inc.php b/html/pages/device/graphs/hrprocesses.inc.php
new file mode 100644
index 000000000..c441e732e
--- /dev/null
+++ b/html/pages/device/graphs/hrprocesses.inc.php
@@ -0,0 +1,5 @@
+Running Processes");
+ $graph_type = "device_hrprocesses"; include ("includes/print-device-graph.php");
+ echo("
");
+?>
diff --git a/html/pages/device/graphs/hrstorage.inc.php b/html/pages/device/graphs/hrstorage.inc.php
new file mode 100644
index 000000000..063d82071
--- /dev/null
+++ b/html/pages/device/graphs/hrstorage.inc.php
@@ -0,0 +1,9 @@
+Storage");
+ $graph_type = "device_hrstorage"; include ("includes/print-device-graph.php");
+ echo("
");
+ }
+
+?>
diff --git a/html/pages/device/graphs/hrusers.inc.php b/html/pages/device/graphs/hrusers.inc.php
new file mode 100644
index 000000000..117a169b6
--- /dev/null
+++ b/html/pages/device/graphs/hrusers.inc.php
@@ -0,0 +1,5 @@
+Users Logged On");
+$graph_type = "device_hrusers"; include ("includes/print-device-graph.php");
+echo("
");
+?>
diff --git a/html/pages/device/graphs/laload.inc.php b/html/pages/device/graphs/laload.inc.php
new file mode 100644
index 000000000..2c131010f
--- /dev/null
+++ b/html/pages/device/graphs/laload.inc.php
@@ -0,0 +1,8 @@
+System Load");
+ $graph_type = "device_load"; include ("includes/print-device-graph.php");
+ echo("
");
+
+
+?>
diff --git a/html/pages/device/graphs/memory.inc.php b/html/pages/device/graphs/memory.inc.php
new file mode 100644
index 000000000..5c4a082c7
--- /dev/null
+++ b/html/pages/device/graphs/memory.inc.php
@@ -0,0 +1,5 @@
+Memory Utilisation");
+ $graph_type = "device_memory"; include ("includes/print-device-graph.php");
+ echo("
");
+?>
diff --git a/html/pages/device/graphs/netstats.inc.php b/html/pages/device/graphs/netstats.inc.php
index 564ff88de..55379bd77 100644
--- a/html/pages/device/graphs/netstats.inc.php
+++ b/html/pages/device/graphs/netstats.inc.php
@@ -19,5 +19,4 @@
$graph_type = "device_icmp_informational"; include ("includes/print-device-graph.php");
echo("
");
-
?>
diff --git a/html/pages/device/graphs/os-ios.inc.php b/html/pages/device/graphs/os-ios.inc.php
index a406a3c71..5c338a683 100644
--- a/html/pages/device/graphs/os-ios.inc.php
+++ b/html/pages/device/graphs/os-ios.inc.php
@@ -1,18 +1,12 @@
CPU Usage");
-$graph_type = "device_cpu"; include ("includes/print-device-graph.php");
-echo("
");
-echo("Memory Usage
");
-$graph_type = "device_memory"; include ("includes/print-device-graph.php");
-echo("
");
-if(mysql_result(mysql_query("SELECT count(*) FROM temperature WHERE temp_host = '" . $device['device_id'] . "'"),0)) {
- echo("Temperatures
");
- $graph_type = "device_temperatures"; include ("includes/print-device-graph.php");
- echo("
");
-}
-
+include("cpu.inc.php");
+include("memory.inc.php");
+include("temperatures.inc.php");
+include("netstats.inc.php");
+include("uptime.inc.php");
include("netstats.inc.php");
include("uptime.inc.php");
+
?>
diff --git a/html/pages/device/graphs/os-ios_xe.inc.php b/html/pages/device/graphs/os-ios_xe.inc.php
deleted file mode 100644
index 96c4a952f..000000000
--- a/html/pages/device/graphs/os-ios_xe.inc.php
+++ /dev/null
@@ -1,5 +0,0 @@
-
diff --git a/html/pages/device/graphs/os-junos.inc.php b/html/pages/device/graphs/os-junos.inc.php
new file mode 100644
index 000000000..3e35c6013
--- /dev/null
+++ b/html/pages/device/graphs/os-junos.inc.php
@@ -0,0 +1,6 @@
+
diff --git a/html/pages/device/graphs/os-linux.inc.php b/html/pages/device/graphs/os-linux.inc.php
deleted file mode 100644
index d447d8e98..000000000
--- a/html/pages/device/graphs/os-linux.inc.php
+++ /dev/null
@@ -1,5 +0,0 @@
-
diff --git a/html/pages/device/graphs/os-unix.inc.php b/html/pages/device/graphs/os-unix.inc.php
index 6eff33c4e..bcaeebac2 100644
--- a/html/pages/device/graphs/os-unix.inc.php
+++ b/html/pages/device/graphs/os-unix.inc.php
@@ -1,4 +1,13 @@
diff --git a/html/pages/device/graphs/os-windows.inc.php b/html/pages/device/graphs/os-windows.inc.php
new file mode 100644
index 000000000..df29285a0
--- /dev/null
+++ b/html/pages/device/graphs/os-windows.inc.php
@@ -0,0 +1,18 @@
+
diff --git a/html/pages/device/graphs/temperatures.inc.php b/html/pages/device/graphs/temperatures.inc.php
new file mode 100644
index 000000000..9cd87a5fb
--- /dev/null
+++ b/html/pages/device/graphs/temperatures.inc.php
@@ -0,0 +1,7 @@
+Temperatures");
+ $graph_type = "device_temperatures"; include ("includes/print-device-graph.php");
+ echo("
");
+}
+?>
diff --git a/html/pages/device/graphs/uptime.inc.php b/html/pages/device/graphs/uptime.inc.php
index d9564a1c0..c13d5318c 100644
--- a/html/pages/device/graphs/uptime.inc.php
+++ b/html/pages/device/graphs/uptime.inc.php
@@ -1,8 +1,5 @@
Device Uptime");
$graph_type = "device_uptime"; include ("includes/print-device-graph.php");
echo("
");
-
-
?>
diff --git a/html/pages/front/default.php b/html/pages/front/default.php
index c089d544b..bce44fdb2 100644
--- a/html/pages/front/default.php
+++ b/html/pages/front/default.php
@@ -68,13 +68,11 @@ while($peer = mysql_fetch_array($sql)){
}
-$sql = mysql_query("SELECT * FROM `devices` AS D, devices_attribs AS A WHERE A.device_id = D.device_id AND A.attrib_type = 'uptime' AND A.attrib_value < '84600'");
+$sql = mysql_query("SELECT * FROM `devices` WHERE status = '1' AND `uptime` < '84600'");
while($device = mysql_fetch_array($sql)){
-
-
generate_front_box("info", "".generatedevicelink($device, shorthost($device['hostname']))."
Device
Rebooted
- ".formatUptime($device['attrib_value'], 'short')."
+ ".formatUptime($device['uptime'], 'short')."
");
}
diff --git a/html/pages/front/demo.php b/html/pages/front/demo.php
index 8e23dc00c..5ef2ace91 100644
--- a/html/pages/front/demo.php
+++ b/html/pages/front/demo.php
@@ -7,24 +7,6 @@
?>
'0' AND A.attrib_value < '86400'");
-
-while($device = mysql_fetch_array($sql)){
- unset($already);
- $i = 0;
- while ($i <= count($nodes)) {
- $thisnode = $device['device_id'];
- if ($nodes[$i] == $thisnode) {
- $already = "yes";
- }
- $i++;
- }
- if(!$already) { $nodes[] = $device['device_id']; }
-}
-
-
$sql = mysql_query("SELECT * FROM `devices` WHERE `status` = '0' AND `ignore` = '0'");
while($device = mysql_fetch_array($sql)){
@@ -72,15 +54,13 @@ while($peer = mysql_fetch_array($sql)){
}
-$sql = mysql_query("SELECT * FROM `devices` AS D, devices_attribs AS A WHERE A.device_id = D.device_id AND D.status = '1' AND A.attrib_type = 'uptime' AND A.attrib_value < '84600'");
+$sql = mysql_query("SELECT * FROM `devices` WHERE status = '1' AND `uptime` < '84600'");
while($device = mysql_fetch_array($sql)){
-
echo("
".generatedevicelink($device, shorthost($device['hostname']))."
Device
Rebooted
- ".formatUptime($device['attrib_value'])."
+ ".formatUptime($device['uptime'])."
");
-
}
diff --git a/includes/discovery/bgp-peers.php b/includes/discovery/bgp-peers.php
index 14ebc9bf3..ae88d525a 100755
--- a/includes/discovery/bgp-peers.php
+++ b/includes/discovery/bgp-peers.php
@@ -36,8 +36,8 @@
$update = mysql_query("UPDATE `bgpPeers` SET astext = '$astext' WHERE `device_id` = '".$device['device_id']."' AND bgpPeerIdentifier = '$peer_ip'");
}
- ## Get afi/safi and populate cbgp on cisco IOS
- if($device['os'] == "IOS" || $device['os'] == "IOS XE") {
+ ## Get afi/safi and populate cbgp on cisco ios (xe/xr)
+ if($device['os_type'] == "ios") {
unset($af_list);
$af_cmd = $config['snmpwalk'] . " -CI -m CISCO-BGP4-MIB -OsQ -" . $device['snmpver'] . " -c" . $device['community'] . " " . $device['hostname'].":".$device['port'] . " ";
$af_cmd .= "cbgpPeerAddrFamilyName." . $peer_ip;
@@ -61,7 +61,7 @@
mysql_query("DELETE FROM `bgpPeers_cbgp` WHERE `device_id` = '".$device['device_id']."' AND bgpPeerIdentifier = '$peer_ip' AND afi = '$afi' AND safi = '$safi'");
}
} # AF list
- } # if IOS
+ } # if os_type = ios
} # If Peer
} # Foreach
} else {
diff --git a/includes/discovery/cemp-mib.php b/includes/discovery/cemp-mib.php
index 2b6813284..c75a4278c 100755
--- a/includes/discovery/cemp-mib.php
+++ b/includes/discovery/cemp-mib.php
@@ -8,7 +8,7 @@
echo("CISCO-ENHANCED-MEMORY-POOL : ");
## Cisco Enhanced Mempool
- if($device['os'] == "IOS" || $device['os'] == "IOS XE") {
+ if($device['os_type'] == "ios") {
$oids = shell_exec($config['snmpwalk'] . " -m CISCO-ENHANCED-MEMPOOL-MIB -v2c -CI -Osq -c ".$community." ".$hostname.":".$port." cempMemPoolName | sed s/cempMemPoolName.//g");
$oids = trim($oids);
diff --git a/includes/discovery/cisco-processors.php b/includes/discovery/cisco-processors.php
index 18174fbb6..8dbb6d525 100755
--- a/includes/discovery/cisco-processors.php
+++ b/includes/discovery/cisco-processors.php
@@ -8,7 +8,7 @@
echo("CISCO-PROCESS-MIB : ");
## Cisco Processors
- if($device['os'] == "IOS" || $device['os'] == "IOS XE") {
+ if($device['os_type'] == "ios") {
$oids = shell_exec($config['snmpwalk'] . " -m CISCO-PROCESS-MIB -v2c -CI -Osqn -c ".$community." ".$hostname.":".$port." .1.3.6.1.4.1.9.9.109.1.1.1.1.2 | sed s/.1.3.6.1.4.1.9.9.109.1.1.1.1.2.//g");
$oids = trim($oids);
foreach(explode("\n", $oids) as $data) {
diff --git a/includes/discovery/entity-physical.inc.php b/includes/discovery/entity-physical.inc.php
index ddbb3ce1f..49530ec67 100755
--- a/includes/discovery/entity-physical.inc.php
+++ b/includes/discovery/entity-physical.inc.php
@@ -7,9 +7,11 @@
if($config['enable_inventory']) {
$empty = array();
- $entity_array = snmpwalk_cache_oid("entityPhysical", $device, $empty, "ENTITY-MIB");
+ $entity_array = snmpwalk_cache_oid("entPhysicalEntry", $device, $empty, "ENTITY-MIB");
$entity_array = snmpwalk_cache_oid("entSensorValues", $device, $entity_array, "CISCO-ENTITY-SENSOR-MIB");
+ if(!$entity_array[$device[device_id]]) { $entity_array[$device[device_id]] = array(); }
+
foreach($entity_array[$device[device_id]] as $entPhysicalIndex => $entry) {
$entPhysicalDescr = $entry['entPhysicalDescr'];
@@ -21,6 +23,13 @@
$entPhysicalMfgName = $entry['entPhysicalMfgName'];
$entPhysicalVendorType = $entry['entPhysicalVendorType'];
$entPhysicalParentRelPos = $entry['entPhysicalParentRelPos'];
+ $entPhysicalHardwareRev = $entry['entPhysicalHardwareRev'];
+ $entPhysicalFirmwareRev = $entry['entPhysicalFirmwareRev'];
+ $entPhysicalSoftwareRev = $entry['entPhysicalSoftwareRev'];
+ $entPhysicalIsFRU = $entry['entPhysicalIsFRU'];
+ $entPhysicalAlias = $entry['entPhysicalAlias'];
+ $entPhysicalAssetID = $entry['entPhysicalAssetID'];
+
$ent_data = $config['snmpget'] . " -m ENTITY-MIB:IF-MIB -Ovqs -";
$ent_data .= $device['snmpver'] . " -c " . $device['community'] . " " . $device['hostname'] .":".$device['port'];
@@ -42,25 +51,21 @@
$sql .= ", entPhysicalIndex = '$entPhysicalIndex', entPhysicalDescr = '$entPhysicalDescr', entPhysicalClass = '$entPhysicalClass', entPhysicalName = '$entPhysicalName'";
$sql .= ", entPhysicalModelName = '$entPhysicalModelName', entPhysicalSerialNum = '$entPhysicalSerialNum', entPhysicalContainedIn = '$entPhysicalContainedIn'";
$sql .= ", entPhysicalMfgName = '$entPhysicalMfgName', entPhysicalParentRelPos = '$entPhysicalParentRelPos', entPhysicalVendorType = '$entPhysicalVendorType'";
+ $sql .= ", entPhysicalHardwareRev = '$entPhysicalHardwareRev', entPhysicalFirmwareRev = '$entPhysicalFirmwareRev', entPhysicalSoftwareRev = '$entPhysicalSoftwareRev'";
+ $sql .= ", entPhysicalIsFRU = '$entPhysicalIsFRU', entPhysicalAlias = '$entPhysicalAlias', entPhysicalAssetID = '$entPhysicalAssetID'";
$sql .= " WHERE device_id = '".$device['device_id']."' AND entPhysicalIndex = '$entPhysicalIndex'";
mysql_query($sql);
echo(".");
} else {
- $sql = "INSERT INTO `entPhysical` ( `device_id` , `entPhysicalIndex` , `entPhysicalDescr` , `entPhysicalClass` , `entPhysicalName` , `entPhysicalModelName` , `entPhysicalSerialNum` , `entPhysicalContainedIn`, `entPhysicalMfgName`, `entPhysicalParentRelPos`, `entPhysicalVendorType`, `ifIndex` ) ";
- $sql .= "VALUES ( '" . $device['device_id'] . "', '$entPhysicalIndex', '$entPhysicalDescr', '$entPhysicalClass', '$entPhysicalName', '$entPhysicalModelName', '$entPhysicalSerialNum', '$entPhysicalContainedIn', '$entPhysicalMfgName','$entPhysicalParentRelPos' , '$entPhysicalVendorType', '$ifIndex')";
+ $sql = "INSERT INTO `entPhysical` ( `device_id` , `entPhysicalIndex` , `entPhysicalDescr` , `entPhysicalClass` , `entPhysicalName` , `entPhysicalModelName` , `entPhysicalSerialNum` , `entPhysicalContainedIn`, `entPhysicalMfgName`, `entPhysicalParentRelPos`, `entPhysicalVendorType`, `entPhysicalHardwareRev`,`entPhysicalFirmwareRev`,`entPhysicalSoftwareRev`,`entPhysicalIsFRU`,`entPhysicalAlias`,`entPhysicalAssetID`, `ifIndex` ) ";
+ $sql .= "VALUES ( '" . $device['device_id'] . "', '$entPhysicalIndex', '$entPhysicalDescr', '$entPhysicalClass', '$entPhysicalName', '$entPhysicalModelName', '$entPhysicalSerialNum', '$entPhysicalContainedIn', '$entPhysicalMfgName','$entPhysicalParentRelPos' , '$entPhysicalVendorType', '$entPhysicalHardwareRev', '$entPhysicalFirmwareRev', '$entPhysicalSoftwareRev', '$entPhysicalIsFRU', '$entPhysicalAlias', '$entPhysicalAssetID', '$ifIndex')";
mysql_query($sql);
echo("+");
}
if($entPhysicalClass == "sensor") {
-# $sensor_cmd = $config['snmpget'] . " -m CISCO-ENTITY-SENSOR-MIB -O Uqnv -" . $device['snmpver'] . " -c " . $device['community'] . " " . $device['hostname'].":".$device['port'];
-# $sensor_cmd .= " entSensorType.$entPhysicalIndex entSensorScale.$entPhysicalIndex entSensorPrecision.$entPhysicalIndex";
-# $sensor_cmd .= " entSensorValueUpdateRate.$entPhysicalIndex entSensorMeasuredEntity.$entPhysicalIndex";
-# $sensor_data = shell_exec($sensor_cmd);
-# list($entSensorType,$entSensorScale,$entSensorPrecision,$entSensorValueUpdateRate,$entSensorMeasuredEntity) = explode("\n", $sensor_data);
-
$entSensorType = $entry['entSensorType'];
$entSensorScale = $entry['entSensorScale'];
$entSensorPrecision = $entry['entSensorPrecision'];
diff --git a/includes/discovery/ipv4-addresses.php b/includes/discovery/ipv4-addresses.php
index 3ad49a52f..47f220886 100755
--- a/includes/discovery/ipv4-addresses.php
+++ b/includes/discovery/ipv4-addresses.php
@@ -14,17 +14,14 @@
list($net,$cidr) = explode("/", $network);
$cidr = trim($cidr);
if($mask == "255.255.255.255") { $cidr = "32"; $network = "$oid/$cidr"; }
-
- if (mysql_result(mysql_query("SELECT count(*) FROM `interfaces` WHERE device_id = '".$device['device_id']."' AND `ifIndex` = '$ifIndex'"), 0) != '0') {
+ if (mysql_result(mysql_query("SELECT count(*) FROM `interfaces` WHERE device_id = '".$device['device_id']."' AND `ifIndex` = '$ifIndex'"), 0) != '0' && $oid != "0.0.0.0") {
$i_query = "SELECT interface_id FROM `interfaces` WHERE device_id = '".$device['device_id']."' AND `ifIndex` = '$ifIndex'";
$interface_id = mysql_result(mysql_query($i_query), 0);
-
if (mysql_result(mysql_query("SELECT COUNT(*) FROM `ipv4_networks` WHERE `ipv4_network` = '$network'"), 0) < '1') {
mysql_query("INSERT INTO `ipv4_networks` (`ipv4_network`) VALUES ('$network')");
#echo("Create Subnet $network\n");
echo("S");
}
-
$ipv4_network_id = @mysql_result(mysql_query("SELECT `ipv4_network_id` from `ipv4_networks` WHERE `ipv4_network` = '$network'"), 0);
if (mysql_result(mysql_query("SELECT COUNT(*) FROM `ipv4_addresses` WHERE `ipv4_address` = '$oid' AND `ipv4_prefixlen` = '$cidr' AND `interface_id` = '$interface_id'"), 0) == '0') {
@@ -32,10 +29,8 @@
#echo("Added $oid/$cidr to $interface_id ( $hostname $ifIndex )\n $i_query\n");
echo("+");
} else { echo("."); }
-
$full_address = "$oid/$cidr|$ifIndex";
$valid_v4[$full_address] = 1;
-
} else { echo("!"); }
}
diff --git a/includes/discovery/ipv6-addresses.php b/includes/discovery/ipv6-addresses.php
index 1715cb71d..07fa71f8e 100644
--- a/includes/discovery/ipv6-addresses.php
+++ b/includes/discovery/ipv6-addresses.php
@@ -2,9 +2,9 @@
echo("IPv6 Addresses : ");
-$ipv6interfaces = shell_exec($config['snmpget']." -m IPV6-MIB -Ovnq -".$device['snmpver']." -c ".$device['community']." ".$device['hostname'].":".$device['port']." ipv6Interfaces.0");
+#$ipv6interfaces = shell_exec($config['snmpget']." -m IPV6-MIB -Ovnq -".$device['snmpver']." -c ".$device['community']." ".$device['hostname'].":".$device['port']." ipv6Interfaces.0");
-if($ipv6interfaces){
+#if($ipv6interfaces){
$cmd = $config['snmpwalk']." -m IP-MIB -".$device['snmpver']." -Ln -c ".$device['community']." ".$device['hostname'].":".$device['port'];
$cmd .= " ipAddressIfIndex.ipv6 -Osq | grep -v No";
@@ -58,7 +58,7 @@ if($ipv6interfaces){
}
}
}
-} else { echo("None configured"); }
+#} else { echo("None configured"); }
$sql = "SELECT * FROM ipv6_addresses AS A, interfaces AS I WHERE I.device_id = '".$device['device_id']."' AND A.interface_id = I.interface_id";
$data = mysql_query($sql);
diff --git a/includes/discovery/storage.php b/includes/discovery/storage.php
index 16f57766f..cc4c89237 100755
--- a/includes/discovery/storage.php
+++ b/includes/discovery/storage.php
@@ -22,16 +22,16 @@
}
}
- if(strstr($fstype, "FixedDisk") && $size > '0' && $allow) {
+ if(strstr($fstype, "FixedDisk") || strstr($fstype, "Ram") || strstr($fstype, "VirtualMemory") && $size > '0' && $allow) {
if(mysql_result(mysql_query("SELECT count(storage_id) FROM `storage` WHERE hrStorageIndex = '$hrStorageIndex' AND host_id = '".$device['device_id']."'"),0) == '0') {
- $query = "INSERT INTO storage (`host_id`, `hrStorageIndex`, `hrStorageDescr`,`hrStorageSize`,`hrStorageAllocationUnits`) ";
- $query .= "values ('".$device['device_id']."', '$hrStorageIndex', '$descr', '$size', '$units')";
+ $query = "INSERT INTO storage (`host_id`, `hrStorageIndex`, `hrStorageType`, `hrStorageDescr`,`hrStorageSize`,`hrStorageAllocationUnits`) ";
+ $query .= "values ('".$device['device_id']."', '$hrStorageIndex', '$fstype', '$descr', '$size', '$units')";
mysql_query($query);
echo("+");
} else {
$data = mysql_fetch_array(mysql_query("SELECT * FROM `storage` WHERE hrStorageIndex = '$hrStorageIndex' AND host_id = '".$device['device_id']."'"));
if($data['hrStorageDescr'] != $descr || $data['hrStorageSize'] != $size || $data['hrStorageAllocationUnits'] != $units ) {
- $query = "UPDATE storage SET `hrStorageDescr` = '$descr', `hrStorageSize` = '$size', `hrStorageAllocationUnits` = '$units' ";
+ $query = "UPDATE storage SET `hrStorageDescr` = '$descr', `hrStorageType` = '$fstype', `hrStorageSize` = '$size', `hrStorageAllocationUnits` = '$units' ";
$query .= "WHERE hrStorageIndex = '$hrStorageIndex' AND host_id = '".$device['device_id']."'";
echo("U");
mysql_query($query);
diff --git a/includes/discovery/temperatures.php b/includes/discovery/temperatures.php
index f73dcfaab..69c50194d 100755
--- a/includes/discovery/temperatures.php
+++ b/includes/discovery/temperatures.php
@@ -92,7 +92,7 @@
## Cisco Temperatures
- if($device['os'] == "IOS" || $device['os'] == "IOS XE") {
+ if($device['os_type'] == "ios") {
echo("Cisco ");
$oids = shell_exec($config['snmpwalk'] . " -m CISCO-ENVMON-MIB -$snmpver -CI -Osqn -c $community $hostname:$port .1.3.6.1.4.1.9.9.13.1.3.1.2 | sed s/.1.3.6.1.4.1.9.9.13.1.3.1.2.//g");
$oids = trim($oids);
diff --git a/includes/functions-poller.inc.php b/includes/functions-poller.inc.php
index de824c4af..bed68a58a 100644
--- a/includes/functions-poller.inc.php
+++ b/includes/functions-poller.inc.php
@@ -50,12 +50,12 @@ global $config;
return $array;
}
-function snmpwalk_cache_oid($oid, $device, $array, $mib = 0) {
+function snmpwalk_cache_oid($poll_oid, $device, $array, $mib = 0) {
global $config;
$cmd = $config['snmpbulkwalk'] . " -O Qs -" . $device['snmpver'] . " -c " . $device['community'] . " " .
$device['hostname'].":".$device['port'] . " ";
if($mib) { $cmd .= "-m $mib "; }
- $cmd .= $oid;
+ $cmd .= $poll_oid;
$data = trim(shell_exec($cmd));
$device_id = $device['device_id'];
foreach(explode("\n", $data) as $entry) {
diff --git a/includes/functions.php b/includes/functions.php
index fda760a9e..03384988b 100755
--- a/includes/functions.php
+++ b/includes/functions.php
@@ -109,9 +109,9 @@ function device_array($device_id) {
return $device;
}
-function getHostOS($hostname, $community, $snmpver, $port) {
+function getHostOS($device) {
global $config;
- $sysDescr_cmd = $config['snmpget']." -m SNMPv2-MIB -O qv -" . $snmpver . " -c " . $community . " " . $hostname.":".$port . " sysDescr.0";
+ $sysDescr_cmd = $config['snmpget']." -m SNMPv2-MIB -O qv -" . $device['snmpver'] . " -c " . $device['community'] . " " . $device['hostname'].":".$device['port'] . " sysDescr.0";
$sysDescr = str_replace("\"", "", trim(shell_exec($sysDescr_cmd)));
$dir_handle = @opendir($config['install_dir'] . "/includes/osdiscovery") or die("Unable to open $path");
while ($file = readdir($dir_handle)) {
@@ -628,7 +628,8 @@ function fixIOSHardware($hardware){
function createHost ($host, $community, $snmpver, $port = 161){
$host = trim(strtolower($host));
- $host_os = getHostOS($host, $community, $snmpver, $port);
+ $device = array('hostname' => $host, 'community' => $community, 'snmpver' => $snmpver, 'port' => $port);
+ $host_os = getHostOS($device);
if($host_os) {
$sql = mysql_query("INSERT INTO `devices` (`hostname`, `sysName`, `community`, `port`, `os`, `status`) VALUES ('$host', '$host', '$community', '$port', '$host_os', '1')");
if(mysql_affected_rows()) {
diff --git a/includes/osdiscovery/discover-asa.php b/includes/osdiscovery/discover-asa.php
index 45b61ec63..fcec461c9 100755
--- a/includes/osdiscovery/discover-asa.php
+++ b/includes/osdiscovery/discover-asa.php
@@ -1,7 +1,7 @@
diff --git a/includes/osdiscovery/discover-catos.php b/includes/osdiscovery/discover-catos.php
index 51798db15..62c639a81 100755
--- a/includes/osdiscovery/discover-catos.php
+++ b/includes/osdiscovery/discover-catos.php
@@ -2,7 +2,7 @@
if(!$os) {
- if(strstr($sysDescr, "Cisco Catalyst Operating System Software")) { $os = "CatOS"; }
+ if(strstr($sysDescr, "Cisco Catalyst Operating System Software")) { $os = "catos"; }
}
diff --git a/includes/osdiscovery/discover-fortigate.php b/includes/osdiscovery/discover-fortigate.php
index 143ea02ca..d90e5cb63 100755
--- a/includes/osdiscovery/discover-fortigate.php
+++ b/includes/osdiscovery/discover-fortigate.php
@@ -1,15 +1,10 @@
diff --git a/includes/osdiscovery/discover-freebsd.php b/includes/osdiscovery/discover-freebsd.php
index be6870f2c..34bed8bfa 100755
--- a/includes/osdiscovery/discover-freebsd.php
+++ b/includes/osdiscovery/discover-freebsd.php
@@ -1,8 +1,8 @@
diff --git a/includes/osdiscovery/discover-ios.php b/includes/osdiscovery/discover-ios.php
index a383af694..9db9bd29c 100755
--- a/includes/osdiscovery/discover-ios.php
+++ b/includes/osdiscovery/discover-ios.php
@@ -2,10 +2,11 @@
if(!$os) {
- if(strstr($sysDescr, "Cisco Internetwork Operating System Software")) { $os = "IOS"; }
- if(strstr($sysDescr, "IOS (tm)")) { $os = "IOS"; }
- if(strstr($sysDescr, "Cisco IOS Software")) { $os = "IOS"; }
- if(strstr($sysDescr, "IOS-XE")) { $os = "IOS XE"; }
+ if(strstr($sysDescr, "Cisco Internetwork Operating System Software")) { $os = "ios"; }
+ if(strstr($sysDescr, "IOS (tm)")) { $os = "ios"; }
+ if(strstr($sysDescr, "Cisco IOS Software")) { $os = "ios"; }
+ if(strstr($sysDescr, "IOS-XE")) { $os = "iosxe"; }
+ if(strstr($sysDescr, "IOS XR")) { $os = "iosxr"; }
}
diff --git a/includes/osdiscovery/discover-junos.php b/includes/osdiscovery/discover-junos.php
index 896fecbfc..fef8c26c9 100755
--- a/includes/osdiscovery/discover-junos.php
+++ b/includes/osdiscovery/discover-junos.php
@@ -2,8 +2,8 @@
if(!$os) {
- $sysObjectId = shell_exec($config['snmpget'] . " -Ovqn -v2c -c ". $community ." ". $hostname.":".$port ." sysObjectID.0");
- if(strstr($sysObjectId, ".1.3.6.1.4.1.2636")) { $os = "JunOS"; }
+ $sysObjectId = shell_exec($config['snmpget'] . " -Ovqn -".$device['snmpver']." -c ". $device['community'] ." ". $device['hostname'].":".$device['port'] ." sysObjectID.0");
+ if(strstr($sysObjectId, ".1.3.6.1.4.1.2636")) { $os = "junos"; }
}
diff --git a/includes/osdiscovery/discover-linux.php b/includes/osdiscovery/discover-linux.php
index 51b9b60a2..11bec22aa 100755
--- a/includes/osdiscovery/discover-linux.php
+++ b/includes/osdiscovery/discover-linux.php
@@ -1,7 +1,7 @@
diff --git a/includes/osdiscovery/discover-m0n0wall.php b/includes/osdiscovery/discover-m0n0wall.php
index b5c686e27..6eff33c4e 100755
--- a/includes/osdiscovery/discover-m0n0wall.php
+++ b/includes/osdiscovery/discover-m0n0wall.php
@@ -1,12 +1,4 @@
diff --git a/includes/osdiscovery/discover-netbsd.php b/includes/osdiscovery/discover-netbsd.php
index d5a03f320..220211d97 100755
--- a/includes/osdiscovery/discover-netbsd.php
+++ b/includes/osdiscovery/discover-netbsd.php
@@ -1,7 +1,7 @@
diff --git a/includes/osdiscovery/discover-openbsd.php b/includes/osdiscovery/discover-openbsd.php
index e43cefc7b..427207bec 100755
--- a/includes/osdiscovery/discover-openbsd.php
+++ b/includes/osdiscovery/discover-openbsd.php
@@ -1,7 +1,7 @@
diff --git a/includes/osdiscovery/discover-powerconnect.php b/includes/osdiscovery/discover-powerconnect.php
new file mode 100755
index 000000000..c7582bb11
--- /dev/null
+++ b/includes/osdiscovery/discover-powerconnect.php
@@ -0,0 +1,9 @@
+
diff --git a/includes/osdiscovery/discover-screenos.php b/includes/osdiscovery/discover-screenos.php
index 6ea05a5cf..91feef97c 100755
--- a/includes/osdiscovery/discover-screenos.php
+++ b/includes/osdiscovery/discover-screenos.php
@@ -2,9 +2,8 @@
if(!$os) {
-var_dump($port);
- $sysObjectId = shell_exec($config['snmpget'] . " -Ovq -v2c -c ". $community ." ". $hostname.":".$port ." .1.3.6.1.2.1.1.2.0");
- if(strstr($sysObjectId, "netscreen")) { $os = "ScreenOS"; } elseif (strstr($sysObjectId, "enterprises.3224.1")) { $os = "ScreenOS"; }
+ $sysObjectId = shell_exec($config['snmpget'] . " -Ovq -".$device['snmpver']." -c ". $device['community'] ." ". $device['hostname'].":".$device['port'] ." .1.3.6.1.2.1.1.2.0");
+ if(strstr($sysObjectId, "netscreen")) { $os = "screenos"; } elseif (strstr($sysObjectId, "enterprises.3224.1")) { $os = "screenos"; }
}
diff --git a/includes/osdiscovery/discover-windows.php b/includes/osdiscovery/discover-windows.php
index 100e888fb..3f34d13d5 100644
--- a/includes/osdiscovery/discover-windows.php
+++ b/includes/osdiscovery/discover-windows.php
@@ -1,7 +1,7 @@
diff --git a/includes/polling/bgpPeer.inc.php b/includes/polling/bgpPeer.inc.php
index d89fcd1ac..916e2a7c8 100755
--- a/includes/polling/bgpPeer.inc.php
+++ b/includes/polling/bgpPeer.inc.php
@@ -44,7 +44,7 @@ while($peer = mysql_fetch_array($peers)) {
mysql_query($update);
- if($device['os'] == "IOS" || $device['os'] == "IOS XE") {
+ if($device['os_group'] == "ios") {
## Poll each AFI/SAFI for this peer (using CISCO-BGP4-MIB)
$afi_query = mysql_query("SELECT * FROM bgpPeers_cbgp WHERE `device_id` = '".$device['device_id']."' AND bgpPeerIdentifier = '" . $peer['bgpPeerIdentifier'] . "'");
diff --git a/includes/polling/cisco-poe.inc.php b/includes/polling/cisco-poe.inc.php
index 323157777..17ff5f08a 100644
--- a/includes/polling/cisco-poe.inc.php
+++ b/includes/polling/cisco-poe.inc.php
@@ -1,6 +1,6 @@
diff --git a/includes/polling/interfaces.inc.php b/includes/polling/interfaces.inc.php
index 5c72bbcf6..d274ec578 100644
--- a/includes/polling/interfaces.inc.php
+++ b/includes/polling/interfaces.inc.php
@@ -1,6 +1,6 @@
$stats) {
+
+ echo("$af ");
+
+ $oids = array('ipSystemStatsInReceives','ipSystemStatsInHdrErrors','ipSystemStatsInAddrErrors','ipSystemStatsInUnknownProtos','ipSystemStatsInForwDatagrams','ipSystemStatsReasmReqds',
+ 'ipSystemStatsReasmOKs','ipSystemStatsReasmFails','ipSystemStatsInDiscards','ipSystemStatsInDelivers','ipSystemStatsOutRequests','ipSystemStatsOutNoRoutes','ipSystemStatsOutDiscards',
+ 'ipSystemStatsOutFragFails','ipSystemStatsOutFragCreates','ipSystemStatsOutForwDatagrams');
+
+ if(isset($stats['ipSystemStatsHCInReceives'])) { $stats['ipSystemStatsInReceives'] = $stats['ipSystemStatsHCInReceives']; }
+ if(isset($stats['ipSystemStatsHCInForwDatagrams'])) { $stats['ipSystemStatsInForwDatagrams'] = $stats['ipSystemStatsHCInForwDatagrams']; }
+ if(isset($stats['ipSystemStatsHCInDelivers'])) { $stats['ipSystemStatsInDelivers'] = $stats['ipSystemStatsHCInDelivers']; }
+ if(isset($stats['ipSystemStatsHCOutRequests'])) { $stats['ipSystemStatsOutRequests'] = $stats['ipSystemStatsHCOutRequests']; }
+ if(isset($stats['ipSystemStatsHCOutForwDatagrams'])) { $stats['ipSystemStatsOutForwDatagrams'] = $stats['ipSystemStatsHCOutForwDatagrams']; }
+
+ unset($snmpstring, $rrdupdate, $snmpdata, $snmpdata_cmd, $rrd_create);
+
+ $rrdfile = $config['rrd_dir'] . "/" . $device['hostname'] . "/ipSystemStats-".$af.".rrd";
+
+ $rrd_create = $config['rrdtool'] . " create $rrdfile ";
+ $rrd_create .= "RRA:AVERAGE:0.5:1:600 RRA:AVERAGE:0.5:6:700 RRA:AVERAGE:0.5:24:775 RRA:AVERAGE:0.5:288:797 RRA:MAX:0.5:1:600 RRA:MAX:0.5:6:700 RRA:MAX:0.5:24:775 RRA:MAX:0.5:288:797";
+
+ $rrdupdate = "N";
+
+ foreach($oids as $oid){
+ $oid_ds = str_replace("ipSystemStats", "", $oid);
+ $oid_ds = truncate($oid_ds, 19, '');
+ $rrd_create .= " DS:$oid_ds:COUNTER:600:U:100000000000";
+ $snmpstring .= " $oid.0";
+ if(strstr($stats[$oid], "No") || strstr($stats[$oid], "d") || strstr($stats[$oid], "s")) { $stats[$oid] = "0"; }
+ $rrdupdate .= ":".$stats[$oid];
+ }
+ if(!file_exists($rrdfile)) { shell_exec($rrd_create); }
+
+ rrdtool_update($rrdfile, $rrdupdate);
+
+ unset($snmpstring, $rrdupdate, $snmpdata, $snmpdata_cmd, $rrd_create);
+ }
+
+echo("\n");
+
+
+?>
diff --git a/includes/polling/ports.inc.php b/includes/polling/ports.inc.php
index f4532e2fa..c7bb71b68 100755
--- a/includes/polling/ports.inc.php
+++ b/includes/polling/ports.inc.php
@@ -38,7 +38,7 @@
#foreach ($cisco_oids as $oid) { $array = snmp_cache_oid($oid, $device, $array, "OLD-CISCO-INTERFACES-MIB"); }
#foreach ($pagp_oids as $oid) { $array = snmp_cache_oid($oid, $device, $array, "CISCO-PAGP-MIB"); }
- if($device['os'] == "IOS" || $device['os'] == "CatOS" || $device['os'] == "IOS XE") {
+ if($device['os_group'] == "ios") {
#$array = snmp_cache_portIfIndex ($device, $array);
#$array = snmp_cache_portName ($device, $array);
#$array = snmp_cache_oid("vmVlan", $device, $array, "CISCO-VLAN-MEMBERSHIP-MIB");
diff --git a/includes/static-config.php b/includes/static-config.php
index 3aecd5ac0..994d502a1 100644
--- a/includes/static-config.php
+++ b/includes/static-config.php
@@ -4,6 +4,7 @@
$config['ifname']['asa'] = true;
$config['ifname']['catos'] = true;
$config['ifname']['windows'] = true;
+$config['ifname']['powerconnect'] = true;
## AFI / SAFI pairs for BGP (and other stuff, perhaps)
$config['afi']['ipv4']['unicast'] = "IPv4";
@@ -21,9 +22,30 @@ $os_groups['netbsd'] = "unix";
$os_groups['dragonfly'] = "unix";
$os_groups['solaris'] = "unix";
-$os_groups['ios xe'] = "ios";
+$os_groups['iosxe'] = "ios";
+$os_groups['iosxr'] = "ios";
+$os_groups['ios'] = "ios";
$os_groups['asa'] = "ios";
+##
+$os_text['linux'] = "Linux";
+$os_text['ios'] = "Cisco IOS";
+$os_text['iosxr'] = "Cisco IOS XE";
+$os_text['iosxe'] = "Cisco IOS XR";
+$os_text['catos'] = "Cisco CatOS";
+$os_text['nxos'] = "Cisco NX-OS";
+$os_text['asa'] = "Cisco ASA";
+$os_text['pix'] = "Cisco PIX";
+$os_text['freebsd'] = "FreeBSD";
+$os_text['openbsd'] = "OpenBSD";
+$os_text['netbsd'] = "NetBSD";
+$os_text['dragonflybsd'] = "DragonFlyBSD";
+$os_text['powerconnect'] = "Dell PowerConnect";
+$os_text['windows'] = "Microsoft Windows";
+$os_text['junos'] = "Juniper JunOS";
+$os_text['procurve'] = "HP ProCurve";
+
+
if(!$config['graph_colours']['greens']) {
$config['graph_colours']['greens'] = array('B6D14B','91B13C','6D912D','48721E','24520F','003300');
}
diff --git a/includes/syslog.php b/includes/syslog.php
index 988d28ecc..fa1b3e885 100755
--- a/includes/syslog.php
+++ b/includes/syslog.php
@@ -24,7 +24,7 @@ function process_syslog ($entry, $update) {
if($device_id && !$delete) {
$entry['device_id'] = $device_id;
$os = mysql_result(mysql_query("SELECT `os` FROM `devices` WHERE `device_id` = '$device_id'"),0);
- if($os == "IOS" || $os == "IOS XE") {
+ if($os == "ios" || $os == "iosxe") {
if(strstr($entry[msg], "%")) {
$entry['msg'] = preg_replace("/^%(.+?):\ /", "\\1||", $entry['msg']);
list(,$entry[msg]) = split(": %", $entry['msg']);
diff --git a/map.php b/map.php
index e726ec26d..6b4d27f38 100755
--- a/map.php
+++ b/map.php
@@ -24,7 +24,7 @@ while($loc_data = mysql_fetch_array($loc_result)) {
style=filled;
color=lightgrey;\n\n");
- $dev_sql = "SELECT * FROM devices WHERE location = '" . $loc_data['location'] . "' and `os` LIKE '%IOS%' and disabled = 0";
+ $dev_sql = "SELECT * FROM devices WHERE location = '" . $loc_data['location'] . "' and `os` LIKE '%ios%' and disabled = 0";
$dev_result = mysql_query($dev_sql);
while($dev_data = mysql_fetch_array($dev_result)) {
$device_id = $dev_data['device_id'];
diff --git a/mibs/Dell_vendor.mib b/mibs/Dell_vendor.mib
new file mode 100644
index 000000000..a26052fad
--- /dev/null
+++ b/mibs/Dell_vendor.mib
@@ -0,0 +1,437 @@
+
+Dell-Vendor-MIB DEFINITIONS ::= BEGIN
+
+IMPORTS
+ enterprises, TimeTicks
+ FROM RFC1155-SMI
+ MODULE-IDENTITY, OBJECT-TYPE, Unsigned32, Integer32, IpAddress,
+ NOTIFICATION-TYPE
+ FROM SNMPv2-SMI
+ DisplayString, RowStatus, TEXTUAL-CONVENTION
+ FROM SNMPv2-TC;
+
+
+powerConnect3000MIB MODULE-IDENTITY
+ LAST-UPDATED "200211250000Z"
+ ORGANIZATION "Dell Computer Corporation"
+ CONTACT-INFO
+ "support.dell.com"
+ DESCRIPTION
+ "The private MIB module definition for the Dell powerConnect 3000 Devices."
+ REVISION "200211250000Z"
+ DESCRIPTION
+ "Initial version of this MIB."
+ ::= { enterprises dell(674) dellLan(10895) 3000 }
+
+EnvMonState ::= TEXTUAL-CONVENTION
+ STATUS current
+ DESCRIPTION
+ "Represents the state of a device being monitored.
+ Valid values are:
+
+ normal(1): the environment is good, such as low
+ temperature.
+
+ warning(2): the environment is bad, such as temperature
+ above normal operation range but not too
+ high.
+
+ critical(3): the environment is very bad, such as
+ temperature much higher than normal
+ operation limit.
+
+ shutdown(4): the environment is the worst, the system
+ should be shutdown immediately.
+
+ notPresent(5): the environmental monitor is not present,
+ such as temperature sensors do not exist.
+
+ notFunctioning(6): the environmental monitor does not
+ function properly, such as a temperature
+ sensor generates a abnormal data like
+ 1000 C.
+ "
+ SYNTAX INTEGER {
+ normal(1),
+ warning(2),
+ critical(3),
+ shutdown(4),
+ notPresent(5),
+ notFunctioning(6)
+ }
+
+
+
+dell-VendorMIBObjects OBJECT IDENTIFIER ::= { powerConnect3000MIB 1 }
+dellVendorNotifications OBJECT IDENTIFIER ::= { powerConnect3000MIB 2 }
+
+
+
+hardware OBJECT IDENTIFIER ::= { dell-VendorMIBObjects 2 }
+productIdentification OBJECT IDENTIFIER ::= { hardware 100 }
+productStatus OBJECT IDENTIFIER ::= { hardware 110 }
+
+--
+
+--
+-- productIdentification
+--
+
+
+productIdentificationDisplayName OBJECT-TYPE
+ SYNTAX DisplayString
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION "Name of this product for display purposes."
+ ::= { productIdentification 1}
+
+
+productIdentificationDescription OBJECT-TYPE
+ SYNTAX DisplayString
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION "A short description of this product such as: Ethernet Router Switch."
+ ::= { productIdentification 2}
+
+
+productIdentificationVendor OBJECT-TYPE
+ SYNTAX DisplayString
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION "The name of the product manufacturer, such as: Dell Computer Corp."
+ ::= { productIdentification 3 }
+
+productIdentificationVersion OBJECT-TYPE
+ SYNTAX DisplayString
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION "The version of this product."
+ ::= { productIdentification 4 }
+
+productIdentificationBuildNumber OBJECT-TYPE
+ SYNTAX DisplayString
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION "The software build number of the product."
+ ::= { productIdentification 5 }
+
+
+productIdentificationURL OBJECT-TYPE
+ SYNTAX DisplayString
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION "The URL of the web-based application to manage this device, should the device provide one.
+ The format of the value held by this object is: http://."
+ ::= { productIdentification 6 }
+
+productIdentificationDeviceNetworkName OBJECT-TYPE
+ SYNTAX DisplayString
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION "Device Name."
+ ::= { productIdentification 7 }
+
+
+productIdentificationPerUnitTable OBJECT-TYPE
+ SYNTAX SEQUENCE OF ProductIdentificationPerBoxEntry
+ MAX-ACCESS not-accessible
+ STATUS current
+ DESCRIPTION
+ "Identification specific to product instance and, in case of stackable products, per unit. If the product is not stackable,
+ it will be considered a stack of one unit and therefore this table will contain one conceptual row only."
+ ::= { productIdentification 8 }
+
+productIdentificationPerUnitEntry OBJECT-TYPE
+ SYNTAX ProductIdentificationPerBoxEntry
+ MAX-ACCESS not-accessible
+ STATUS current
+ DESCRIPTION
+ "This row applies to a unit in a stackable product. "
+ INDEX { productIdentificationPerBoxIndex }
+ ::= { productIdentificationPerUnitTable 1 }
+
+
+
+ProductIdentificationPerBoxEntry ::= SEQUENCE {
+
+ productIdentificationPerBoxIndex INTEGER,
+ productIdentificationSerialNumber DisplayString,
+ productIdentificationAssetTag DisplayString,
+ productIdentificationServiceTag DisplayString
+}
+
+productIdentificationPerBoxIndex OBJECT-TYPE
+ SYNTAX INTEGER (1..2147483647)
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION "The index of the stack unit to which this conceptual row corresponds.
+ Note that the index will be the same index as the index
+ of a 'chassis' physical entity in the entity MIB of the product."
+ ::= { productIdentificationPerUnitEntry 1 }
+
+
+productIdentificationSerialNumber OBJECT-TYPE
+ SYNTAX DisplayString
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION "Serial number of the product."
+ ::= { productIdentificationPerUnitEntry 2 }
+
+productIdentificationAssetTag OBJECT-TYPE
+ SYNTAX DisplayString
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION "Asset tag of the product."
+ ::= { productIdentificationPerUnitEntry 3 }
+
+productIdentificationServiceTag OBJECT-TYPE
+ SYNTAX DisplayString
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION "Service tag of the product."
+ ::= { productIdentificationPerUnitEntry 4 }
+
+
+--
+-- productStatus
+--
+
+productStatusGlobalStatus OBJECT-TYPE
+ SYNTAX INTEGER {
+ ok(3),
+ non-critical(4),
+ critical(5)
+ }
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION "Current status of the product.This is a rollup for the entire product.
+ The status is intended to give initiative to a snmp monitor to get further data when this status is abnormal.
+ This variable can take the following values:
+ 3: OK
+ If fans and power supplies are functioning and the system did not reboot because of a HW watchdog failure
+ or a SW fatal error condition.
+ 4: Non-critical
+ If at least one power supply is not functional or the system rebooted at least once because of a HW watchdog failure
+ or a SW fatal error condition.
+ 5: Critical
+ If at least one fan is not functional, possibly causing a dangerous warming up of the device."
+ ::= { productStatus 1 }
+
+productStatusLastGlobalStatus OBJECT-TYPE
+ SYNTAX INTEGER {
+ ok(3),
+ non-critical(4),
+ critical(5)
+ }
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION "The status before the current status which induced an initiative to issue a global status change trap."
+ ::= { productStatus 2 }
+
+productStatusTimeStamp OBJECT-TYPE
+ SYNTAX TimeTicks
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION "The last time that the product global status has been updated.
+ The time will be given in TimeTicks"
+ ::= { productStatus 3 }
+
+productStatusGetTimeOut OBJECT-TYPE
+ SYNTAX INTEGER
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION "Suggested time out value in milliseconds for how long the SNMP getter
+ should wait while attempting to poll the product SNMP service."
+ ::= { productStatus 4 }
+
+productStatusRefreshRate OBJECT-TYPE
+ SYNTAX INTEGER
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION "Rate in seconds at which the SNMP service cached data is being updated."
+ ::= { productStatus 5 }
+
+productStatusGeneratingTrapsFlag OBJECT-TYPE
+ SYNTAX INTEGER { true(1),
+ false(2),
+ disabled(3)
+ }
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION "Indicates if this SNMP service is generating SNMP Traps.
+ This variable can take the following values:
+ 1: true - The device is capable and currently configured to generate traps if necessary.
+ 2: false - The device is not capable of generating traps.
+ 3: disabled - The device is capable but not configured to generate traps.
+ "
+ ::= { productStatus 6 }
+
+productStatusEnvironment OBJECT IDENTIFIER ::= { productStatus 7}
+
+envMonFanStatusTable OBJECT-TYPE
+ SYNTAX SEQUENCE OF EnvMonFanStatusEntry
+ MAX-ACCESS not-accessible
+ STATUS current
+ DESCRIPTION
+ "The table of fan status maintained by the environmental
+ monitor."
+ ::= { productStatusEnvironment 1 }
+
+envMonFanStatusEntry OBJECT-TYPE
+ SYNTAX EnvMonFanStatusEntry
+ MAX-ACCESS not-accessible
+ STATUS current
+ DESCRIPTION
+ "An entry in the fan status table, representing the status of
+ the associated fan maintained by the environmental monitor."
+ INDEX { envMonFanStatusIndex }
+ ::= { envMonFanStatusTable 1 }
+
+EnvMonFanStatusEntry ::=
+ SEQUENCE {
+ envMonFanStatusIndex INTEGER,
+ envMonFanStatusDescr DisplayString,
+ envMonFanState EnvMonState
+ }
+
+envMonFanStatusIndex OBJECT-TYPE
+ SYNTAX INTEGER (1..2147483647)
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "Unique index for the fan being instrumented.
+ This index is for SNMP purposes only, and has no
+ intrinsic meaning."
+ ::= { envMonFanStatusEntry 1 }
+
+envMonFanStatusDescr OBJECT-TYPE
+ SYNTAX DisplayString (SIZE (0..32))
+ MAX-ACCESS read-only
+
+ STATUS current
+ DESCRIPTION
+ "Textual description of the fan being instrumented.
+ This description is a short textual label, suitable as a
+ human-sensible identification for the rest of the
+ information in the entry."
+ ::= { envMonFanStatusEntry 2 }
+
+envMonFanState OBJECT-TYPE
+ SYNTAX EnvMonState
+ MAX-ACCESS read-only
+
+ STATUS current
+ DESCRIPTION
+ "The mandatory state of the fan being instrumented."
+ ::= { envMonFanStatusEntry 3 }
+
+
+
+envMonSupplyStatusTable OBJECT-TYPE
+ SYNTAX SEQUENCE OF EnvMonSupplyStatusEntry
+ MAX-ACCESS not-accessible
+
+ STATUS current
+ DESCRIPTION
+ "The table of power supply status maintained by the
+ environmental monitor card."
+ ::= { productStatusEnvironment 2 }
+
+envMonSupplyStatusEntry OBJECT-TYPE
+ SYNTAX EnvMonSupplyStatusEntry
+ MAX-ACCESS not-accessible
+
+ STATUS current
+ DESCRIPTION
+ "An entry in the power supply status table, representing the
+ status of the associated power supply maintained by the
+ environmental monitor card."
+ INDEX { envMonSupplyStatusIndex }
+ ::= { envMonSupplyStatusTable 1 }
+
+EnvMonSupplyStatusEntry ::=
+ SEQUENCE {
+ envMonSupplyStatusIndex INTEGER ,
+ envMonSupplyStatusDescr DisplayString,
+ envMonSupplyState EnvMonState,
+ envMonSupplySource INTEGER
+ }
+
+envMonSupplyStatusIndex OBJECT-TYPE
+ SYNTAX INTEGER (0..2147483647)
+ MAX-ACCESS read-only
+
+ STATUS current
+ DESCRIPTION
+ "Unique index for the power supply being instrumented.
+ This index is for SNMP purposes only, and has no
+ intrinsic meaning."
+ ::= { envMonSupplyStatusEntry 1 }
+
+envMonSupplyStatusDescr OBJECT-TYPE
+ SYNTAX DisplayString (SIZE (0..32))
+ MAX-ACCESS read-only
+
+ STATUS current
+ DESCRIPTION
+ "Textual description of the power supply being instrumented.
+ This description is a short textual label, suitable as a
+ human-sensible identification for the rest of the
+ information in the entry."
+ ::= { envMonSupplyStatusEntry 2 }
+
+envMonSupplyState OBJECT-TYPE
+ SYNTAX EnvMonState
+ MAX-ACCESS read-only
+
+ STATUS current
+ DESCRIPTION
+ "The mandatory state of the power supply being instrumented."
+ ::= { envMonSupplyStatusEntry 3 }
+
+envMonSupplySource OBJECT-TYPE
+ SYNTAX INTEGER {
+ unknown(1),
+ ac(2),
+ dc(3),
+ externalPowerSupply(4),
+ internalRedundant(5)
+ }
+ MAX-ACCESS read-only
+
+ STATUS current
+ DESCRIPTION
+ "The power supply source.
+ unknown - Power supply source unknown
+ ac - AC power supply
+ dc - DC power supply
+ externalPowerSupply - External power supply
+ internalRedundant - Internal redundant power supply
+ "
+ ::= { envMonSupplyStatusEntry 4 }
+
+
+
+
+--
+-- trap definitions
+--
+
+
+ dell-VendorTraps OBJECT IDENTIFIER ::= { dellVendorNotifications 1 }
+ dell-VendorTrapsPrefix OBJECT IDENTIFIER ::= { dell-VendorTraps 0 }
+
+ productStatusGlobalStatusChange NOTIFICATION-TYPE
+
+ OBJECTS { productStatusGlobalStatus, productStatusLastGlobalStatus, productStatusTimeStamp }
+ STATUS current
+ DESCRIPTION "This trap is sent when the product global status changes."
+ --#TYPE "Product Global Status Change."
+ --#SUMMARY "The product global status has changed from %d to %d at time %d."
+ --#ARGUMENTS {1,0,2}
+
+
+ ::= {dell-VendorTrapsPrefix 1 }
+
+
+END
diff --git a/poll-device.php b/poll-device.php
index 2e0648fb1..626119bae 100755
--- a/poll-device.php
+++ b/poll-device.php
@@ -43,7 +43,9 @@ $i = 0;
$device_query = mysql_query("SELECT * FROM `devices` WHERE `ignore` = '0' $where ORDER BY `device_id` ASC");
while ($device = mysql_fetch_array($device_query)) {
- echo($device['hostname'] . " ".$device['device_id']." ".$device['os']."\n");
+ echo($device['hostname'] . " ".$device['device_id']." ".$device['os']." ");
+ if($os_groups[$device[os]]) {$device['os_group'] = $os_groups[$device[os]]; echo "(".$device['os_group'].")";}
+ echo("\n");
unset($update); unset($update_query); unset($seperator); unset($version); unset($uptime); unset($features);
unset($sysLocation); unset($hardware); unset($sysDescr); unset($sysContact); unset($sysName);
@@ -69,7 +71,7 @@ while ($device = mysql_fetch_array($device_query)) {
$status = '1';
$snmp_cmd = $config['snmpget'] . " -m SNMPv2-MIB -O qv -" . $device['snmpver'] . " -c " . $device['community'] . " " . $device['hostname'].":".$device['port'];
- $snmp_cmd .= " sysUptime.0 sysLocation.0 sysContact.0 sysName.0";
+ $snmp_cmd .= " sysUpTime.0 sysLocation.0 sysContact.0 sysName.0";
$snmpdata = shell_exec($snmp_cmd);
#$snmpdata = preg_replace("/^.*IOS/","", $snmpdata);
$snmpdata = trim($snmpdata);
@@ -78,6 +80,7 @@ while ($device = mysql_fetch_array($device_query)) {
$sysDescr = trim(shell_exec($config['snmpget'] . " -m SNMPv2-MIB -O qv -" . $device['snmpver'] . " -c " . $device['community'] . " " . $device['hostname'].":".$device['port'] . " sysDescr.0"));
$sysUptime = str_replace("(", "", $sysUptime);
$sysUptime = str_replace(")", "", $sysUptime);
+ $sysName = strtolower($sysName);
list($days, $hours, $mins, $secs) = explode(":", $sysUptime);
list($secs, $microsecs) = explode(".", $secs);
$hours = $hours + ($days * 24);
@@ -85,88 +88,34 @@ while ($device = mysql_fetch_array($device_query)) {
$secs = $secs + ($mins * 60);
$uptime = $secs;
- switch ($device['os']) {
- case "FreeBSD":
- case "DragonFly":
- case "OpenBSD":
- case "Linux":
- case "m0n0wall":
- case "Voswall":
- case "NetBSD":
- case "pfSense":
- include("includes/polling/device-unix.inc.php");
- break;
+ if(is_file($config['install_dir'] . "/includes/polling/device-".$device['os'].".inc.php")) {
+ /// OS Specific
+ include($config['install_dir'] . "/includes/polling/device-".$device['os'].".inc.php");
+ }elseif($device['os_group'] && is_file($config['install_dir'] . "/includes/polling/device-".$device['os_group'].".inc.php")) {
+ /// OS Group Specific
+ include($config['install_dir'] . "/includes/polling/device-".$device['os_group'].".inc.php");
+ }else{
+ echo("Generic :(");
+ }
- case "Windows":
- include("includes/polling/device-windows.inc.php");
- break;
- case "ScreenOS":
- include("includes/polling/device-screenos.inc.php");
- break;
-
- case "Fortigate":
- include("includes/polling/device-fortigate.inc.php");
- break;
-
- case "JunOS":
- include("includes/polling/device-junos.inc.php");
- break;
-
- case "IOS":
- case "IOS XE":
- case "ASA":
- include("includes/polling/device-ios.inc.php");
- break;
-
- case "CatOS":
- include("includes/polling/device-catos.inc.php");
- break;
-
- case "procurve":
- include("includes/polling/device-procurve.inc.php");
- break;
-
- case "BCM96348":
- include("includes/polling/adslline.inc.php");
- break;
-
- case "Snom":
- include("includes/polling/device-snom.inc.php");
- break;
-
- default:
- pollDevice();
- }
$sysLocation = str_replace("\"","", $sysLocation);
include("includes/polling/temperatures.inc.php");
include("includes/polling/device-netstats.inc.php");
+ include("includes/polling/ipSystemStats.inc.php");
include("includes/polling/ports.inc.php");
include("includes/polling/cisco-mac-accounting.inc.php");
- $update_uptime_attrib = mysql_query("UPDATE devices_attribs SET attrib_value = NOW() WHERE `device_id` = '" . $device['device_id'] . "' AND `attrib_type` = 'polled'");
- if(mysql_affected_rows() == '0') {
- $insert_uptime_attrib = mysql_query("INSERT INTO devices_attribs (`device_id`, `attrib_type`, `attrib_value`) VALUES ('" . $device['device_id'] . "', 'polled', NOW())");
- }
-
- } else {
- $status = '0';
- }
-
unset( $update ) ;
unset( $seperator) ;
if ( $sysContact && $sysContact != $device['sysContact'] ) {
- $update .= $seperator . "`sysContact` = '$sysContact'";
+ $update .= $seperator . "`sysContact` = '".mres($sysContact)."'";
$seperator = ", ";
mysql_query("INSERT INTO eventlog (host, interface, datetime, message) VALUES ('" . $device['device_id'] . "', NULL, NOW(), 'Contact -> $sysContact')");
}
- echo("$update\n");
-
- $sysName = strtolower($sysName);
-
if ( $sysName && $sysName != $device['sysName'] ) {
$update .= $seperator . "`sysName` = '$sysName'";
$seperator = ", ";
@@ -217,11 +166,9 @@ while ($device = mysql_fetch_array($device_query)) {
if ($uptime) {
- $old_uptime = @mysql_result(mysql_query("SELECT `attrib_value` FROM `devices_attribs` WHERE `device_id` = '" . $device['device_id'] . "' AND `attrib_type` = 'uptime'"), 0);
-
- if( $uptime < $old_uptime ) {
+ if( $uptime < $device['uptime'] ) {
if($device['sysContact']) { $email = $device['sysContact']; } else { $email = $config['email_default']; }
- mail($notify_email, "Device Rebooted: " . $device['hostname'], "Device Rebooted :" . $device['hostname'] . " at " . date('l dS F Y h:i:s A'), $config['email_headers']);
+ mail($email, "Device Rebooted: " . $device['hostname'], "Device Rebooted :" . $device['hostname'] . " at " . date('l dS F Y h:i:s A'), $config['email_headers']);
}
$uptimerrd = $config['rrd_dir'] . "/" . $device['hostname'] . "/uptime.rrd";
@@ -236,28 +183,28 @@ while ($device = mysql_fetch_array($device_query)) {
}
rrdtool_update($uptimerrd, "N:$uptime");
- $update_uptime_attrib = mysql_query("UPDATE devices_attribs SET attrib_value = '$uptime' WHERE `device_id` = '" . $device['device_id'] . "' AND `attrib_type` = 'uptime'");
- if(mysql_affected_rows() == '0') {
- $insert_uptime_attrib = mysql_query("INSERT INTO devices_attribs (`device_id`, `attrib_type`, `attrib_value`) VALUES ('" . $device['device_id'] . "', 'uptime', '$uptime')");
- }
-
- mysql_query("UPDATE `devices` SET `last_polled` = NOW() WHERE `device_id` = '". $device['device_id'] ."'");
-
- } ## End if snmpable
-
-
+ $update .= $seperator . "`uptime` = '$uptime'";
+ $seperator = ", ";
+ }
+ $update .= $seperator . "`last_polled` = NOW()";
if ($update) {
$update_query = "UPDATE `devices` SET ";
$update_query .= $update;
$update_query .= " WHERE `device_id` = '" . $device['device_id'] . "'";
- echo("Updating " . $device['hostname'] . "\n");
+ echo("Updating " . $device['hostname'] . " - $update_query \n");
$update_result = mysql_query($update_query);
} else {
echo("No Changes to " . $device['hostname'] . "\n");
}
$i++;
echo("\n");
-
+ } else {
+ $update_query = "UPDATE `devices` SET ";
+ $update .= " `status` = '0'";
+ $update_query .= " WHERE `device_id` = '" . $device['device_id'] . "'";
+ echo("Updating " . $device['hostname'] . "\n");
+ $update_result = mysql_query($update_query);
+ }
}
$poller_end = utime(); $poller_run = $poller_end - $poller_start; $poller_time = substr($poller_run, 0, 5);
diff --git a/poll-os.php b/poll-os.php
index 7f582ad98..83c3b965f 100755
--- a/poll-os.php
+++ b/poll-os.php
@@ -8,7 +8,7 @@ $device_query = mysql_query("SELECT device_id,hostname,os,community,snmpver,port
while ($device = mysql_fetch_array($device_query)) {
- $os = getHostOS($device['hostname'], $device['community'], $device['snmpver'], $device['port']);
+ $os = getHostOS($device);
if($os != $device['os']) {
$sql = mysql_query("UPDATE `devices` SET `os` = '$os' WHERE `device_id` = '".$device['device_id']."'");