From fff66d3c004099b44fd09b7bcdb602d58b5649c9 Mon Sep 17 00:00:00 2001 From: Tony Murray Date: Wed, 20 Dec 2017 08:36:49 -0600 Subject: [PATCH] Feature: Generic discovery and poller tests (#7873) * Processor Tests! * Capture data from live devices easily. * fix up some stuff, remove powerconnect things as they seem to be just broken. * formatting, fix missing assignment add netonix processor data * fix multi-line, always add sysDescr and sysObjectID ios cpm test file * revert composer change and fix whitespace issues * add help text * missed help text * tighter debug output * handle empty strings properly and mibs with numbers * use keys for sorting as intended * fix type with empty data * oops :) * whitespace fix * try installing fping * Fix TestCase collision + cleanup * mark TestCase as abstract don't run two instances of snmpsim * better database dumps, improved capture * style fixes * fix quotes add a few more tables * add --prefer-new, properly merge data * Support separate discovery and poller data. But don't waste space if they aren't needed. * refactor to use class collects all code in one place for reusability * reorganize * Print out when not saving. * Support for running multiple (or all) modules at once. * tidy * Change unit test to a generic name and test all modules we have data for. * Add documentation and a few more tidies * whitespace fixes * Fix tests, add a couple more modules, more docs * More docs updates * Fix scrutinizer issues * add bgp-peers --- .travis.yml | 5 +- LibreNMS/Proc.php | 17 +- LibreNMS/Util/ModuleTestHelper.php | 552 ++++++++++++++++++ LibreNMS/Util/Snmpsim.php | 140 +++++ doc/Developing/os/Test-Units.md | 63 +- includes/common.php | 2 +- .../discovery/processors/powerconnect.inc.php | 5 +- includes/functions.php | 5 + scripts/pre-commit.php | 38 +- scripts/save-test-data.php | 141 +++++ tests/AlertingTest.php | 2 +- tests/CommonFunctionsTest.php | 2 +- tests/ConfigTest.php | 2 +- tests/DBTestCase.php | 13 +- tests/FunctionsTest.php | 2 +- tests/IpTest.php | 2 +- tests/LockTest.php | 1 - tests/MibTest.php | 2 +- tests/OSDiscoveryTest.php | 9 +- tests/OSModulesTest.php | 88 +++ tests/RrdDefinitionTest.php | 2 +- tests/RrdtoolTest.php | 2 +- tests/SVGTest.php | 2 +- tests/SyslogTest.php | 2 +- tests/TestCase.php | 56 ++ tests/YamlTest.php | 2 +- tests/bootstrap.php | 19 +- tests/data/ios_c3560e.json | 20 + tests/data/linux.json | 97 +++ tests/data/netonix_wispswitch.json | 20 + tests/data/powerconnect_3031.json | 8 + tests/module_tables.yaml | 45 ++ tests/snmpsim/3com.snmprec | 1 + tests/snmpsim/acos.snmprec | 458 ++++++++++++++- tests/snmpsim/adtran-aos.snmprec | 1 + tests/snmpsim/aen.snmprec | 1 + tests/snmpsim/alteonos.snmprec | 3 + tests/snmpsim/aos.snmprec | 1 + tests/snmpsim/aos_1.snmprec | 1 + tests/snmpsim/apsoluteos.snmprec | 1 + tests/snmpsim/avaya-ers.snmprec | 10 + tests/snmpsim/dnos.snmprec | 1 + tests/snmpsim/ftos_1.snmprec | 3 + tests/snmpsim/ios.snmprec | 1 + tests/snmpsim/ios_c3560e.snmprec | 12 + tests/snmpsim/linux.snmprec | 167 ++++++ tests/snmpsim/netonix_wispswitch.snmprec | 1 + tests/snmpsim/powerconnect_3024.snmprec | 3 + tests/snmpsim/powerconnect_3031.snmprec | 1 + tests/snmpsim/skel.snmprec | 2 - 50 files changed, 1950 insertions(+), 84 deletions(-) create mode 100644 LibreNMS/Util/ModuleTestHelper.php create mode 100644 LibreNMS/Util/Snmpsim.php create mode 100755 scripts/save-test-data.php create mode 100644 tests/OSModulesTest.php create mode 100644 tests/TestCase.php create mode 100644 tests/data/ios_c3560e.json create mode 100644 tests/data/linux.json create mode 100644 tests/data/netonix_wispswitch.json create mode 100644 tests/data/powerconnect_3031.json create mode 100644 tests/module_tables.yaml create mode 100644 tests/snmpsim/ftos_1.snmprec create mode 100644 tests/snmpsim/ios_c3560e.snmprec create mode 100644 tests/snmpsim/powerconnect_3024.snmprec delete mode 100644 tests/snmpsim/skel.snmprec diff --git a/.travis.yml b/.travis.yml index 6597288c6272..61cc216b87d1 100644 --- a/.travis.yml +++ b/.travis.yml @@ -33,7 +33,7 @@ cache: before_install: - sudo apt-get -qq update - - sudo apt-get install -y snmp + - sudo apt-get install -y snmp fping - mysql -e 'CREATE DATABASE librenms_phpunit_78hunjuybybh;' install: @@ -43,9 +43,6 @@ install: - pip install --user pylint - pip install --user mysql-python -before_script: - - python2 $HOME/.local/bin/snmpsimd.py --data-dir=$TRAVIS_BUILD_DIR/tests/snmpsim --agent-udpv4-endpoint=127.0.0.1:11161 --logging-method=file:/tmp/snmpsimd.log --daemon --pid-file=/tmp/snmpsimd.pid - after_success: - test $TRAVIS_PULL_REQUEST == "false" && test $TRAVIS_BRANCH == "master" && test $EXECUTE_BUILD_SCHEMA == "true" && bash scripts/deploy-schema.sh - test $TRAVIS_PULL_REQUEST == "false" && test $TRAVIS_BRANCH == "master" && test $EXECUTE_BUILD_DOCS == "true" && bash scripts/deploy-docs.sh diff --git a/LibreNMS/Proc.php b/LibreNMS/Proc.php index 169a996e9d46..da58ab5391d6 100644 --- a/LibreNMS/Proc.php +++ b/LibreNMS/Proc.php @@ -189,10 +189,11 @@ public function close($command = null) * Please attempt to run close() instead of this * This will be called when this object is destroyed if the process is still running * + * @param int $timeout how many microseconds to wait before terminating (SIGKILL) * @param int $signal the signal to send * @throws Exception */ - public function terminate($signal = 15) + public function terminate($timeout = 3000, $signal = 15) { $status = $this->getStatus(); @@ -200,11 +201,23 @@ public function terminate($signal = 15) $closed = proc_terminate($this->_process, $signal); + $time = 0; + while ($time < $timeout) { + $closed = !$this->isRunning(); + if ($closed) { + break; + } + + usleep(100); + $time += 100; + } + if (!$closed) { // try harder - $killed = false; if (function_exists('posix_kill')) { $killed = posix_kill($status['pid'], 9); //9 is the SIGKILL signal + } else { + $killed = proc_terminate($this->_process, 9); } proc_close($this->_process); diff --git a/LibreNMS/Util/ModuleTestHelper.php b/LibreNMS/Util/ModuleTestHelper.php new file mode 100644 index 000000000000..79eb331f3d74 --- /dev/null +++ b/LibreNMS/Util/ModuleTestHelper.php @@ -0,0 +1,552 @@ +. + * + * @package LibreNMS + * @link http://librenms.org + * @copyright 2017 Tony Murray + * @author Tony Murray + */ + +namespace LibreNMS\Util; + +use LibreNMS\Config; +use Symfony\Component\Yaml\Yaml; + +class ModuleTestHelper +{ + private $quiet = false; + private $modules; + private $variant; + private $os; + private $snmprec_file; + private $json_file; + private $snmprec_dir; + private $json_dir; + private $file_name; + private $module_tables; + + + /** + * ModuleTester constructor. + * @param array|string $modules + * @param string $os + * @param string $variant + */ + public function __construct($modules, $os, $variant = '') + { + $this->modules = $this->resolveModuleDependencies((array)$modules); + $this->os = $os; + $this->variant = $variant; + + // preset the file names + if ($variant) { + $variant = '_' . $variant; + } + $install_dir = Config::get('install_dir'); + $this->file_name = $os . $variant; + $this->snmprec_dir = "$install_dir/tests/snmpsim/"; + $this->snmprec_file = $this->snmprec_dir . $this->file_name . ".snmprec"; + $this->json_dir = "$install_dir/tests/data/"; + $this->json_file = $this->json_dir . $this->file_name . ".json"; + + // never store time series data + Config::set('norrd', true); + Config::set('noinfluxdb', true); + Config::set('nographite', true); + + $this->module_tables = Yaml::parse($install_dir . '/tests/module_tables.yaml'); + } + + private static function compareOid($a, $b) + { + $a_oid = explode('.', $a); + $b_oid = explode('.', $b); + + foreach ($a_oid as $index => $a_part) { + $b_part = $b_oid[$index]; + if ($a_part > $b_part) { + return 1; // a is higher + } elseif ($a_part < $b_part) { + return -1; // b is higher + } + } + + if (count($a_oid) < count($b_oid)) { + return -1; // same prefix, but b has more so it is higher + } + + return 0; + } + + public function setQuiet($quiet = true) + { + $this->quiet = $quiet; + } + + public function captureFromDevice($device_id, $write = true, $prefer_new = false) + { + $snmp_oids = $this->collectOids($device_id); + + $device = device_by_id_cache($device_id, true); + + $snmprec_data = array(); + foreach ($snmp_oids as $oid_data) { + $this->qPrint(" " . $oid_data['oid']); + + $snmp_options = '-OUneb -Ih'; + if ($oid_data['method'] == 'walk') { + $data = snmp_walk($device, $oid_data['oid'], $snmp_options, $oid_data['mib']); + } elseif ($oid_data['method'] == 'get') { + $data = snmp_get($device, $oid_data['oid'], $snmp_options, $oid_data['mib']); + } elseif ($oid_data['method'] == 'getnext') { + $data = snmp_getnext($device, $oid_data['oid'], $snmp_options, $oid_data['mib']); + } + + if (isset($data) && $data !== false) { + $snmprec_data[] = $this->convertSnmpToSnmprec($data); + } + } + + $this->qPrint(PHP_EOL); + + return $this->saveSnmprec($snmprec_data, $write, $prefer_new); + } + + private function collectOids($device_id) + { + global $debug, $vdebug, $device; + + $device = device_by_id_cache($device_id); + + // Run discovery + ob_start(); + $save_debug = $debug; + $save_vedbug = $vdebug; + $debug = true; + $vdebug = false; + discover_device($device, $this->getArgs()); + poll_device($device, $this->getArgs()); + $debug = $save_debug; + $vdebug = $save_vedbug; + $collection_output = ob_get_contents(); + ob_end_clean(); + + d_echo($collection_output); + d_echo(PHP_EOL); + + // remove color + $collection_output = preg_replace('/\033\[[\d;]+m/', '', $collection_output); + + // extract snmp queries + $snmp_query_regex = '/SNMP\[.*snmp(?:bulk)?([a-z]+) .+:HOSTNAME:[0-9]+(.+)\]/'; + preg_match_all($snmp_query_regex, $collection_output, $snmp_matches); + + // extract mibs and group with oids + $snmp_oids = array( + 'sysDescr.0_get' => array('oid' => 'sysDescr.0', 'mib' => 'SNMPv2-MIB', 'method' => 'get'), + 'sysObjectID.0_get' => array('oid' => 'sysObjectID.0', 'mib' => 'SNMPv2-MIB', 'method' => 'get'), + ); + foreach ($snmp_matches[0] as $index => $line) { + preg_match('/-m ([a-zA-Z0-9:\-]+)/', $line, $mib_matches); + $mib = $mib_matches[1]; + $method = $snmp_matches[1][$index]; + $oids = explode(' ', trim($snmp_matches[2][$index])); + foreach ($oids as $oid) { + $snmp_oids["{$oid}_$method"] = array( + 'oid' => $oid, + 'mib' => $mib, + 'method' => $method, + ); + } + } + + d_echo("OIDs to capture "); + d_echo($snmp_oids); + + return $snmp_oids; + } + + + /** + * Generate a module list. Try to take dependencies into account. + * Probably needs to be more robust + * + * @param array $modules + * @return array + */ + private function resolveModuleDependencies($modules) + { + $module_deps = array( + 'arp-table' => array('ports', 'arp-table'), + ); + + // generate a full list of modules + $full_list = array(); + foreach ($modules as $module) { + if (isset($module_deps[$module])) { + array_merge($full_list, $module_deps[$module]); + } else { + $full_list[] = $module; + } + } + + return array_unique($full_list); + } + + private function getArgs() + { + if (empty($this->modules)) { + return array(); + } + + return array('m' => implode(',', $this->modules)); + } + + private function qPrint($var) + { + if ($this->quiet) { + return; + } + + if (is_array($var)) { + print_r($var); + } else { + echo $var; + } + } + + private function convertSnmpToSnmprec($snmp_data) + { + $result = array(); + foreach (explode(PHP_EOL, $snmp_data) as $line) { + if (empty($line)) { + continue; + } + + if (str_contains($line, ' = ')) { + list($oid, $raw_data) = explode(' = ', $line, 2); + $oid = ltrim($oid, '.'); + + if (empty($raw_data)) { + $result[] = "$oid|4|"; // empty data, we don't know type, put string + } else { + list($raw_type, $data) = explode(':', $raw_data, 2); + if (starts_with($raw_type, 'Wrong Type (should be ')) { + // device returned the wrong type, save the wrong type to emulate the device behavior + list($raw_type, $data) = explode(':', ltrim($data), 2); + } + $data = ltrim($data, ' "'); + $type = $this->getSnmprecType($raw_type); + + if ($type == '6') { + // remove leading . from oid data + $data = ltrim($data, '.'); + } elseif ($type == '4x') { + // remove spaces from hex-strings + $data = str_replace(' ', '', $data); + } elseif ($type == '67') { + // extract timeticks value (-Ot removes type info) + preg_match('/\((\d+)\)/', $data, $match); + $data = $match[1]; + } + + $result[] = "$oid|$type|$data"; + } + } else { + // multi-line data, append to last + $last = end($result); + + list($oid, $type, $data) = explode('|', $last, 3); + if ($type == '4x') { + $result[key($result)] .= bin2hex(PHP_EOL . $line); + } else { + $result[key($result)] = "$oid|4x|" . bin2hex($data . PHP_EOL . $line); + } + } + } + + return $result; + } + + private function getSnmprecType($text) + { + $snmpTypes = array( + 'STRING' => '4', + 'OID' => '6', + 'Hex-STRING' => '4x', + 'Timeticks' => '67', + 'INTEGER' => '2', + 'OCTET STRING' => '4', + 'BITS' => '4', # not sure if this is right + 'Integer32' => '2', + 'NULL' => '5', + 'OBJECT IDENTIFIER' => '6', + 'IpAddress' => '64', + 'Counter32' => '65', + 'Gauge32' => '66', + 'Opaque' => '68', + 'Counter64' => '70', + 'Network Address' => '4' + ); + + return $snmpTypes[$text]; + } + + private function saveSnmprec($data, $write = true, $prefer_new = false) + { + if (is_file($this->snmprec_file)) { + $existing_data = $this->indexSnmprec(explode(PHP_EOL, file_get_contents($this->snmprec_file))); + } else { + $existing_data = array(); + } + + $new_data = array(); + foreach ($data as $part) { + $new_data = array_merge($new_data, $this->indexSnmprec($part)); + } + + $this->cleanSnmprecData($new_data); + + // merge new and existing data + if ($prefer_new) { + $results = array_merge($existing_data, $new_data); + } else { + $results = array_merge($new_data, $existing_data); + } + + // put data in the proper order for snmpsim + uksort($results, array($this, 'compareOid')); + + $output = implode(PHP_EOL, $results) . PHP_EOL; + + if ($write) { + $this->qPrint("Updated snmprec data $this->snmprec_file\n"); + $this->qPrint("Verify these files do not contain any private data before submitting\n"); + file_put_contents($this->snmprec_file, $output); + } + + return $output; + } + + private function indexSnmprec(array $snmprec_data) + { + $result = array(); + + foreach ($snmprec_data as $line) { + if (!empty($line)) { + list($oid,) = explode('|', $line, 2); + $result[$oid] = $line; + } + } + + return $result; + } + + private function cleanSnmprecData(&$data) + { + $private_oid = array( + '1.3.6.1.2.1.1.6.0', + '1.3.6.1.2.1.1.4.0', + '1.3.6.1.2.1.1.5.0', + ); + + foreach ($private_oid as $oid) { + if (isset($data[$oid])) { + $parts = explode('|', $data[$oid], 3); + $parts[2] = ''; + $data[$oid] = implode('|', $parts); + } + } + } + + public function generateTestData(Snmpsim $snmpsim, $no_save = false) + { + global $device; + + // Remove existing device in case it didn't get removed previously + if ($existing_device = device_by_name($snmpsim->getIp())) { + delete_device($existing_device['device_id']); + } + + // Add the test device + try { + Config::set('snmp.community', array($this->file_name)); + $device_id = addHost($snmpsim->getIp(), 'v2c', $snmpsim->getPort()); + $this->qPrint("Added device: $device_id\n"); + } catch (\Exception $e) { + echo $e->getMessage() . PHP_EOL; + exit; + } + + // Populate the device variable + $device = device_by_id_cache($device_id, true); + + $data = array(); // array to hold dumped data + + // Run discovery + if ($this->quiet) { + ob_start(); + } + + discover_device($device, $this->getArgs()); + + if ($this->quiet) { + $discovery_output = ob_get_contents(); + ob_end_clean(); + + d_echo($discovery_output); + d_echo(PHP_EOL); + } + + $this->qPrint(PHP_EOL); + + // Dump the discovered data + $data = array_merge_recursive($data, $this->dumpDb($device['device_id'], 'discovery')); + + // Run the poller + ob_start(); + poll_device($device, $this->getArgs()); + $poller_output = ob_get_contents(); + ob_end_clean(); + + d_echo($poller_output); + d_echo(PHP_EOL); + + // Dump polled data + $data = array_merge_recursive($data, $this->dumpDb($device['device_id'], 'poller')); + + // Remove the test device, we don't need the debug from this + if ($device['hostname'] == $snmpsim->getIp()) { + global $debug; + $debug = false; + delete_device($device['device_id']); + } + + + if (!$no_save) { + d_echo($data); + + // Save the data to the default test data location (or elsewhere if specified) + $existing_data = json_decode(file_get_contents($this->json_file), true); + + // insert new data, don't store duplicate data + foreach ($data as $module => $module_data) { + if ($module_data['discovery'] == $module_data['poller']) { + $existing_data[$module] = array( + 'discovery' => $module_data['discovery'], + 'poller' => 'matches discovery', + ); + } else { + $existing_data[$module] = $module_data; + } + } + + file_put_contents($this->json_file, _json_encode($existing_data)); + $this->qPrint("Saved to $this->json_file\nReady for testing!\n"); + } + + return $data; + } + + /** + * Dump the current database data for the module to an array + * Mostly used for testing + * + * @param int $device_id The test device id + * @param string $key a key to store the data under the module key (usually discovery or poller) + * @return array The dumped data keyed by module -> table + */ + public function dumpDb($device_id, $key = null) + { + $data = array(); + + foreach ($this->getTableData() as $module => $module_tables) { + foreach ($module_tables as $table => $info) { + // check for custom where + $where = isset($info['custom_where']) ? $info['custom_where'] : "WHERE `device_id`=?"; + $params = array($device_id); + + // build joins + $join = ''; + foreach ($info['joins'] as $join_info) { + if (isset($join_info['custom'])) { + $join .= ' ' . $join_info['custom']; + } else { + list($left, $lkey) = explode('.', $join_info['left']); + list($right, $rkey) = explode('.', $join_info['right']); + $join .= " LEFT JOIN `$right` ON (`$left`.`$lkey` = `$right`.`$rkey`)"; + } + } + + $rows = dbFetchRows("SELECT * FROM `$table` $join $where", $params); + + // remove unwanted fields + $keys = array_flip($info['excluded_fields']); + $formatted_data = array_map(function ($row) use ($keys) { + return array_diff_key($row, $keys); + }, $rows); + + if (isset($key)) { + $data[$module][$key][$table] = $formatted_data; + } else { + $data[$module][$table] = $formatted_data; + } + } + } + + return $data; + } + + /** + * Get list of tables used by a module + * Includes a list of fields that will not be considered for testing + * + * @return array + */ + public function getTableData() + { + return array_intersect_key($this->module_tables, array_flip($this->getModules())); + } + + /** + * Get a list of all modules that support capturing data + * + * @return array + */ + public function getSupportedModules() + { + return array_keys($this->module_tables); + } + + /** + * Get a list of modules to capture data for + * If modules is empty, returns all supported modules + * + * @return array + */ + private function getModules() + { + return empty($this->modules) ? $this->getSupportedModules() : $this->modules; + } + + public function fetchTestData() + { + return json_decode(file_get_contents($this->json_file), true); + } +} diff --git a/LibreNMS/Util/Snmpsim.php b/LibreNMS/Util/Snmpsim.php new file mode 100644 index 000000000000..89f9fd62af9b --- /dev/null +++ b/LibreNMS/Util/Snmpsim.php @@ -0,0 +1,140 @@ +. + * + * @package LibreNMS + * @link http://librenms.org + * @copyright 2017 Tony Murray + * @author Tony Murray + */ + +namespace LibreNMS\Util; + +use LibreNMS\Config; +use LibreNMS\Proc; + +class Snmpsim +{ + private $snmprec_dir; + private $ip; + private $port; + private $log; + /** @var Proc $proc */ + private $proc; + + public function __construct($ip = '127.1.6.1', $port = 1161, $log = '/tmp/snmpsimd.log') + { + $this->ip = $ip; + $this->port = $port; + $this->log = $log; + $this->snmprec_dir = Config::get('install_dir') . "/tests/snmpsim/"; + } + + public function fork() + { + if ($this->isRunning()) { + echo "Snmpsim is already running!\n"; + return; + } + + $cmd = $this->getCmd(); + + if (isCli()) { + echo "Starting snmpsim listening on {$this->ip}:{$this->port}... \n"; + d_echo($cmd); + } + + $this->proc = new Proc($cmd); + + if (isCli() && !$this->proc->isRunning()) { + echo `tail -5 $this->log` . PHP_EOL; + } + } + + public function restart() + { + $this->stop(); + $this->proc = new Proc($this->getCmd()); + } + + public function stop() + { + if (isset($this->proc)) { + if ($this->proc->isRunning()) { + $this->proc->terminate(); + } + unset($this->proc); + } + } + + public function run() + { + echo "Starting snmpsim listening on {$this->ip}:{$this->port}... \n"; + shell_exec($this->getCmd(false)); + } + + public function isRunning() + { + if (isset($this->proc)) { + return $this->proc->isRunning(); + } + + return false; + } + + /** + * @return string + */ + public function getDir() + { + return $this->snmprec_dir; + } + + /** + * @return string + */ + public function getIp() + { + return $this->ip; + } + + /** + * @return int + */ + public function getPort() + { + return $this->port; + } + + private function getCmd($with_log = true) + { + $cmd = "snmpsimd.py --data-dir={$this->snmprec_dir} --agent-udpv4-endpoint={$this->ip}:{$this->port}"; + + if ($with_log) { + $cmd .= " --logging-method=file:{$this->log}"; + } + + return $cmd; + } + + public function __destruct() + { + // unset $this->proc to make sure it isn't referenced + unset($this->proc); + } +} diff --git a/doc/Developing/os/Test-Units.md b/doc/Developing/os/Test-Units.md index f9adc1783199..37999021e0eb 100644 --- a/doc/Developing/os/Test-Units.md +++ b/doc/Developing/os/Test-Units.md @@ -1,16 +1,50 @@ source: Developing/os/Test-Units.md -We have a testing unit for new OS', please ensure you add a test for any new OS' or updates to existing OS discovery. +# Tests -All that you need to do is create an snmprec file in tests/snmpsim with the proper name. If adding the first test for -this os, simply use the os name `pulse.snmprec` for example. If you need to add multiple test files, you can add an -underscore after the os name followed by a description, typically a model name. For example: `pulse_mag2600.snmprec`. -You can copy `skel.snmprec` to your intended name and fill in the data to make things a little easier. +Tests ensure LibreNMS works as expected, now and in the future. New OS should provide as much test data as needed and +added test data for existing OS is welcome. -We utilise [snmpsim](http://snmpsim.sourceforge.net/) to do unit testing for OS discovery. For this to work you need -to supply an snmprec file. This is pretty simple and using pulse as the example again this would look like: +Saved snmp data can be found in `tests/snmpsim/*.snmprec` and saved database data can be found in `tests/data/*.json`. +Please review this for any sensitive data **before** submitting. When replacing data, make sure it is modified in a +consistent manner. + +We utilise [snmpsim](http://snmpsim.sourceforge.net/) to do unit testing. For OS discovery, we can mock snmpsim, but +for other tests you will need it installed and functioning. We run snmpsim during our integration tests, but not by +default when running `./scripts/pre-commit.php`. + +## Capturing test data + +`./scripts/save-tests-data.php` is provided to make it easy to collect data for tests. Running save-tests-data.php with +the --hostname (-h) allows you to capture all data used to discover and poll a device already added to LibreNMS. Make sure to +re-run the script if you add additional support. Check the command-line help for more options. + +### OS Variants + +If test data already exists, but is for a different device/configuration then you should use the --variant (-v) option to +specify a different variant of the os, this will be tested completely separate from other variants. If there is only +one variant, please do not specify one. + +## Running tests + +After you have saved your test data, you should run `./scripts/pre-commit.php -p -u` verify they pass. + +To run the full suite of tests enable db and snmpsim reliat tests: `./scripts/pre-commit.php --db --snmpsim -p -u` + +## Using snmpsim for testing + +You can run snmpsim to access test data by running `./scripts/save-tests-data.php --snmpsim` + +You may then run snmp queries against it using the os (and variant) as the community and 127.1.6.1:1161 as the host. +``` +snmpget -v 2c -c ios_c3560e 127.1.6.1:1161 sysDescr.0 +``` + +## Snmprec format + +Snmprec files are simple files that store the snmp data. The data format is simple with three columns: numeric oid, type +code, and data. Here is an example snippet. -`tests/snmpsim/pulse_mag2600.snmprec` ``` 1.3.6.1.2.1.1.1.0|4|Pulse Secure,LLC,MAG-2600,8.0R14 (build 41869) 1.3.6.1.2.1.1.2.0|6|1.3.6.1.4.1.12532.254.1.1 @@ -25,15 +59,6 @@ To look up the numeric OID and type of an string OID with snmptranslate: snmptranslate -On -Td SNMPv2-MIB::sysDescr.0 ``` -Common OIDs used in discovery: - -| String OID | Numeric OID | -| ----------------------------------- | --------------------------- | -| SNMPv2-MIB::sysDescr.0 | 1.3.6.1.2.1.1.1.0 | -| SNMPv2-MIB::sysObjectID.0 | 1.3.6.1.2.1.1.2.0 | -| ENTITY-MIB::entPhysicalDescr.1 | 1.3.6.1.2.1.47.1.1.1.1.2.1 | -| ENTITY-MIB::entPhysicalMfgName.1 | 1.3.6.1.2.1.47.1.1.1.1.12.1 | - List of SNMP data types: | Type | Value | @@ -52,6 +77,6 @@ List of SNMP data types: Hex encoded strings (4x) should be used for any strings that contain line returns. -You can run `./scripts/pre-commit.php -u` to run the unit tests to check your code. +## New discovery/poller modules -If you would like to run tests locally against a full snmpsim instance, run `./scripts/pre-commit.php -u --snmpsim`. +New discovery or poller modules should define database capture parameters in `/tests/module_tables.yaml`. diff --git a/includes/common.php b/includes/common.php index 5460b877e308..b651142366e9 100644 --- a/includes/common.php +++ b/includes/common.php @@ -335,7 +335,7 @@ function accesspoint_by_id($ap_id, $refresh = '0') } -function device_by_id_cache($device_id, $refresh = '0') +function device_by_id_cache($device_id, $refresh = false) { global $cache; diff --git a/includes/discovery/processors/powerconnect.inc.php b/includes/discovery/processors/powerconnect.inc.php index 54e0671e4e4f..1c8c0d545112 100644 --- a/includes/discovery/processors/powerconnect.inc.php +++ b/includes/discovery/processors/powerconnect.inc.php @@ -21,16 +21,17 @@ } echo 'DNOS CPU: '; +// mib-2.1.2.0 == sysObjectID $get_series = explode('.', snmp_get($device, 'mib-2.1.2.0', '-Onvsbq', 'F10-PRODUCTS-MIB', 'dnos'), 2); // Get series From MIB $series = $get_series[0]; $descr = 'CPU'; - if ($series == 'f10SSeriesProducts') { + if ($series == 'f10SSeriesProducts') { // .1.3.6.1.4.1.6027.1.3 echo 'Dell S Series Chassis'; $usage = trim(snmp_get($device, 'chStackUnitCpuUtil5Sec.1', '-OvQ', 'F10-S-SERIES-CHASSIS-MIB')); discover_processor($valid['processor'], $device, 'F10-S-SERIES-CHASSIS-MIB::chStackUnitCpuUtil5Sec.1', '0', 'dnos-cpu', '1', $usage, null, null); - } elseif ($series == 'f10CSeriesProducts') { + } elseif ($series == 'f10CSeriesProducts') { // .1.3.6.1.4.1.6027.1.2 echo 'Dell C Series Chassis'; $usage = trim(snmp_get($device, 'chLineCardCpuUtil5Sec.1', '-OvQ', 'F10-S-SERIES-CHASSIS-MIB')); diff --git a/includes/functions.php b/includes/functions.php index f87591d9deab..42b4d661834d 100644 --- a/includes/functions.php +++ b/includes/functions.php @@ -2402,6 +2402,11 @@ function dump_db_schema() return $output; } + + + + + /** * Get an array of the schema files. * schema_version => full_file_name diff --git a/scripts/pre-commit.php b/scripts/pre-commit.php index 51093fd7a941..58922a66753e 100755 --- a/scripts/pre-commit.php +++ b/scripts/pre-commit.php @@ -1,8 +1,6 @@ #!/usr/bin/env php false, 's' => false, 'l' => false); } +if (check_opt($options, 'snmpsim')) { + putenv('SNMPSIM=1'); +} + +if (check_opt($options, 'db')) { + putenv('DBTEST=1'); +} + // run tests in the order they were specified foreach (array_keys($options) as $opt) { $ret = 0; @@ -62,7 +69,7 @@ } elseif ($opt == 's' || $opt == 'style') { $ret = run_check('style', $passthru, $command_only); } elseif ($opt == 'u' || $opt == 'unit') { - $ret = run_check('unit', $passthru, $command_only, $fail_fast, $snmpsim); + $ret = run_check('unit', $passthru, $command_only, $fail_fast); } if ($fail_fast && $ret !== 0 && $ret !== 250) { @@ -202,40 +209,23 @@ function check_style($passthru = false, $command_only = false) * @param bool $passthru display the output as comes in * @param bool $command_only only display the intended command, no checks * @param bool $fail_fast Stop when any error or failure is encountered - * @param bool $snmpsim send snmp requests to snmpsim listening on 127.0.0.1:11161 * @return int the return value from phpunit (0 = success) */ -function check_unit($passthru = false, $command_only = false, $fail_fast = false, $snmpsim = false) +function check_unit($passthru = false, $command_only = false, $fail_fast = false) { $phpunit_bin = check_exec('phpunit'); - if ($snmpsim) { - $phpunit_cmd = "SNMPSIM=1 $phpunit_bin --colors=always"; - $snmpsim_cmd = "snmpsimd.py --data-dir=./tests/snmpsim --agent-udpv4-endpoint=127.0.0.1:11161 --logging-method=file:/tmp/snmpsimd.log"; - } else { - $phpunit_cmd = "$phpunit_bin --colors=always"; - $snmpsim_cmd = ''; - } + $phpunit_cmd = "$phpunit_bin --colors=always"; if ($fail_fast) { $phpunit_cmd .= ' --stop-on-error --stop-on-failure'; } - if ($command_only) { echo $phpunit_cmd . PHP_EOL; - if ($snmpsim) { - echo $snmpsim_cmd . PHP_EOL; - } return 250; } - $proc_snmpsimd = null; - if ($snmpsim) { - echo 'Starting snmpsimd...' . PHP_EOL; - $proc_snmpsimd = new Proc($snmpsim_cmd); - } - echo 'Running unit tests... '; if ($passthru) { echo PHP_EOL; diff --git a/scripts/save-test-data.php b/scripts/save-test-data.php new file mode 100755 index 000000000000..3807a05b68d6 --- /dev/null +++ b/scripts/save-test-data.php @@ -0,0 +1,141 @@ +#!/usr/bin/env php +run(); + exit; +} + +if (isset($options['h'])) { + $hostname = $options['h']; +} elseif (isset($options['hostname'])) { + $hostname = $options['hostname']; +} + +$target_os = ''; +if (isset($options['o'])) { + $target_os = $options['o']; +} elseif (isset($options['os'])) { + $target_os = $options['os']; +} + +if (isset($hostname)) { + if (is_numeric($hostname)) { + $device = device_by_id_cache($hostname); + } elseif (!empty($hostname)) { + $device = device_by_name($hostname); + } + + if (isset($device['os']) && $device['os'] != 'generic') { + $target_os = $device['os']; + } else { + echo "OS (-o, --os) required because device is generic.\n"; + exit; + } +} + +if (isset($options['help']) || empty($target_os)) { + echo "Script to extract test data from devices or update test data + +Usage: + You must specify a valid hostname or os. + -h, --hostname ID, IP, or hostname of the device to extract data from + If this is not given, the existing snmp data will be used + -o, --os Name of the OS to save test data for + -v, --variant The variant of the OS to use, usually the device model + -m, --modules The discovery/poller module(s) to collect data for, comma delimited + -f, --file File to save the database entries to. Default is in tests/data/ + -d, --debug Enable debug output + -n, --prefer-new Prefer new snmprec data over existing data + --no-save Don't save database entries, print them out instead + --snmpsim Just run snmpsimd.py for manual testing. +"; + exit; +} + +if (isset($options['m'])) { + $modules_input = $options['m']; + $modules = explode(',', $modules_input); +} elseif (isset($options['modules'])) { + $modules_input = $options['modules']; + $modules = explode(',', $modules_input); +} else { + $modules_input = 'all'; + $modules = array(); +} + +$variant = ''; +if (isset($options['v'])) { + $variant = $options['v']; +} elseif (isset($options['variant'])) { + $variant = $options['variant']; +} + +echo "OS: $target_os\n"; +echo "Module: $modules_input\n"; +if ($variant) { + echo "Variant: $variant\n"; +} +echo PHP_EOL; + + +$tester = new ModuleTestHelper($modules, $target_os, $variant); + + +// Capture snmp data +if ($device) { + echo "Capturing Data: "; + $prefer_new_snmprec = isset($options['n']) || isset($options['prefer-new']); + $tester->captureFromDevice($device['device_id'], true, $prefer_new_snmprec); + + echo PHP_EOL; +} + + +// Now use the saved data to update the saved database data +$snmpsim = new Snmpsim(); +$snmpsim->fork(); +$snmpsim_ip = $snmpsim->getIp(); +$snmpsim_port = $snmpsim->getPort(); + + +$no_save = isset($options['no-save']); +$test_data = $tester->generateTestData($snmpsim, $no_save); + +if ($no_save) { + print_r($test_data); +} diff --git a/tests/AlertingTest.php b/tests/AlertingTest.php index c8c4fda74ea8..f01d38b0e5eb 100644 --- a/tests/AlertingTest.php +++ b/tests/AlertingTest.php @@ -25,7 +25,7 @@ namespace LibreNMS\Tests; -class AlertTest extends \PHPUnit_Framework_TestCase +class AlertTest extends TestCase { public function testJsonAlertCollection() { diff --git a/tests/CommonFunctionsTest.php b/tests/CommonFunctionsTest.php index 28bef4266403..8acf11849ac3 100644 --- a/tests/CommonFunctionsTest.php +++ b/tests/CommonFunctionsTest.php @@ -25,7 +25,7 @@ namespace LibreNMS\Tests; -class CommonFunctionsTest extends \PHPUnit_Framework_TestCase +class CommonFunctionsTest extends TestCase { public function testStrContains() { diff --git a/tests/ConfigTest.php b/tests/ConfigTest.php index 5adf510c6872..f9c8ca3536a3 100644 --- a/tests/ConfigTest.php +++ b/tests/ConfigTest.php @@ -27,7 +27,7 @@ use LibreNMS\Config; -class ConfigTest extends \PHPUnit_Framework_TestCase +class ConfigTest extends TestCase { public function testGetBasic() { diff --git a/tests/DBTestCase.php b/tests/DBTestCase.php index 7e91df7de915..69eeb9e39fc3 100644 --- a/tests/DBTestCase.php +++ b/tests/DBTestCase.php @@ -25,24 +25,17 @@ namespace LibreNMS\Tests; -class DBTestCase extends \PHPUnit_Framework_TestCase +class DBTestCase extends TestCase { public function setUp() { parent::setUp(); - if (getenv('DBTEST')) { - dbConnect(); - dbBeginTransaction(); - } else { - $this->markTestSkipped('Database tests not enabled. Set DBTEST=1 to enable.'); - } + $this->dbSetUp(); } public function tearDown() { + $this->dbTearDown(); parent::tearDown(); - if (getenv('DBTEST')) { - dbRollbackTransaction(); - } } } diff --git a/tests/FunctionsTest.php b/tests/FunctionsTest.php index 131faac378e1..871847917743 100644 --- a/tests/FunctionsTest.php +++ b/tests/FunctionsTest.php @@ -25,7 +25,7 @@ namespace LibreNMS\Tests; -class FunctionsTest extends \PHPUnit_Framework_TestCase +class FunctionsTest extends TestCase { public function testMacCleanToReadable() { diff --git a/tests/IpTest.php b/tests/IpTest.php index 9c887db873ef..5f1bf81abf2e 100644 --- a/tests/IpTest.php +++ b/tests/IpTest.php @@ -29,7 +29,7 @@ use LibreNMS\Util\IPv4; use LibreNMS\Util\IPv6; -class IpTest extends \PHPUnit\Framework\TestCase +class IpTest extends TestCase { public function testIsValid() { diff --git a/tests/LockTest.php b/tests/LockTest.php index 6ac3b8cb158e..509db681cb0d 100644 --- a/tests/LockTest.php +++ b/tests/LockTest.php @@ -27,7 +27,6 @@ use LibreNMS\Exceptions\LockException; use LibreNMS\Util\FileLock; -use PHPUnit\Framework\TestCase; class LockTest extends TestCase { diff --git a/tests/MibTest.php b/tests/MibTest.php index 74d3d814a26e..fc62b33a97c6 100644 --- a/tests/MibTest.php +++ b/tests/MibTest.php @@ -38,7 +38,7 @@ * Will not be run by default, use --group=mibs to test. * You may test specific directories or files by specifying them with filter. Example: --filter=@RFC1284-MIB */ -class MibTest extends \PHPUnit\Framework\TestCase +class MibTest extends TestCase { /** * Test mib file in a directory for errors diff --git a/tests/OSDiscoveryTest.php b/tests/OSDiscoveryTest.php index 9d74c259f24d..8b24cb905d40 100644 --- a/tests/OSDiscoveryTest.php +++ b/tests/OSDiscoveryTest.php @@ -27,7 +27,7 @@ use PHPUnit_Framework_ExpectationFailedException as PHPUnitException; -class OSDiscoveryTest extends \PHPUnit_Framework_TestCase +class OSDiscoveryTest extends TestCase { private static $unchecked_files; @@ -83,13 +83,12 @@ public function testOS($os_name) /** * Test that all files have been tested (removed from self::$unchecked_files - * Except skel.snmprec, the example file. * * @depends testOS */ public function testAllFilesTested() { - $this->assertEquals(array('skel'), array_keys(self::$unchecked_files)); + $this->assertEmpty(self::$unchecked_files); } /** @@ -122,9 +121,9 @@ private function genDevice($community) { return array( 'device_id' => 1, - 'hostname' => '127.0.0.1', + 'hostname' => $this->snmpsimIp, 'snmpver' => 'v2c', - 'port' => 11161, + 'port' => $this->snmpsimPort, 'timeout' => 3, 'retries' => 0, 'snmp_max_repeaters' => 10, diff --git a/tests/OSModulesTest.php b/tests/OSModulesTest.php new file mode 100644 index 000000000000..ea93a3170761 --- /dev/null +++ b/tests/OSModulesTest.php @@ -0,0 +1,88 @@ +. + * + * @package LibreNMS + * @link http://librenms.org + * @copyright 2017 Tony Murray + * @author Tony Murray + */ + +namespace LibreNMS\Tests; + +use LibreNMS\Config; +use LibreNMS\Device\Processor; +use LibreNMS\Util\ModuleTestHelper; + +class OSModulesTest extends DBTestCase +{ + /** + * @dataProvider dumpedDataProvider + * @param string $target_os + * @param string $filename + */ + public function testOS($target_os, $filename) + { + $this->requreSnmpsim(); // require snmpsim for tests + global $snmpsim; + + $file = Config::get('install_dir') . '/' . $filename; + $expected_data = json_decode(file_get_contents($file), true); + + list($os, $variant) = explode('_', $target_os, 2); + $modules = array_keys($expected_data); + $helper = new ModuleTestHelper($modules, $os, $variant); + $helper->setQuiet(); + + $results = $helper->generateTestData($snmpsim, true); + + foreach ($expected_data as $module => $data) { + $this->assertEquals( + $data['discovery'], + $results[$module]['discovery'], + "OS $target_os: Discovered $module data does not match that found in $filename" + ); + + $this->assertEquals( + $data['poller'] == 'matches discovery' ? $data['discovery'] : $data['poller'], + $results[$module]['poller'], + "OS $target_os: Polled $module data does not match that found in $filename" + ); + } + } + + + public function dumpedDataProvider() + { + $install_dir = Config::get('install_dir'); + $dump_files = glob("$install_dir/tests/data/*.json"); + $data = array(); + + foreach ($dump_files as $file) { + $os = basename($file, '.json'); + $short_file = str_replace($install_dir.'/', '', $file); + + $data[$os] = array( + $os, + $short_file + ); + } + + return $data; + } +} diff --git a/tests/RrdDefinitionTest.php b/tests/RrdDefinitionTest.php index 65d5b1490f36..ea9c66450735 100644 --- a/tests/RrdDefinitionTest.php +++ b/tests/RrdDefinitionTest.php @@ -27,7 +27,7 @@ use LibreNMS\RRD\RrdDefinition; -class RrdDefinitionTest extends \PHPUnit_Framework_TestCase +class RrdDefinitionTest extends TestCase { public function testEmpty() { diff --git a/tests/RrdtoolTest.php b/tests/RrdtoolTest.php index 42c0e7da9476..2874be683ad7 100644 --- a/tests/RrdtoolTest.php +++ b/tests/RrdtoolTest.php @@ -25,7 +25,7 @@ namespace LibreNMS\Tests; -class RrdtoolTest extends \PHPUnit_Framework_TestCase +class RrdtoolTest extends TestCase { public function testBuildCommandLocal() diff --git a/tests/SVGTest.php b/tests/SVGTest.php index f79fcfd21045..38e3bc02d78f 100644 --- a/tests/SVGTest.php +++ b/tests/SVGTest.php @@ -30,7 +30,7 @@ use RecursiveRegexIterator; use RegexIterator; -class SVGTest extends \PHPUnit_Framework_TestCase +class SVGTest extends TestCase { public function testSVGContainsPNG() { diff --git a/tests/SyslogTest.php b/tests/SyslogTest.php index c36fa0bd4d9d..3dbb09e6c2f6 100644 --- a/tests/SyslogTest.php +++ b/tests/SyslogTest.php @@ -25,7 +25,7 @@ namespace LibreNMS\Tests; -class SyslogTest extends \PHPUnit_Framework_TestCase +class SyslogTest extends TestCase { // The format is: diff --git a/tests/TestCase.php b/tests/TestCase.php new file mode 100644 index 000000000000..c4886b61c67f --- /dev/null +++ b/tests/TestCase.php @@ -0,0 +1,56 @@ +. + * + * @package LibreNMS + * @link http://librenms.org + * @copyright 2017 Tony Murray + * @author Tony Murray + */ + +namespace LibreNMS\Tests; + +abstract class TestCase extends \PHPUnit_Framework_TestCase +{ + protected $snmpsimIp = '127.1.6.2'; + protected $snmpsimPort = 1161; + + public function dbSetUp() + { + if (getenv('DBTEST')) { + dbConnect(); + dbBeginTransaction(); + } else { + $this->markTestSkipped('Database tests not enabled. Set DBTEST=1 to enable.'); + } + } + + public function dbTearDown() + { + if (getenv('DBTEST')) { + dbRollbackTransaction(); + } + } + + public function requreSnmpsim() + { + if (!getenv('SNMPSIM')) { + $this->markTestSkipped('Snmpsim required for this test. Set SNMPSIM=1 to enable.'); + } + } +} diff --git a/tests/YamlTest.php b/tests/YamlTest.php index c84cb1620923..e01a14baac01 100644 --- a/tests/YamlTest.php +++ b/tests/YamlTest.php @@ -30,7 +30,7 @@ use Symfony\Component\Yaml\Exception\ParseException; use Symfony\Component\Yaml\Yaml; -class YamlTest extends \PHPUnit_Framework_TestCase +class YamlTest extends TestCase { private $valid_os_discovery_keys = array( 'sysDescr', diff --git a/tests/bootstrap.php b/tests/bootstrap.php index f077f2c8e4e4..248552dfac1a 100644 --- a/tests/bootstrap.php +++ b/tests/bootstrap.php @@ -23,11 +23,14 @@ * @author Tony Murray */ +use LibreNMS\Proc; +use LibreNMS\Util\Snmpsim; + global $config; $install_dir = realpath(__DIR__ . '/..'); -$init_modules = array('web', 'discovery'); +$init_modules = array('web', 'discovery', 'polling'); if (!getenv('SNMPSIM')) { $init_modules[] = 'mocksnmp'; @@ -45,10 +48,20 @@ chdir($install_dir); ini_set('display_errors', 1); -error_reporting(E_ALL & ~E_WARNING); +//error_reporting(E_ALL & ~E_WARNING); update_os_cache(true); // Force update of OS Cache +if (getenv('SNMPSIM')) { + $snmpsim = new Snmpsim('127.1.6.2'); + $snmpsim->fork(); + + // make PHP hold on a reference to $snmpsim so it doesn't get destructed + register_shutdown_function(function (Snmpsim $ss) { + $ss->stop(); + }, $snmpsim); +} + if (getenv('DBTEST')) { global $schema, $sql_mode; @@ -63,6 +76,8 @@ global $config; dbConnect(); + echo "Cleaning database...\n"; + // restore sql_mode dbQuery("SET GLOBAL sql_mode='$sql_mode'"); diff --git a/tests/data/ios_c3560e.json b/tests/data/ios_c3560e.json new file mode 100644 index 000000000000..9c4cf270a80b --- /dev/null +++ b/tests/data/ios_c3560e.json @@ -0,0 +1,20 @@ +{ + "processors": { + "discovery": { + "processors": [ + { + "entPhysicalIndex": "0", + "hrDeviceIndex": null, + "processor_oid": ".1.3.6.1.4.1.9.9.109.1.1.1.1.8.1", + "processor_index": "1", + "processor_type": "cpm", + "processor_usage": "12", + "processor_descr": "Processor 1", + "processor_precision": "1", + "processor_perc_warn": "75" + } + ] + }, + "poller": "matches discovery" + } +} \ No newline at end of file diff --git a/tests/data/linux.json b/tests/data/linux.json new file mode 100644 index 000000000000..8607a2d7ddc6 --- /dev/null +++ b/tests/data/linux.json @@ -0,0 +1,97 @@ +{ + "processors": { + "discovery": { + "processors": [ + { + "entPhysicalIndex": "0", + "hrDeviceIndex": "196608", + "processor_oid": ".1.3.6.1.2.1.25.3.3.1.2.196608", + "processor_index": "196608", + "processor_type": "hr", + "processor_usage": "3", + "processor_descr": "Intel Core i7-3632QM @ 2.20GHz", + "processor_precision": "1", + "processor_perc_warn": "75" + }, + { + "entPhysicalIndex": "0", + "hrDeviceIndex": "196609", + "processor_oid": ".1.3.6.1.2.1.25.3.3.1.2.196609", + "processor_index": "196609", + "processor_type": "hr", + "processor_usage": "2", + "processor_descr": "Intel Core i7-3632QM @ 2.20GHz", + "processor_precision": "1", + "processor_perc_warn": "75" + }, + { + "entPhysicalIndex": "0", + "hrDeviceIndex": "196610", + "processor_oid": ".1.3.6.1.2.1.25.3.3.1.2.196610", + "processor_index": "196610", + "processor_type": "hr", + "processor_usage": "2", + "processor_descr": "Intel Core i7-3632QM @ 2.20GHz", + "processor_precision": "1", + "processor_perc_warn": "75" + }, + { + "entPhysicalIndex": "0", + "hrDeviceIndex": "196611", + "processor_oid": ".1.3.6.1.2.1.25.3.3.1.2.196611", + "processor_index": "196611", + "processor_type": "hr", + "processor_usage": "1", + "processor_descr": "Intel Core i7-3632QM @ 2.20GHz", + "processor_precision": "1", + "processor_perc_warn": "75" + }, + { + "entPhysicalIndex": "0", + "hrDeviceIndex": "196612", + "processor_oid": ".1.3.6.1.2.1.25.3.3.1.2.196612", + "processor_index": "196612", + "processor_type": "hr", + "processor_usage": "2", + "processor_descr": "Intel Core i7-3632QM @ 2.20GHz", + "processor_precision": "1", + "processor_perc_warn": "75" + }, + { + "entPhysicalIndex": "0", + "hrDeviceIndex": "196613", + "processor_oid": ".1.3.6.1.2.1.25.3.3.1.2.196613", + "processor_index": "196613", + "processor_type": "hr", + "processor_usage": "3", + "processor_descr": "Intel Core i7-3632QM @ 2.20GHz", + "processor_precision": "1", + "processor_perc_warn": "75" + }, + { + "entPhysicalIndex": "0", + "hrDeviceIndex": "196614", + "processor_oid": ".1.3.6.1.2.1.25.3.3.1.2.196614", + "processor_index": "196614", + "processor_type": "hr", + "processor_usage": "1", + "processor_descr": "Intel Core i7-3632QM @ 2.20GHz", + "processor_precision": "1", + "processor_perc_warn": "75" + }, + { + "entPhysicalIndex": "0", + "hrDeviceIndex": "196615", + "processor_oid": ".1.3.6.1.2.1.25.3.3.1.2.196615", + "processor_index": "196615", + "processor_type": "hr", + "processor_usage": "2", + "processor_descr": "Intel Core i7-3632QM @ 2.20GHz", + "processor_precision": "1", + "processor_perc_warn": "75" + } + ] + }, + "poller": "matches discovery" + } +} \ No newline at end of file diff --git a/tests/data/netonix_wispswitch.json b/tests/data/netonix_wispswitch.json new file mode 100644 index 000000000000..1c2955506a54 --- /dev/null +++ b/tests/data/netonix_wispswitch.json @@ -0,0 +1,20 @@ +{ + "processors": { + "discovery": { + "processors": [ + { + "entPhysicalIndex": "0", + "hrDeviceIndex": null, + "processor_oid": "0", + "processor_index": "0", + "processor_type": "ucd-old", + "processor_usage": "19", + "processor_descr": "CPU", + "processor_precision": "1", + "processor_perc_warn": "75" + } + ] + }, + "poller": "matches discovery" + } +} \ No newline at end of file diff --git a/tests/data/powerconnect_3031.json b/tests/data/powerconnect_3031.json new file mode 100644 index 000000000000..61ec59e35d90 --- /dev/null +++ b/tests/data/powerconnect_3031.json @@ -0,0 +1,8 @@ +{ + "processors": { + "discovery": { + "processors": [] + }, + "poller": "matches discovery" + } +} \ No newline at end of file diff --git a/tests/module_tables.yaml b/tests/module_tables.yaml new file mode 100644 index 000000000000..2b2a7e52e02f --- /dev/null +++ b/tests/module_tables.yaml @@ -0,0 +1,45 @@ +applications: + applications: + excluded_fields: [device_id, app_id, timestamp] + application_metrics: + excluded_fields: [app_id] + joins: + - { custom: 'INNER JOIN (SELECT app_id, app_type FROM applications WHERE `device_id`=?) I USING (app_id)' } + custom_where: '' +arp-table: + ipv4_mac: + excluded_fields: [device_id, port_id] +bgp-peers: + bgpPeers: + excluded_fields: [device_id, bgpPeer_id] + bgpPeers_cbgp: + excluded_fields: [device_id] +mempools: + mempools: + excluded_fields: [device_id, mempool_id] +ports: + ports: + excluded_fields: [device_id, port_id, poll_time, poll_period] + joins: + - { left: ports.port_id, right: ports_statistics.port_id } +processors: + processors: + excluded_fields: [device_id, processor_id] +sensors: + sensors: + excluded_fields: [device_id, sensor_id, state_translation_id, state_index_id, sensors_to_state_translations_id, lastupdate] + joins: + - { left: sensors.sensor_id, right: sensors_to_state_indexes.sensor_id } + - { left: sensors_to_state_indexes.state_index_id, right: state_indexes.state_index_id } + state_indexes: + excluded_fields: [device_id, sensor_id, state_translation_id, state_index_id, state_lastupdated] + joins: + - { left: state_indexes.state_index_id, right: state_translations.state_index_id } + - { custom: 'INNER JOIN ( SELECT i.state_index_id FROM `sensors_to_state_indexes` i LEFT JOIN `sensors` s ON (i.`sensor_id` = s.`sensor_id`) WHERE `device_id`=? GROUP BY i.state_index_id) d ON d.state_index_id = state_indexes.state_index_id' } + custom_where: '' +storage: + storage: + excluded_fields: [device_id, storage_id] +wireless: + wireless_sensors: + excluded_fields: [device_id, sensor_id, access_point_id, lastupdate] diff --git a/tests/snmpsim/3com.snmprec b/tests/snmpsim/3com.snmprec index 1b7325cae125..96e69793c5d4 100644 --- a/tests/snmpsim/3com.snmprec +++ b/tests/snmpsim/3com.snmprec @@ -1,2 +1,3 @@ 1.3.6.1.2.1.1.1.0|4|3Com SuperStack 3 1.3.6.1.2.1.1.2.0|6|1.3.6.1.4.1.43.10.27.4.1.2.11 +1.3.6.1.4.1.43.45.1.6.1.1.1.3.65536|2|42 diff --git a/tests/snmpsim/acos.snmprec b/tests/snmpsim/acos.snmprec index 97001fc4c648..f9323a395898 100644 --- a/tests/snmpsim/acos.snmprec +++ b/tests/snmpsim/acos.snmprec @@ -1,2 +1,458 @@ 1.3.6.1.2.1.1.1.0|4|Thunder Series Unified Application Service Gateway TH5630, ACOS 4.1.0-P5, -1.3.6.1.2.1.1.2.0|6|.1.3.6.1.4.1.22610.1.3.28 +1.3.6.1.2.1.1.2.0|6|1.3.6.1.4.1.22610.1.3.28 +1.3.6.1.2.1.25.3.2.1.1.1|2|1 +1.3.6.1.2.1.25.3.2.1.1.2|2|2 +1.3.6.1.2.1.25.3.2.1.1.3|2|3 +1.3.6.1.2.1.25.3.2.1.1.4|2|4 +1.3.6.1.2.1.25.3.2.1.1.5|2|5 +1.3.6.1.2.1.25.3.2.1.1.6|2|6 +1.3.6.1.2.1.25.3.2.1.1.7|2|7 +1.3.6.1.2.1.25.3.2.1.1.8|2|8 +1.3.6.1.2.1.25.3.2.1.1.9|2|9 +1.3.6.1.2.1.25.3.2.1.1.10|2|10 +1.3.6.1.2.1.25.3.2.1.1.11|2|11 +1.3.6.1.2.1.25.3.2.1.1.12|2|12 +1.3.6.1.2.1.25.3.2.1.1.13|2|13 +1.3.6.1.2.1.25.3.2.1.1.14|2|14 +1.3.6.1.2.1.25.3.2.1.1.15|2|15 +1.3.6.1.2.1.25.3.2.1.1.16|2|16 +1.3.6.1.2.1.25.3.2.1.1.17|2|17 +1.3.6.1.2.1.25.3.2.1.1.18|2|18 +1.3.6.1.2.1.25.3.2.1.1.19|2|19 +1.3.6.1.2.1.25.3.2.1.1.20|2|20 +1.3.6.1.2.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2.1.25.3.2.1.3.5|4|Data CPU4 +1.3.6.1.2.1.25.3.2.1.3.6|4|Data CPU5 +1.3.6.1.2.1.25.3.2.1.3.7|4|Data CPU6 +1.3.6.1.2.1.25.3.2.1.3.8|4|Data CPU7 +1.3.6.1.2.1.25.3.2.1.3.9|4|Data CPU8 +1.3.6.1.2.1.25.3.2.1.3.10|4|Data CPU9 +1.3.6.1.2.1.25.3.2.1.3.11|4|Data CPU10 +1.3.6.1.2.1.25.3.2.1.3.12|4|Data CPU11 +1.3.6.1.2.1.25.3.2.1.3.13|4|Data CPU12 +1.3.6.1.2.1.25.3.2.1.3.14|4|Data CPU13 +1.3.6.1.2.1.25.3.2.1.3.15|4|Data CPU14 +1.3.6.1.2.1.25.3.2.1.3.16|4|Data CPU15 +1.3.6.1.2.1.25.3.2.1.3.17|4|Data CPU16 +1.3.6.1.2.1.25.3.2.1.3.18|4|Data CPU17 +1.3.6.1.2.1.25.3.2.1.3.19|4|Data CPU18 +1.3.6.1.2.1.25.3.2.1.3.20|4|Data CPU19 +1.3.6.1.2.1.25.3.2.1.3.21|4|Data CPU20 +1.3.6.1.2.1.25.3.2.1.3.22|4|Data CPU21 +1.3.6.1.2.1.25.3.2.1.3.23|4|Data CPU22 +1.3.6.1.2.1.25.3.2.1.3.24|4|Data CPU23 +1.3.6.1.2.1.25.3.2.1.3.25|4|Data CPU24 +1.3.6.1.2.1.25.3.2.1.3.26|4|Data CPU25 +1.3.6.1.2.1.25.3.2.1.3.27|4|Data CPU26 +1.3.6.1.2.1.25.3.2.1.3.28|4|Data CPU27 +1.3.6.1.2.1.25.3.2.1.3.29|4|Data CPU28 +1.3.6.1.2.1.25.3.2.1.3.30|4|Data CPU29 +1.3.6.1.2.1.25.3.2.1.3.31|4|Data CPU30 +1.3.6.1.2.1.25.3.2.1.3.32|4|Data CPU31 +1.3.6.1.2.1.25.3.2.1.4.1|6|0.0 +1.3.6.1.2.1.25.3.2.1.4.2|6|0.0 +1.3.6.1.2.1.25.3.2.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.2.4.1.3.2.1.1.2|2|2 +1.3.6.1.4.1.22610.2.4.1.3.2.1.1.3|2|3 +1.3.6.1.4.1.22610.2.4.1.3.2.1.1.4|2|4 +1.3.6.1.4.1.22610.2.4.1.3.2.1.1.5|2|5 +1.3.6.1.4.1.22610.2.4.1.3.2.1.1.6|2|6 +1.3.6.1.4.1.22610.2.4.1.3.2.1.1.7|2|7 +1.3.6.1.4.1.22610.2.4.1.3.2.1.1.8|2|8 +1.3.6.1.4.1.22610.2.4.1.3.2.1.1.9|2|9 +1.3.6.1.4.1.22610.2.4.1.3.2.1.1.10|2|10 +1.3.6.1.4.1.22610.2.4.1.3.2.1.1.11|2|11 +1.3.6.1.4.1.22610.2.4.1.3.2.1.1.12|2|12 +1.3.6.1.4.1.22610.2.4.1.3.2.1.1.13|2|13 +1.3.6.1.4.1.22610.2.4.1.3.2.1.1.14|2|14 +1.3.6.1.4.1.22610.2.4.1.3.2.1.1.15|2|15 +1.3.6.1.4.1.22610.2.4.1.3.2.1.1.16|2|16 +1.3.6.1.4.1.22610.2.4.1.3.2.1.1.17|2|17 +1.3.6.1.4.1.22610.2.4.1.3.2.1.1.18|2|18 +1.3.6.1.4.1.22610.2.4.1.3.2.1.1.19|2|19 +1.3.6.1.4.1.22610.2.4.1.3.2.1.1.20|2|20 +1.3.6.1.4.1.22610.2.4.1.3.2.1.1.21|2|21 +1.3.6.1.4.1.22610.2.4.1.3.2.1.1.22|2|22 +1.3.6.1.4.1.22610.2.4.1.3.2.1.1.23|2|23 +1.3.6.1.4.1.22610.2.4.1.3.2.1.1.24|2|24 +1.3.6.1.4.1.22610.2.4.1.3.2.1.1.25|2|25 +1.3.6.1.4.1.22610.2.4.1.3.2.1.1.26|2|26 +1.3.6.1.4.1.22610.2.4.1.3.2.1.1.27|2|27 +1.3.6.1.4.1.22610.2.4.1.3.2.1.1.28|2|28 +1.3.6.1.4.1.22610.2.4.1.3.2.1.1.29|2|29 +1.3.6.1.4.1.22610.2.4.1.3.2.1.1.30|2|30 +1.3.6.1.4.1.22610.2.4.1.3.2.1.1.31|2|31 +1.3.6.1.4.1.22610.2.4.1.3.2.1.2.0|4|39 +1.3.6.1.4.1.22610.2.4.1.3.2.1.2.1|4|14 +1.3.6.1.4.1.22610.2.4.1.3.2.1.2.2|4|19 +1.3.6.1.4.1.22610.2.4.1.3.2.1.2.3|4|14 +1.3.6.1.4.1.22610.2.4.1.3.2.1.2.4|4|17 +1.3.6.1.4.1.22610.2.4.1.3.2.1.2.5|4|18 +1.3.6.1.4.1.22610.2.4.1.3.2.1.2.6|4|22 +1.3.6.1.4.1.22610.2.4.1.3.2.1.2.7|4|18 +1.3.6.1.4.1.22610.2.4.1.3.2.1.2.8|4|17 +1.3.6.1.4.1.22610.2.4.1.3.2.1.2.9|4|20 +1.3.6.1.4.1.22610.2.4.1.3.2.1.2.10|4|23 +1.3.6.1.4.1.22610.2.4.1.3.2.1.2.11|4|10 +1.3.6.1.4.1.22610.2.4.1.3.2.1.2.12|4|21 +1.3.6.1.4.1.22610.2.4.1.3.2.1.2.13|4|20 +1.3.6.1.4.1.22610.2.4.1.3.2.1.2.14|4|20 +1.3.6.1.4.1.22610.2.4.1.3.2.1.2.15|4|10 +1.3.6.1.4.1.22610.2.4.1.3.2.1.2.16|4|19 +1.3.6.1.4.1.22610.2.4.1.3.2.1.2.17|4|22 +1.3.6.1.4.1.22610.2.4.1.3.2.1.2.18|4|20 +1.3.6.1.4.1.22610.2.4.1.3.2.1.2.19|4|28 +1.3.6.1.4.1.22610.2.4.1.3.2.1.2.20|4|20 +1.3.6.1.4.1.22610.2.4.1.3.2.1.2.21|4|22 +1.3.6.1.4.1.22610.2.4.1.3.2.1.2.22|4|20 +1.3.6.1.4.1.22610.2.4.1.3.2.1.2.23|4|20 +1.3.6.1.4.1.22610.2.4.1.3.2.1.2.24|4|20 +1.3.6.1.4.1.22610.2.4.1.3.2.1.2.25|4|20 +1.3.6.1.4.1.22610.2.4.1.3.2.1.2.26|4|22 +1.3.6.1.4.1.22610.2.4.1.3.2.1.2.27|4|18 +1.3.6.1.4.1.22610.2.4.1.3.2.1.2.28|4|16 +1.3.6.1.4.1.22610.2.4.1.3.2.1.2.29|4|14 +1.3.6.1.4.1.22610.2.4.1.3.2.1.2.30|4|22 +1.3.6.1.4.1.22610.2.4.1.3.2.1.2.31|4|20 +1.3.6.1.4.1.22610.2.4.1.3.2.1.3.0|2|39 +1.3.6.1.4.1.22610.2.4.1.3.2.1.3.1|2|14 +1.3.6.1.4.1.22610.2.4.1.3.2.1.3.2|2|19 +1.3.6.1.4.1.22610.2.4.1.3.2.1.3.3|2|14 +1.3.6.1.4.1.22610.2.4.1.3.2.1.3.4|2|17 +1.3.6.1.4.1.22610.2.4.1.3.2.1.3.5|2|18 +1.3.6.1.4.1.22610.2.4.1.3.2.1.3.6|2|22 +1.3.6.1.4.1.22610.2.4.1.3.2.1.3.7|2|18 +1.3.6.1.4.1.22610.2.4.1.3.2.1.3.8|2|17 +1.3.6.1.4.1.22610.2.4.1.3.2.1.3.9|2|20 +1.3.6.1.4.1.22610.2.4.1.3.2.1.3.10|2|23 +1.3.6.1.4.1.22610.2.4.1.3.2.1.3.11|2|10 +1.3.6.1.4.1.22610.2.4.1.3.2.1.3.12|2|21 +1.3.6.1.4.1.22610.2.4.1.3.2.1.3.13|2|20 +1.3.6.1.4.1.22610.2.4.1.3.2.1.3.14|2|20 +1.3.6.1.4.1.22610.2.4.1.3.2.1.3.15|2|10 +1.3.6.1.4.1.22610.2.4.1.3.2.1.3.16|2|19 +1.3.6.1.4.1.22610.2.4.1.3.2.1.3.17|2|22 +1.3.6.1.4.1.22610.2.4.1.3.2.1.3.18|2|20 +1.3.6.1.4.1.22610.2.4.1.3.2.1.3.19|2|28 +1.3.6.1.4.1.22610.2.4.1.3.2.1.3.20|2|20 +1.3.6.1.4.1.22610.2.4.1.3.2.1.3.21|2|22 +1.3.6.1.4.1.22610.2.4.1.3.2.1.3.22|2|20 +1.3.6.1.4.1.22610.2.4.1.3.2.1.3.23|2|20 +1.3.6.1.4.1.22610.2.4.1.3.2.1.3.24|2|20 +1.3.6.1.4.1.22610.2.4.1.3.2.1.3.25|2|20 +1.3.6.1.4.1.22610.2.4.1.3.2.1.3.26|2|22 +1.3.6.1.4.1.22610.2.4.1.3.2.1.3.27|2|18 +1.3.6.1.4.1.22610.2.4.1.3.2.1.3.28|2|16 +1.3.6.1.4.1.22610.2.4.1.3.2.1.3.29|2|14 +1.3.6.1.4.1.22610.2.4.1.3.2.1.3.30|2|22 +1.3.6.1.4.1.22610.2.4.1.3.2.1.3.31|2|20 +1.3.6.1.4.1.22610.2.4.1.3.2.1.4.0|2|1 +1.3.6.1.4.1.22610.2.4.1.3.2.1.4.1|2|0 +1.3.6.1.4.1.22610.2.4.1.3.2.1.4.2|2|0 +1.3.6.1.4.1.22610.2.4.1.3.2.1.4.3|2|0 +1.3.6.1.4.1.22610.2.4.1.3.2.1.4.4|2|0 +1.3.6.1.4.1.22610.2.4.1.3.2.1.4.5|2|0 +1.3.6.1.4.1.22610.2.4.1.3.2.1.4.6|2|0 +1.3.6.1.4.1.22610.2.4.1.3.2.1.4.7|2|0 +1.3.6.1.4.1.22610.2.4.1.3.2.1.4.8|2|0 +1.3.6.1.4.1.22610.2.4.1.3.2.1.4.9|2|0 +1.3.6.1.4.1.22610.2.4.1.3.2.1.4.10|2|0 +1.3.6.1.4.1.22610.2.4.1.3.2.1.4.11|2|0 +1.3.6.1.4.1.22610.2.4.1.3.2.1.4.12|2|0 +1.3.6.1.4.1.22610.2.4.1.3.2.1.4.13|2|0 +1.3.6.1.4.1.22610.2.4.1.3.2.1.4.14|2|0 +1.3.6.1.4.1.22610.2.4.1.3.2.1.4.15|2|0 +1.3.6.1.4.1.22610.2.4.1.3.2.1.4.16|2|0 +1.3.6.1.4.1.22610.2.4.1.3.2.1.4.17|2|0 +1.3.6.1.4.1.22610.2.4.1.3.2.1.4.18|2|0 +1.3.6.1.4.1.22610.2.4.1.3.2.1.4.19|2|0 +1.3.6.1.4.1.22610.2.4.1.3.2.1.4.20|2|0 +1.3.6.1.4.1.22610.2.4.1.3.2.1.4.21|2|0 +1.3.6.1.4.1.22610.2.4.1.3.2.1.4.22|2|0 +1.3.6.1.4.1.22610.2.4.1.3.2.1.4.23|2|0 +1.3.6.1.4.1.22610.2.4.1.3.2.1.4.24|2|0 +1.3.6.1.4.1.22610.2.4.1.3.2.1.4.25|2|0 +1.3.6.1.4.1.22610.2.4.1.3.2.1.4.26|2|0 +1.3.6.1.4.1.22610.2.4.1.3.2.1.4.27|2|0 +1.3.6.1.4.1.22610.2.4.1.3.2.1.4.28|2|0 +1.3.6.1.4.1.22610.2.4.1.3.2.1.4.29|2|0 +1.3.6.1.4.1.22610.2.4.1.3.2.1.4.30|2|0 +1.3.6.1.4.1.22610.2.4.1.3.2.1.4.31|2|0 diff --git a/tests/snmpsim/adtran-aos.snmprec b/tests/snmpsim/adtran-aos.snmprec index de41ca718055..cf1f9e9d3d08 100644 --- a/tests/snmpsim/adtran-aos.snmprec +++ b/tests/snmpsim/adtran-aos.snmprec @@ -1 +1,2 @@ 1.3.6.1.2.1.1.1.0|4|NetVanta +1.3.6.1.4.1.664.5.53.1.4.1.0|2|42 diff --git a/tests/snmpsim/aen.snmprec b/tests/snmpsim/aen.snmprec index 5502a1729ffc..f6f68aa37225 100644 --- a/tests/snmpsim/aen.snmprec +++ b/tests/snmpsim/aen.snmprec @@ -1 +1,2 @@ 1.3.6.1.2.1.1.1.0|4|AMN- +1.3.6.1.4.1.22420.1.1.20.0|2|42 diff --git a/tests/snmpsim/alteonos.snmprec b/tests/snmpsim/alteonos.snmprec index ded30af807ae..a7aaf48ec0e0 100644 --- a/tests/snmpsim/alteonos.snmprec +++ b/tests/snmpsim/alteonos.snmprec @@ -1,2 +1,5 @@ 1.3.6.1.2.1.1.1.0|4x|416c74656f6e204170706c69636174696f6e205377697463682035323234584c 1.3.6.1.2.1.1.2.0|6|1.3.6.1.4.1.1872.1.13.3.5.1 +1.3.6.1.4.1.1872.2.5.1.2.2.1.0|2|42 +1.3.6.1.4.1.1872.2.5.1.2.2.2.0|2|43 +1.3.6.1.4.1.1872.2.5.1.2.2.3.0|2|44 diff --git a/tests/snmpsim/aos.snmprec b/tests/snmpsim/aos.snmprec index a66fb2733ef4..face537a8fed 100644 --- a/tests/snmpsim/aos.snmprec +++ b/tests/snmpsim/aos.snmprec @@ -1,2 +1,3 @@ 1.3.6.1.2.1.1.1.0|4|Alcatel-Lucent OS6900-X20 7.3.4.310.R02 Service Release, November 15, 2016. 1.3.6.1.2.1.1.2.0|6|1.3.6.1.4.1.6486.801.1.1.2.1.10.1.1 +1.3.6.1.4.1.6486.801.1.2.1.16.1.1.1.1.1.11.0|2|42 diff --git a/tests/snmpsim/aos_1.snmprec b/tests/snmpsim/aos_1.snmprec index 839e6d56f449..7933a766879b 100644 --- a/tests/snmpsim/aos_1.snmprec +++ b/tests/snmpsim/aos_1.snmprec @@ -1,2 +1,3 @@ 1.3.6.1.2.1.1.1.0|4|Alcatel-Lucent OS6450-P24 6.6.4.268.R01 Service Release, September 17, 2014. 1.3.6.1.2.1.1.2.0|6|1.3.6.1.4.1.6486.800.1.1.2.1.12.1.6 +1.3.6.1.4.1.6486.800.1.2.1.16.1.1.1.13.0|2|42 diff --git a/tests/snmpsim/apsoluteos.snmprec b/tests/snmpsim/apsoluteos.snmprec index 6afb37291251..a9ac7b054f5e 100644 --- a/tests/snmpsim/apsoluteos.snmprec +++ b/tests/snmpsim/apsoluteos.snmprec @@ -1,2 +1,3 @@ 1.3.6.1.2.1.1.1.0|4|DefensePro with DPI, BWM, Basic, Flood and IPv6 1.3.6.1.2.1.1.2.0|6|1.3.6.1.4.1.89.1.1.62.16 +1.3.6.1.4.1.89.35.1.54.0|2|42 diff --git a/tests/snmpsim/avaya-ers.snmprec b/tests/snmpsim/avaya-ers.snmprec index 6bf994eb2448..03e0f5d51f95 100644 --- a/tests/snmpsim/avaya-ers.snmprec +++ b/tests/snmpsim/avaya-ers.snmprec @@ -1,2 +1,12 @@ 1.3.6.1.2.1.1.1.0|4|Ethernet Routing Switch 5530-24TFD HW:32 FW:6.0.0.18 SW:v6.3.2.011 BN:11 (c) Avaya Networks 1.3.6.1.2.1.1.2.0|6|1.3.6.1.4.1.45.3.65 +1.3.6.1.4.1.45.1.6.3.8.1.1.4.10|2|42 +1.3.6.1.4.1.45.1.6.3.8.1.1.4.20|2|42 +1.3.6.1.4.1.45.1.6.3.8.1.1.5.10|2|42 +1.3.6.1.4.1.45.1.6.3.8.1.1.5.20|2|42 +1.3.6.1.4.1.45.1.6.3.8.1.1.6.10|2|42 +1.3.6.1.4.1.45.1.6.3.8.1.1.6.20|2|42 +1.3.6.1.4.1.45.1.6.3.8.1.1.7.10|2|42 +1.3.6.1.4.1.45.1.6.3.8.1.1.7.20|2|42 +1.3.6.1.4.1.45.1.6.3.8.1.1.8.10|2|42 +1.3.6.1.4.1.45.1.6.3.8.1.1.8.20|2|42 diff --git a/tests/snmpsim/dnos.snmprec b/tests/snmpsim/dnos.snmprec index 2907771fe6b3..891a864354b4 100644 --- a/tests/snmpsim/dnos.snmprec +++ b/tests/snmpsim/dnos.snmprec @@ -1,2 +1,3 @@ 1.3.6.1.2.1.1.1.0|4|Dell Networking OS Operating System Version: 2.0 Application Software Version: 9.9(0.0P9) Series: S4048-ON Copyright (c) 1999-2015 by Dell Inc. All Rights Reserved. Build Time: Thu Feb 4 06:57:34 2016 1.3.6.1.2.1.1.2.0|6|1.3.6.1.4.1.6027.1.3.20 +1.3.6.1.4.1.6027.3.10.1.2.9.1.2.1|2|26 diff --git a/tests/snmpsim/ftos_1.snmprec b/tests/snmpsim/ftos_1.snmprec new file mode 100644 index 000000000000..6cd92d805127 --- /dev/null +++ b/tests/snmpsim/ftos_1.snmprec @@ -0,0 +1,3 @@ +1.3.6.1.2.1.1.1.0|4x|466F7263653130204E6574776F726B73205265616C2054696D65204F7065726174696E672053797374656D20536F667477617265DA466F7263653130204F7065726174696E672053797374656D2056657273696F6E3A20312E30DA466F7263653130204170706C69636174696F6E20536F6674776172652056657273696F6E3A20382E332E322E30DA436F707972696768742028632920313939392D3230313020627920466F7263653130204E6574776F726B732C20496E632EDA4275696C642054696D653A20576564204A756C20372031393A32373A3133205044542032303130 +1.3.6.1.2.1.1.2.0|6|1.3.6.1.4.1.6027.1.2.1 +1.3.6.1.4.1.6027.3.8.1.5.1.1.1.1|2|30 diff --git a/tests/snmpsim/ios.snmprec b/tests/snmpsim/ios.snmprec index 15f84889c2d0..81c1ee4c34c0 100644 --- a/tests/snmpsim/ios.snmprec +++ b/tests/snmpsim/ios.snmprec @@ -1,2 +1,3 @@ + 1.3.6.1.2.1.1.1.0|4x|436973636f20496e7465726e6574776f726b204f7065726174696e672053797374656d20536f667477617265200d0a494f532028746d2920433239353020536f667477617265202843323935302d49364b324c3251342d4d292c2056657273696f6e2031322e3128323229454131342c2052454c4541534520534f4654574152452028666331290d0a546563686e6963616c20537570706f72743a20687474703a2f2f7777772e636973636f2e636f6d2f74656368737570706f72740d0a436f707972696768742028632920313938362d3230313020627920636973636f2053797374656d732c20496e632e0d0a436f6d70696c6564205475652032362d4f 1.3.6.1.2.1.1.2.0|6|1.3.6.1.4.1.9.1.359 diff --git a/tests/snmpsim/ios_c3560e.snmprec b/tests/snmpsim/ios_c3560e.snmprec new file mode 100644 index 000000000000..a9863e2139a3 --- /dev/null +++ b/tests/snmpsim/ios_c3560e.snmprec @@ -0,0 +1,12 @@ +1.3.6.1.2.1.1.1.0|4x|436973636f20494f5320536f6674776172652c2043333536304520536f66747761726520284333353630452d554e4956455253414c4b392d4d292c2056657273696f6e2031352e302832295345372c2052454c4541534520534f4654574152452028666331290d0a546563686e6963616c20537570706f72743a20687474703a2f2f7777772e636973636f2e636f6d2f74656368737570706f72740d0a436f707972696768742028632920313938362d3230313420627920436973636f2053797374656d732c20496e632e0d0a436f6d70696c6564205468752032332d4f63742d31342031333a32372062792070726f645f72656c5f7465616d +1.3.6.1.2.1.1.2.0|6|1.3.6.1.4.1.9.1.1226 +1.3.6.1.4.1.9.9.109.1.1.1.1.2.1|2|0 +1.3.6.1.4.1.9.9.109.1.1.1.1.3.1|66|9 +1.3.6.1.4.1.9.9.109.1.1.1.1.4.1|66|12 +1.3.6.1.4.1.9.9.109.1.1.1.1.5.1|66|12 +1.3.6.1.4.1.9.9.109.1.1.1.1.6.1|66|9 +1.3.6.1.4.1.9.9.109.1.1.1.1.7.1|66|12 +1.3.6.1.4.1.9.9.109.1.1.1.1.8.1|66|12 +1.3.6.1.4.1.9.9.109.1.1.1.1.9.1|66|5 +1.3.6.1.4.1.9.9.109.1.1.1.1.10.1|66|9 +1.3.6.1.4.1.9.9.109.1.1.1.1.11.1|66|1 diff --git a/tests/snmpsim/linux.snmprec b/tests/snmpsim/linux.snmprec index d9682b01f915..fcbd58141c16 100644 --- a/tests/snmpsim/linux.snmprec +++ b/tests/snmpsim/linux.snmprec @@ -1,2 +1,169 @@ 1.3.6.1.2.1.1.1.0|4|Linux some.host.name 4.9.0 #1 SMP Mon Dec 12 14:44:53 CST 2016 x86_64 1.3.6.1.2.1.1.2.0|6|1.3.6.1.4.1.8072.3.2.10 +1.3.6.1.2.1.25.3.2.1.1.196608|2|196608 +1.3.6.1.2.1.25.3.2.1.1.196609|2|196609 +1.3.6.1.2.1.25.3.2.1.1.196610|2|196610 +1.3.6.1.2.1.25.3.2.1.1.196611|2|196611 +1.3.6.1.2.1.25.3.2.1.1.196612|2|196612 +1.3.6.1.2.1.25.3.2.1.1.196613|2|196613 +1.3.6.1.2.1.25.3.2.1.1.196614|2|196614 +1.3.6.1.2.1.25.3.2.1.1.196615|2|196615 +1.3.6.1.2.1.25.3.2.1.1.262145|2|262145 +1.3.6.1.2.1.25.3.2.1.1.262146|2|262146 +1.3.6.1.2.1.25.3.2.1.1.262147|2|262147 +1.3.6.1.2.1.25.3.2.1.1.393232|2|393232 +1.3.6.1.2.1.25.3.2.1.1.786432|2|786432 +1.3.6.1.2.1.25.3.2.1.2.196608|6|1.3.6.1.2.1.25.3.1.3 +1.3.6.1.2.1.25.3.2.1.2.196609|6|1.3.6.1.2.1.25.3.1.3 +1.3.6.1.2.1.25.3.2.1.2.196610|6|1.3.6.1.2.1.25.3.1.3 +1.3.6.1.2.1.25.3.2.1.2.196611|6|1.3.6.1.2.1.25.3.1.3 +1.3.6.1.2.1.25.3.2.1.2.196612|6|1.3.6.1.2.1.25.3.1.3 +1.3.6.1.2.1.25.3.2.1.2.196613|6|1.3.6.1.2.1.25.3.1.3 +1.3.6.1.2.1.25.3.2.1.2.196614|6|1.3.6.1.2.1.25.3.1.3 +1.3.6.1.2.1.25.3.2.1.2.196615|6|1.3.6.1.2.1.25.3.1.3 +1.3.6.1.2.1.25.3.2.1.2.262145|6|1.3.6.1.2.1.25.3.1.4 +1.3.6.1.2.1.25.3.2.1.2.262146|6|1.3.6.1.2.1.25.3.1.4 +1.3.6.1.2.1.25.3.2.1.2.262147|6|1.3.6.1.2.1.25.3.1.4 +1.3.6.1.2.1.25.3.2.1.2.393232|6|1.3.6.1.2.1.25.3.1.6 +1.3.6.1.2.1.25.3.2.1.2.786432|6|1.3.6.1.2.1.25.3.1.12 +1.3.6.1.2.1.25.3.2.1.3.196608|4|GenuineIntel: Intel(R) Core(TM) i7-3632QM CPU @ 2.20GHz +1.3.6.1.2.1.25.3.2.1.3.196609|4|GenuineIntel: Intel(R) Core(TM) i7-3632QM CPU @ 2.20GHz +1.3.6.1.2.1.25.3.2.1.3.196610|4|GenuineIntel: Intel(R) Core(TM) i7-3632QM CPU @ 2.20GHz +1.3.6.1.2.1.25.3.2.1.3.196611|4|GenuineIntel: Intel(R) Core(TM) i7-3632QM CPU @ 2.20GHz +1.3.6.1.2.1.25.3.2.1.3.196612|4|GenuineIntel: Intel(R) Core(TM) i7-3632QM CPU @ 2.20GHz +1.3.6.1.2.1.25.3.2.1.3.196613|4|GenuineIntel: Intel(R) Core(TM) i7-3632QM CPU @ 2.20GHz +1.3.6.1.2.1.25.3.2.1.3.196614|4|GenuineIntel: Intel(R) Core(TM) i7-3632QM CPU @ 2.20GHz +1.3.6.1.2.1.25.3.2.1.3.196615|4|GenuineIntel: Intel(R) Core(TM) i7-3632QM CPU @ 2.20GHz +1.3.6.1.2.1.25.3.2.1.3.262145|4|network interface lo +1.3.6.1.2.1.25.3.2.1.3.262146|4|network interface enp4s0 +1.3.6.1.2.1.25.3.2.1.3.262147|4|network interface wlo1 +1.3.6.1.2.1.25.3.2.1.3.393232|4|SCSI disk (/dev/sda) +1.3.6.1.2.1.25.3.2.1.3.786432|4|Guessing that there's a floating point co-processor +1.3.6.1.2.1.25.3.2.1.4.196608|6|0.0 +1.3.6.1.2.1.25.3.2.1.4.196609|6|0.0 +1.3.6.1.2.1.25.3.2.1.4.196610|6|0.0 +1.3.6.1.2.1.25.3.2.1.4.196611|6|0.0 +1.3.6.1.2.1.25.3.2.1.4.196612|6|0.0 +1.3.6.1.2.1.25.3.2.1.4.196613|6|0.0 +1.3.6.1.2.1.25.3.2.1.4.196614|6|0.0 +1.3.6.1.2.1.25.3.2.1.4.196615|6|0.0 +1.3.6.1.2.1.25.3.2.1.4.262145|6|0.0 +1.3.6.1.2.1.25.3.2.1.4.262146|6|0.0 +1.3.6.1.2.1.25.3.2.1.4.262147|6|0.0 +1.3.6.1.2.1.25.3.2.1.4.393232|6|0.0 +1.3.6.1.2.1.25.3.2.1.4.786432|6|0.0 +1.3.6.1.2.1.25.3.2.1.5.196608|2|2 +1.3.6.1.2.1.25.3.2.1.5.196609|2|2 +1.3.6.1.2.1.25.3.2.1.5.196610|2|2 +1.3.6.1.2.1.25.3.2.1.5.196611|2|2 +1.3.6.1.2.1.25.3.2.1.5.196612|2|2 +1.3.6.1.2.1.25.3.2.1.5.196613|2|2 +1.3.6.1.2.1.25.3.2.1.5.196614|2|2 +1.3.6.1.2.1.25.3.2.1.5.196615|2|2 +1.3.6.1.2.1.25.3.2.1.5.262145|2|2 +1.3.6.1.2.1.25.3.2.1.5.262146|2|2 +1.3.6.1.2.1.25.3.2.1.5.262147|2|2 +1.3.6.1.2.1.25.3.2.1.6.262145|65|0 +1.3.6.1.2.1.25.3.2.1.6.262146|65|0 +1.3.6.1.2.1.25.3.2.1.6.262147|65|0 +1.3.6.1.2.1.25.3.3.1.1.196608|6|0.0 +1.3.6.1.2.1.25.3.3.1.1.196609|6|0.0 +1.3.6.1.2.1.25.3.3.1.1.196610|6|0.0 +1.3.6.1.2.1.25.3.3.1.1.196611|6|0.0 +1.3.6.1.2.1.25.3.3.1.1.196612|6|0.0 +1.3.6.1.2.1.25.3.3.1.1.196613|6|0.0 +1.3.6.1.2.1.25.3.3.1.1.196614|6|0.0 +1.3.6.1.2.1.25.3.3.1.1.196615|6|0.0 +1.3.6.1.2.1.25.3.3.1.2.196608|2|3 +1.3.6.1.2.1.25.3.3.1.2.196609|2|2 +1.3.6.1.2.1.25.3.3.1.2.196610|2|2 +1.3.6.1.2.1.25.3.3.1.2.196611|2|1 +1.3.6.1.2.1.25.3.3.1.2.196612|2|2 +1.3.6.1.2.1.25.3.3.1.2.196613|2|3 +1.3.6.1.2.1.25.3.3.1.2.196614|2|1 +1.3.6.1.2.1.25.3.3.1.2.196615|2|2 +1.3.6.1.2.1.25.3.4.1.1.262145|2|1 +1.3.6.1.2.1.25.3.4.1.1.262146|2|2 +1.3.6.1.2.1.25.3.4.1.1.262147|2|3 +1.3.6.1.2.1.25.3.6.1.1.393232|2|1 +1.3.6.1.2.1.25.3.6.1.2.393232|2|2 +1.3.6.1.2.1.25.3.6.1.3.393232|2|2 +1.3.6.1.2.1.25.3.6.1.4.393232|2|488386584 +1.3.6.1.2.1.25.3.7.1.1.393232.1|2|1 +1.3.6.1.2.1.25.3.7.1.1.393232.2|2|2 +1.3.6.1.2.1.25.3.7.1.1.393232.3|2|3 +1.3.6.1.2.1.25.3.7.1.2.393232.1|4|/dev/sda1 +1.3.6.1.2.1.25.3.7.1.2.393232.2|4|/dev/sda2 +1.3.6.1.2.1.25.3.7.1.2.393232.3|4|/dev/sda3 +1.3.6.1.2.1.25.3.7.1.3.393232.1|4|0x801 +1.3.6.1.2.1.25.3.7.1.3.393232.2|4|0x802 +1.3.6.1.2.1.25.3.7.1.3.393232.3|4|0x803 +1.3.6.1.2.1.25.3.7.1.4.393232.1|2|258095 +1.3.6.1.2.1.25.3.7.1.4.393232.2|2|472074540 +1.3.6.1.2.1.25.3.7.1.4.393232.3|2|-1 +1.3.6.1.2.1.25.3.7.1.5.393232.1|2|29 +1.3.6.1.2.1.25.3.7.1.5.393232.2|2|6 +1.3.6.1.2.1.25.3.7.1.5.393232.3|2|-1 +1.3.6.1.2.1.25.3.8.1.1.4|2|4 +1.3.6.1.2.1.25.3.8.1.1.6|2|6 +1.3.6.1.2.1.25.3.8.1.1.8|2|8 +1.3.6.1.2.1.25.3.8.1.1.10|2|10 +1.3.6.1.2.1.25.3.8.1.1.28|2|28 +1.3.6.1.2.1.25.3.8.1.1.29|2|29 +1.3.6.1.2.1.25.3.8.1.1.30|2|30 +1.3.6.1.2.1.25.3.8.1.2.4|4|/run +1.3.6.1.2.1.25.3.8.1.2.6|4|/ +1.3.6.1.2.1.25.3.8.1.2.8|4|/dev/shm +1.3.6.1.2.1.25.3.8.1.2.10|4|/sys/fs/cgroup +1.3.6.1.2.1.25.3.8.1.2.28|4|/tmp +1.3.6.1.2.1.25.3.8.1.2.29|4|/boot +1.3.6.1.2.1.25.3.8.1.2.30|4|/run/user/1000 +1.3.6.1.2.1.25.3.8.1.3.4|4| +1.3.6.1.2.1.25.3.8.1.3.6|4| +1.3.6.1.2.1.25.3.8.1.3.8|4| +1.3.6.1.2.1.25.3.8.1.3.10|4| +1.3.6.1.2.1.25.3.8.1.3.28|4| +1.3.6.1.2.1.25.3.8.1.3.29|4| +1.3.6.1.2.1.25.3.8.1.3.30|4| +1.3.6.1.2.1.25.3.8.1.4.4|6|1.3.6.1.2.1.25.3.9.1 +1.3.6.1.2.1.25.3.8.1.4.6|6|1.3.6.1.2.1.25.3.9.23 +1.3.6.1.2.1.25.3.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0:0:0.0 +1.3.6.1.2.1.25.3.8.1.8.29|4|0-1-1,0:0:0.0 +1.3.6.1.2.1.25.3.8.1.8.30|4|0-1-1,0:0:0.0 +1.3.6.1.2.1.25.3.8.1.9.4|4|0-1-1,0:0:0.0 +1.3.6.1.2.1.25.3.8.1.9.6|4|0-1-1,0:0:0.0 +1.3.6.1.2.1.25.3.8.1.9.8|4|0-1-1,0:0:0.0 +1.3.6.1.2.1.25.3.8.1.9.10|4|0-1-1,0:0:0.0 +1.3.6.1.2.1.25.3.8.1.9.28|4|0-1-1,0:0:0.0 +1.3.6.1.2.1.25.3.8.1.9.29|4|0-1-1,0:0:0.0 +1.3.6.1.2.1.25.3.8.1.9.30|4|0-1-1,0:0:0.0 diff --git a/tests/snmpsim/netonix_wispswitch.snmprec b/tests/snmpsim/netonix_wispswitch.snmprec index 5151adf545fc..5376ca114350 100644 --- a/tests/snmpsim/netonix_wispswitch.snmprec +++ b/tests/snmpsim/netonix_wispswitch.snmprec @@ -1,2 +1,3 @@ 1.3.6.1.2.1.1.1.0|4|Netonix WS-12-250-AC 1.3.6.1.2.1.1.2.0|6|1.3.6.1.4.1.46242 +1.3.6.1.4.1.2021.11.11.0|2|81 diff --git a/tests/snmpsim/powerconnect_3024.snmprec b/tests/snmpsim/powerconnect_3024.snmprec new file mode 100644 index 000000000000..2b2563578db1 --- /dev/null +++ b/tests/snmpsim/powerconnect_3024.snmprec @@ -0,0 +1,3 @@ +1.3.6.1.2.1.1.1.0|4|Powerconnect 8024F, 5.1.8.2, VxWorks 6.6 +1.3.6.1.2.1.1.2.0|6|1.3.6.1.4.1.674.10895.3024 +1.3.6.1.4.1.674.10895.5000.2.6132.1.1.1.1.4.9.0|4| 5 Secs ( 35.27%) 60 Secs ( 33.01%) 300 Secs ( 32.74%) diff --git a/tests/snmpsim/powerconnect_3031.snmprec b/tests/snmpsim/powerconnect_3031.snmprec index 729fcd05c8cb..32a36b34c9fe 100644 --- a/tests/snmpsim/powerconnect_3031.snmprec +++ b/tests/snmpsim/powerconnect_3031.snmprec @@ -1,2 +1,3 @@ 1.3.6.1.2.1.1.1.0|4|48G Ethernet Switch 1.3.6.1.2.1.1.2.0|6|1.3.6.1.4.1.674.10895.3031 +1.3.6.1.4.1.89.1.7.0|2|83 diff --git a/tests/snmpsim/skel.snmprec b/tests/snmpsim/skel.snmprec deleted file mode 100644 index 984587ea06e6..000000000000 --- a/tests/snmpsim/skel.snmprec +++ /dev/null @@ -1,2 +0,0 @@ -1.3.6.1.2.1.1.1.0|4| -1.3.6.1.2.1.1.2.0|6|