From 7157ec554987d27e234d5fc40494092d316fe9ab Mon Sep 17 00:00:00 2001 From: Adam Amstrong Date: Sat, 28 Nov 2009 09:48:23 +0000 Subject: [PATCH] a billion changes. **** MAKE SURE TO UPDATE DATABASE AND RUN poll-os.php AND discovery.php -h all **** This is VERY important, as a lot of things have changed! Expect missing files, and another update soon! git-svn-id: http://www.observium.org/svn/observer/trunk@531 61d68cd4-352d-0410-923a-c4978735b2b8 --- 060-to-current.sql | 4 +- DATABASE-CHANGES | 2 - discovery.php | 13 +- html/graph.php | 159 +------ html/images/observer-icon.png | Bin 0 -> 1889 bytes html/images/os/catos.png | Bin 1907 -> 850 bytes html/images/os/junos.png | Bin 2140 -> 1089 bytes html/images/os/powerconnect.png | Bin 0 -> 1777 bytes html/images/os/screenos.png | Bin 1941 -> 1089 bytes html/includes/error-no-perm-dev.inc.php | 1 + html/includes/graphs/device_hrstorage.inc.php | 4 +- .../graphs/device_ipSystemStats.inc.php | 67 +++ .../graphs/device_memory_procurve.inc.php | 11 +- html/includes/hostbox.inc | 4 +- html/includes/print-interface.inc.php | 2 +- html/includes/print-menubar.php | 4 +- html/includes/warn-deleted-interfaces.inc.php | 5 + html/pages/customers.php | 2 +- html/pages/device/graphs.inc.php | 130 +----- html/pages/device/graphs/cpu.inc.php | 7 + html/pages/device/graphs/hrprocesses.inc.php | 5 + html/pages/device/graphs/hrstorage.inc.php | 9 + html/pages/device/graphs/hrusers.inc.php | 5 + html/pages/device/graphs/laload.inc.php | 8 + html/pages/device/graphs/memory.inc.php | 5 + html/pages/device/graphs/netstats.inc.php | 1 - html/pages/device/graphs/os-ios.inc.php | 18 +- html/pages/device/graphs/os-ios_xe.inc.php | 5 - html/pages/device/graphs/os-junos.inc.php | 6 + html/pages/device/graphs/os-linux.inc.php | 5 - html/pages/device/graphs/os-unix.inc.php | 9 + html/pages/device/graphs/os-windows.inc.php | 18 + html/pages/device/graphs/temperatures.inc.php | 7 + html/pages/device/graphs/uptime.inc.php | 3 - html/pages/front/default.php | 6 +- html/pages/front/demo.php | 24 +- includes/discovery/bgp-peers.php | 6 +- includes/discovery/cemp-mib.php | 2 +- includes/discovery/cisco-processors.php | 2 +- includes/discovery/entity-physical.inc.php | 23 +- includes/discovery/ipv4-addresses.php | 7 +- includes/discovery/ipv6-addresses.php | 6 +- includes/discovery/storage.php | 8 +- includes/discovery/temperatures.php | 2 +- includes/functions-poller.inc.php | 4 +- includes/functions.php | 7 +- includes/osdiscovery/discover-asa.php | 2 +- includes/osdiscovery/discover-catos.php | 2 +- includes/osdiscovery/discover-fortigate.php | 11 +- includes/osdiscovery/discover-freebsd.php | 6 +- includes/osdiscovery/discover-ios.php | 9 +- includes/osdiscovery/discover-junos.php | 4 +- includes/osdiscovery/discover-linux.php | 2 +- includes/osdiscovery/discover-m0n0wall.php | 8 - includes/osdiscovery/discover-netbsd.php | 2 +- includes/osdiscovery/discover-openbsd.php | 2 +- .../osdiscovery/discover-powerconnect.php | 9 + includes/osdiscovery/discover-screenos.php | 5 +- includes/osdiscovery/discover-windows.php | 2 +- includes/polling/bgpPeer.inc.php | 2 +- includes/polling/cisco-poe.inc.php | 2 +- includes/polling/device-junos.inc.php | 13 +- includes/polling/device-powerconnect.inc.php | 10 + includes/polling/interfaces.inc.php | 2 +- includes/polling/ipSystemStats.inc.php | 49 ++ includes/polling/ports.inc.php | 2 +- includes/static-config.php | 24 +- includes/syslog.php | 2 +- map.php | 2 +- mibs/Dell_vendor.mib | 437 ++++++++++++++++++ poll-device.php | 113 ++--- poll-os.php | 2 +- 72 files changed, 842 insertions(+), 498 deletions(-) delete mode 100644 DATABASE-CHANGES create mode 100644 html/images/observer-icon.png create mode 100644 html/images/os/powerconnect.png create mode 100644 html/includes/error-no-perm-dev.inc.php create mode 100644 html/includes/graphs/device_ipSystemStats.inc.php create mode 100644 html/includes/warn-deleted-interfaces.inc.php create mode 100644 html/pages/device/graphs/cpu.inc.php create mode 100644 html/pages/device/graphs/hrprocesses.inc.php create mode 100644 html/pages/device/graphs/hrstorage.inc.php create mode 100644 html/pages/device/graphs/hrusers.inc.php create mode 100644 html/pages/device/graphs/laload.inc.php create mode 100644 html/pages/device/graphs/memory.inc.php delete mode 100644 html/pages/device/graphs/os-ios_xe.inc.php create mode 100644 html/pages/device/graphs/os-junos.inc.php delete mode 100644 html/pages/device/graphs/os-linux.inc.php create mode 100644 html/pages/device/graphs/os-windows.inc.php create mode 100644 html/pages/device/graphs/temperatures.inc.php create mode 100755 includes/osdiscovery/discover-powerconnect.php create mode 100644 includes/polling/device-powerconnect.inc.php create mode 100755 includes/polling/ipSystemStats.inc.php create mode 100644 mibs/Dell_vendor.mib 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 0000000000000000000000000000000000000000..0f9aa5563a7c2cf0e2f4bc34315933c713bbc4bf GIT binary patch literal 1889 zcmV-n2cGzeP)Px#1ZP1_K>z@;j|==^1poj532;bRa{vGi!vFvd!vV){sAK>D02p*dSaefwW^{L9 za%BKeVQFr3E>1;MAa*k@Gd8K`;w1n82GU7HK~#8N?U{K{Q&$wmu`aE))&&p(Drz-a z>snjdQgtdWqlmjyL@iEnK~W@#VlbGn7y&^*76E~X7zncOdoYqf62cP0E(8UEhze*+ zU1~kOVTvPG3kd^0gM1f03(1AzzARjFaj6> zi~vReBcO}~4DGMR7*iQ#fhjzkGWr`dPx&?XMp<7@zdCid+p8%iE@0|*otMBa*B-Ql z$|meU&->J<1%H~@keu8t$rt6&! ztJT_%&oVM|3aUO=Hva?i zLrvrwF0cuHs`jfVtR`Q3;T(~dy!`m(zqE|0fcxhW(A-D{O#^$FZFCl{r0@aa@@*coTpYdK9cZ;|1)}`cLFetPFvu=`s9@ zNP9J5|3$FA%Dnxkvupa>zSyEWBts&t7Xaxhn2(wyTknKz%20<~9xSdg$LKmnFvlPE zg&!U0RgSTo$?p@&Evd8Cw+iUq19~ovwIo=3^wOjH*7ikm8TgPvEuCHC$;rHwiIzby z-##1?1+^#s%MW_@kD#UUtrwzKWDfxKRYaJ)&K?NvvB4j*7P)d;GHz~}N2Y^@bubVj zSq`aX;*os`g{Bt`Kjsy0H*=fQODO~?05$znu*AgmnP1e+e?2;V>3y*KnW8&u^xfmz zRF4J0>9~TnjPko5$zsMKB(q`aCWqGm)K?OL1QYZJrZJGWQ~ zf+2J9J%%mM$IO{$L~ZN=AcbIJ8(J)=xT`kgMfEo!omXQuhZ6A$Po_6*4NPC$-?;aU zyBNuGpS8uYdj&|ZnW#7LxRPx;P~Aa^4`5f$({qn&TjCN8VcZ%|MI=ER-{^zRk(uf% zY`XzWTxJ974*BvEShrLap|3CvUc>!Grr~)_bDS99#T161=U!o(RR*VWnf?LqHYtD! zddFdw!5Oe}xxPzb<_9WtIGQu^Xe>K^rXvHW8O8LR>U#=rT^Shy>QvMZNC8N%4Tt^8 z&}nh>K)ov@-YTwuyx1iMP9$&>6e9Qz5qetDh@C`Qy6RG!ZUD0lDM0c{*rAYo4?DZo zpswwEdBlSFwXVy3Qot&%FhZVqSz=H-yz00|+%sKc7f}7d8uk*eG|3YG&an)B?e@)n zDP4x13D<2SZVZ=2Fsii9cw$a| z@!V@HtESm#OJI8EIMl6aqc61n8O1*6q}H$J*Cth+v}utam6qhK65tV}rQ1FOj4a3PkX+m~QSQJvN=jQlD>B9DF{ zzw)!b#t+tgG+CpItDDx#tY7)y@hIE0;uzah!L4&yC8PxokuRhGCZW&L=H7{7VSVe2 z_lYJ|H{)#5OGGD<`SF(vsy>!E`A`NlcKlAMfAoY>FX^D54dnHeTiui%DQpm-d)el7|q0cj#`RikE)@Xx-f+L^1lCDZn}0d5loRvq$v!7izH>KT_K zmT;mgnj)Fv`$N9r^#>HH^$TgeW%oPrrIHRj>O}GViR(3nS$7hm8y+<^ZV4TdN|F;125ABpA?y-XD8z`W*{3I9=f}T{iw(o6!`dlez zeo*+^0gM1f03(1AzzARjFaj8X bK_Kuqv3G|{(;7+(00000NkvXXu0mjf!O(hm literal 0 HcmV?d00001 diff --git a/html/images/os/catos.png b/html/images/os/catos.png index 9736d08bc20445616f801454b8c292125d947a82..19a35e0c07128afbb3760e50b825ea50068e3ba5 100644 GIT binary patch delta 789 zcmV+w1M2+q4$=mY83+ad0047(di0SYHGdd%MObuGZ)S9NVRB^vP+@6qbS_RsR3LUU zE;BZ%=i(&*00P5FL_t(oN9~k5Xj4%b$L}LaP1Mu}sI`jsCTXKBbgYV?H>pp2^d=74 zN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pFQX2cZ8~lc^DDt+yv+1D?;<#OtKcpz$A3AWBIJ}k#EFYp_!EVh<%;cK{_Pi=zV57j&piJCUPbc*cO z|C#;&y`^~sj47l4Y!&e{*-17gECE>tv&=WPT*+#t87ujhR_kke$8+^xa(?`FPQqWp c_SeAt8>`k0PWs+;YybcN07*qoM6N<$f=pTQHUIzs diff --git a/html/images/os/powerconnect.png b/html/images/os/powerconnect.png new file mode 100644 index 0000000000000000000000000000000000000000..9fffd8c50c1252944ecf02bd4a75e65200f6708c GIT binary patch literal 1777 zcmVPx#1ZP1_K>z@;j|==^1poj532;bRa{vGi!vFvd!vV){sAK>D06}y`Sad^gZEa<4 zbO1wAML|?gQaT`KWG!lNWoICEF)lD5D0OpbZf77#N=G0{P(?=|b~Z98EFf`pVQgu1 zc_2L?IWP*aMOc#n0001JrRlxWeL5Lc*>RP-W*u9sURFBPh( ziJZ-<`-ifbf0VMB?XK=}b7+L!{L!+d;Tdp3tN(tlUpJpBAT{t-CDY7)27Jq z@NnDzI!E&U=FOXpq;6cea6#|Hi4%crthutXaw0!JpHfm%Xy3klv~AlqvG(rWONS31 zrqt9_Vt^DK9o@lTV)*y`uL7fdsI;{7$Li|p_RE(q6MIIhR;?m?dwW{Ge7X2mF8o&h z=jiB2+qZA0)2C0OMom|he zMms>**x1m51q+06<>EY`YuBy~78e&UnFNuYogKun*U0wis8=mJsc_)FrKKg!n>SC* zI6xQ}7zh@a@svpb9Q)?|`}fa^_n_R^*jU4`DhqCIZglI`tv(htJsC@|71#WPQe>or zW~N$K)d&j<3o8K_d-m)hc7}HD+&KvVNf#CtCX{jY>eXt%Am^ExnQ1cKP|OX5 zSi7mWx0l|$c|#*3BQ!QPM&sk-q);fx*Vk8o0HDFaLGk~yXV2*1!GpAG*Df+LGNPiQ zB6|4nA)$;BXL!17*)rh}VjdI}qy~V?k+`8X$YNt-e+Nnc=)yS4;{Q*dKGE>-Fr}rXiO@ZN{+!y{ z+Nid+Rt>;CEMgpmZ0EQ9Ej~_n@ue-Xs#KDOBix)3wU|@jWy?aL= zK763hpFay$8XFr0sQdTt6G|FkUB7-kp|5bZiv&fYdwF@0iHV75?c96*lCj}ZZj~BI zI668i4hJL1;5l>VprZ+zU%q@v{r&y)>eVY@3`xlG6uAQMa=DziqoVl`W(g$W$&)8V zLxL@^>+kQ6-ta)iD1SlE2HM-VZ&O`eoj3sBpbm{hRYbnTP8hVZvJ!QVx`v0jxw&-q z>{&4xq4D_n`4K7%_W%@3@7S?Js3a#pMMXvZD&z97$MhoAenFM0apg7Gz(TpHE~&jz z|IM8{7aD*m>t`Xye9;MHs)`5il=ZCb!P@Ryv0?=#r4cUAe`iLfKmN>_GiuEUDyHp$ zy6l5f$ORtP@+O-R$6`LO{(yi0!2;T-E{E!}cjd~J$dOT=6V23S0xpqIhzfGS%*^b6 z0f4~-6~PsdE;$==*4Cm)OqYDRcsg}267R^7BM_v=Jfs>*0^k=4qsYj}j`;X^!UNx8 zQ1w}yg|g%Gdl-QAjFT}7#nQaIybgo|gXFh@z!}Gm9Yf9cu#mZF^^(Hx21~gr5z%JDq#m>b^Ao=-)_s;I|oL~-l=8*I3^xJb@;QyGFP!Z6DE`0?YT z-rnBn{JeC`wV{LQTf$PBnvs#w2gQV}@{24vIXMwVFmrQrg0P^OB_$;ZDdxdtWW$CH zMeOEssPXIHg^;_{jdBVxF TlzL0z00000NkvXXu0mjf`gv4w literal 0 HcmV?d00001 diff --git a/html/images/os/screenos.png b/html/images/os/screenos.png index 5b19be5b9db31739d78704b618813d2673d6e663..62551caa540f2541d49ecde367dc1a25bae27956 100644 GIT binary patch delta 1012 zcmV55WkKK@tgYNLh0L01m?d01m?e$8V@)k!l`)Gd8K`;w1n81F}g(K~z{r z&6jD2PEi=gXT~yvkS)eCrD*KQu_w$2LSrpLllh=*Wyw}(ltc;%QKxKU$&$5%NIpzT zWdER~Y>|BzF_!;t=3H~<&il@s_ch8}zwW)~p6A^EdCqg5=e#K?|J~2nIw{6p6i=#| zqZ%)@>iHUfo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bYmg9$&tLl3?1ndR2Xpl@?A9C@8JQkpm+)v z5gm+yh%iXQ<1vjUCZO3rh@+RAkwTQR6tQUbo~h-)nzg;~1O(1NhslGb1c2$}$U5-z z`8WfzJ0{p%A*?x2&VO|(8_hUyt{x3-4y@c$%F`OJ0ZM_i`T?{L`bV6{LHL3(WR#=HbbelV8MY!#F4GyI#DT)dtrQX7Kzbde1e>rykaR+M;+@vCuZ~)79m*ImIx!lo5 zt8y`CLjh*YPsfL=^6=*3%i|2NE>Ly2h$atxw;yp4VuMf{`(pV1W=c%;_CSqvz`hqFjcVrNaw+TZ#Dw9pf#Fk3bnRs_H jy~H~&$0U4_--3StuC5&1Nn=Oy00000NkvXXu0mjfu?&T+ 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']."'");