diff --git a/discovery.php b/discovery.php index 9d72bafe58..a463dec3df 100755 --- a/discovery.php +++ b/discovery.php @@ -53,7 +53,7 @@ while ($device = mysql_fetch_array($device_query)) { echo("\n"); ## Discover OS Changes - include("includes/discovery/os.inc.php"); +# include("includes/discovery/os.inc.php"); ## Discover Interfaces include("includes/discovery/interfaces.php"); diff --git a/html/includes/graphs/common.inc.php b/html/includes/graphs/common.inc.php index 232c006bb3..9e5a794629 100644 --- a/html/includes/graphs/common.inc.php +++ b/html/includes/graphs/common.inc.php @@ -20,7 +20,7 @@ if($_GET['bg']) { $rrd_options .= " -c CANVAS#" . mres($_GET['bg']) . " "; } #$rrd_options .= " -c BACK#FFFFFF"; if($height < "99") { $rrd_options .= " --only-graph"; } -if($width <= "300") { $rrd_options .= " --font LEGEND:7:".$config['mono_font']." --font AXIS:6:".$config['mono_font']; -} else { $rrd_options .= " --font LEGEND:8:".$config['mono_font']." --font AXIS:7:".$config['mono_font']; } +if($width <= "300") { $rrd_options .= " --font LEGEND:7:MONO --font AXIS:6:MONO"; +} else { $rrd_options .= " --font LEGEND:8:MONO --font AXIS:7:MONO"; } ?> diff --git a/includes/collectd/functions.php b/includes/collectd/functions.php index 8306f6c5b3..5f8d2340b2 100644 --- a/includes/collectd/functions.php +++ b/includes/collectd/functions.php @@ -541,7 +541,7 @@ function collectd_draw_rrd($host, $plugin, $pinst = null, $type, $tinst = null, #$rrd_cmd = array(RRDTOOL, 'graph', '-', '-a', 'PNG', '-w', $config['rrd_width'], '-h', $config['rrd_height'], '-s', -1*$timespan_def['seconds'], '-t', $rrdfile); $rrd_cmd = array(RRDTOOL, 'graph', '-', '-a', 'PNG', '-w', $config['rrd_width'], '-h', $config['rrd_height'], '-s', -1*$timespan_def['seconds']); if($config['rrd_width'] <= "300") { - $small_opts = array ('--font', "LEGEND:7:".$config['mono_font'], '--font', "AXIS:6:".$config['mono_font'], "--font-render-mode", "normal"); + $small_opts = array ('--font', "LEGEND:7:mono", '--font', "AXIS:6:mono", "--font-render-mode", "normal"); $rrd_cmd = array_merge($rrd_cmd, $small_opts); } @@ -582,7 +582,7 @@ function collectd_draw_generic($timespan, $host, $plugin, $pinst = null, $type, $rrd_cmd = array(RRDTOOL, 'graph', '-', '-a', 'PNG', '-w', $config['rrd_width'], '-h', $config['rrd_height'], '-s', -1*$timespan_def['seconds']); if($config['rrd_width'] <= "300") { - $small_opts = array ('--font', 'LEGEND:7:'.$config['mono_font'], '--font', 'AXIS:6:'.$config['mono_font'], '--font-render-mode', 'normal'); + $small_opts = array ('--font', 'LEGEND:7:mono', '--font', 'AXIS:6:mono', '--font-render-mode', 'normal'); $rrd_cmd = array_merge($rrd_cmd, $small_opts); } @@ -637,7 +637,7 @@ function collectd_draw_meta_stack(&$opts, &$sources) { $cmd = array(RRDTOOL, 'graph', '-', '-a', 'PNG', '-w', $config['rrd_width'], '-h', $config['rrd_height'], '-s', -1*$timespan_def['seconds']); if($config['rrd_width'] <= "300") { - $small_opts = array ('--font', 'LEGEND:7:'.$config['mono_font'], '--font', 'AXIS:6:'.$config['mono_font'], '--font-render-mode', 'normal'); + $small_opts = array ('--font', 'LEGEND:7:mono', '--font', 'AXIS:6:mono', '--font-render-mode', 'normal'); $cmd = array_merge($cmd, $small_opts); } @@ -735,7 +735,7 @@ function collectd_draw_meta_line(&$opts, &$sources) { $cmd = array(RRDTOOL, 'graph', '-', '-a', 'PNG', '-w', $config['rrd_width'], '-h', $config['rrd_height'], '-s', -1*$timespan_def['seconds']); if($config['rrd_width'] <= "300") { - $small_opts = array ('--font', 'LEGEND:7:'.$config['mono_font'], '--font', 'AXIS:6:'.$config['mono_font'], '--font-render-mode', 'normal'); + $small_opts = array ('--font', 'LEGEND:7:mono', '--font', 'AXIS:6:mono', '--font-render-mode', 'normal'); $cmd = array_merge($cmd, $small_opts); } diff --git a/includes/discovery/cemp-mib.php b/includes/discovery/cemp-mib.php index c75a4278c6..e5f0bee1be 100755 --- a/includes/discovery/cemp-mib.php +++ b/includes/discovery/cemp-mib.php @@ -10,15 +10,15 @@ ## Cisco Enhanced Mempool 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 = shell_exec($config['snmpwalk'] . " -m CISCO-ENHANCED-MEMPOOL-MIB -".$device['snmpver']." -CI -Osq -c ".$community." ".$hostname.":".$port." cempMemPoolName | sed s/cempMemPoolName.//g"); $oids = trim($oids); foreach(explode("\n", $oids) as $data) { $data = trim($data); if($data) { list($oid, $cempMemPoolName) = explode(" ", $data); list($entPhysicalIndex, $Index) = explode(".", $oid); - $cempMemPoolType = trim(shell_exec($config['snmpget'] . " -m CISCO-ENHANCED-MEMPOOL-MIB -O qv -v2c -c $community $hostname:$port cempMemPoolType.$oid")); - $cempMemPoolValid = trim(shell_exec($config['snmpget'] . " -m CISCO-ENHANCED-MEMPOOL-MIB -O qv -v2c -c $community $hostname:$port cempMemPoolValid.$oid")); + $cempMemPoolType = trim(shell_exec($config['snmpget'] . " -m CISCO-ENHANCED-MEMPOOL-MIB -O qv -".$device['snmpver']." -c $community $hostname:$port cempMemPoolType.$oid")); + $cempMemPoolValid = trim(shell_exec($config['snmpget'] . " -m CISCO-ENHANCED-MEMPOOL-MIB -O qv -".$device['snmpver']." -c $community $hostname:$port cempMemPoolValid.$oid")); if(!strstr($descr, "No") && !strstr($usage, "No") && $cempMemPoolName != "" ) { $descr = str_replace("\"", "", $descr); $descr = trim($descr); diff --git a/includes/discovery/cisco-processors.php b/includes/discovery/cisco-processors.php index 8dbb6d5257..0c046568b8 100755 --- a/includes/discovery/cisco-processors.php +++ b/includes/discovery/cisco-processors.php @@ -9,7 +9,7 @@ ## Cisco Processors 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 = shell_exec($config['snmpwalk'] . " -m CISCO-PROCESS-MIB -".$device['snmpver']." -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) { $data = trim($data); @@ -17,8 +17,8 @@ list($oid, $entPhysicalIndex) = explode(" ", $data); $usage_oid = "cpmCPUTotal5minRev.$oid"; $descr_oid = "entPhysicalName.$entPhysicalIndex"; - $descr = trim(shell_exec($config['snmpget'] . " -m ENTITY-MIB -O qv -v2c -c $community $hostname:$port $descr_oid")); - $usage = trim(shell_exec($config['snmpget'] . " -m CISCO-PROCESS-MIB -O qv -v2c -c $community $hostname:$port $usage_oid")); + $descr = trim(shell_exec($config['snmpget'] . " -m ENTITY-MIB -O qv -".$device['snmpver']." -c $community $hostname:$port $descr_oid")); + $usage = trim(shell_exec($config['snmpget'] . " -m CISCO-PROCESS-MIB -O qv -".$device['snmpver']." -c $community $hostname:$port $usage_oid")); if($entPhysicalIndex == "0") { $descr = "Proc $oid"; } if(!strstr($descr, "No") && !strstr($usage, "No") && $descr != "" ) { $descr = str_replace("\"", "", $descr); diff --git a/includes/discovery/interfaces.php b/includes/discovery/interfaces.php index bc0444544b..b73c96b081 100755 --- a/includes/discovery/interfaces.php +++ b/includes/discovery/interfaces.php @@ -6,6 +6,7 @@ $cmd = $config['snmpbulkwalk'] . " -m IF-MIB -O nsq -" . $device['snmpver'] . " -c " . $device['community'] . " " . $device['hostname'].":".$device['port']; $cmd .= " ifDescr"; + echo("$cmd"); $interfaces = trim(shell_exec($cmd)); $interfaces = str_replace("\"", "", $interfaces); $interfaces = str_replace("ifDescr.", "", $interfaces); diff --git a/includes/functions.php b/includes/functions.php index 03384988bc..39d4af062c 100755 --- a/includes/functions.php +++ b/includes/functions.php @@ -631,7 +631,7 @@ function createHost ($host, $community, $snmpver, $port = 161){ $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')"); + $sql = mysql_query("INSERT INTO `devices` (`hostname`, `sysName`, `community`, `port`, `os`, `status`,`snmpver`) VALUES ('$host', '$host', '$community', '$port', '$host_os', '1','$snmpver')"); if(mysql_affected_rows()) { $device_id = mysql_result(mysql_query("SELECT device_id FROM devices WHERE hostname = '$host'"),0); mysql_query("INSERT INTO devices_attribs (attrib_type, attrib_value, device_id) VALUES ('discover','1','$device_id')"); diff --git a/includes/generic.php b/includes/generic.php index baa5a5b01c..bb7a05674b 100755 --- a/includes/generic.php +++ b/includes/generic.php @@ -20,19 +20,19 @@ function pollDevice() { $memrrd = "rrd/" . $device['hostname'] . "-mem.rrd"; $memgraph = "public_html/graphs/" . $device['hostname'] . "-mem.png"; - $cmd = $config['snmpget'] . " -O qv -v2c -c ".$community." ".$device['hostname'].":".$device['port']." 1.3.6.1.4.1.9.2.1.58.0 1.3.6.1.4.1.9.2.1.56.0"; + $cmd = $config['snmpget'] . " -O qv -".$device['snmpver']." -c ".$community." ".$device['hostname'].":".$device['port']." 1.3.6.1.4.1.9.2.1.58.0 1.3.6.1.4.1.9.2.1.56.0"; list ($cpu5m, $cpu5s) = explode("\n", shell_exec($cmd)); $cpu5m = $cpu5m + 0; $cpu5s = $cpu5s + 0; - $cmd = $config['snmpget'] . " -O qv -v2c -c ".$community." ".$device['hostname'].":".$device['port']." .1.3.6.1.4.1.9.9.13.1.3.1.3.1 .1.3.6.1.4.1.9.9.13.1.3.1.3.2"; + $cmd = $config['snmpget'] . " -O qv -".$device['snmpver']." -c ".$community." ".$device['hostname'].":".$device['port']." .1.3.6.1.4.1.9.9.13.1.3.1.3.1 .1.3.6.1.4.1.9.9.13.1.3.1.3.2"; list ($tempin1, $tempout1) = explode("\n", shell_exec($cmd)); $tempin1 = $tempin1 +0; $tempout1 = $tempout1 + 0; - $cmd = $config['snmpget'] . " -O qv -v2c -c ".$community." ".$device['hostname'].":".$device['port']; + $cmd = $config['snmpget'] . " -O qv -".$device['snmpver']." -c ".$community." ".$device['hostname'].":".$device['port']; $cmd .= " .1.3.6.1.4.1.9.9.48.1.1.1.6.2 .1.3.6.1.4.1.9.9.48.1.1.1.6.1 .1.3.6.1.4.1.9.9.48.1.1.1.5.2 .1.3.6.1.4.1.9.9.48.1.1.1.5.1"; list ($memfreeio, $memfreeproc, $memusedio, $memusedproc) = explode("\n", shell_exec($cmd)); diff --git a/includes/osdiscovery/discover-speedtouch.php b/includes/osdiscovery/discover-speedtouch.php new file mode 100755 index 0000000000..a1060aa712 --- /dev/null +++ b/includes/osdiscovery/discover-speedtouch.php @@ -0,0 +1,9 @@ + diff --git a/includes/polling/device-ios.inc.php b/includes/polling/device-ios.inc.php index 4b5ac1b8ff..f7acd96ba3 100755 --- a/includes/polling/device-ios.inc.php +++ b/includes/polling/device-ios.inc.php @@ -51,7 +51,7 @@ $mem_get = ".1.3.6.1.4.1.9.9.48.1.1.1.6.2 .1.3.6.1.4.1.9.9.48.1.1.1.6.1 .1.3.6.1.4.1.9.9.48.1.1.1.6.3"; $mem_get .= ".1.3.6.1.4.1.9.9.48.1.1.1.5.2 .1.3.6.1.4.1.9.9.48.1.1.1.5.1 .1.3.6.1.4.1.9.9.48.1.1.1.5.3"; - $mem_raw = shell_exec($config['snmpget'] . " -O qv -v2c -c $community $hostname:$port $mem_get"); + $mem_raw = shell_exec($config['snmpget'] . " -O qv -".$device['snmpver']." -c $community $hostname:$port $mem_get"); $mem_raw = str_replace("No Such Instance currently exists at this OID", "0", $mem_raw); list ($memfreeio, $memfreeproc, $memfreeprocb, $memusedio, $memusedproc, $memusedprocb) = explode("\n", $mem_raw); $memfreeproc = $memfreeproc + $memfreeprocb; diff --git a/includes/polling/device-unix.inc.php b/includes/polling/device-unix.inc.php index bfcca578f4..7ed1eba86a 100755 --- a/includes/polling/device-unix.inc.php +++ b/includes/polling/device-unix.inc.php @@ -1,27 +1,27 @@