initial commit; version 22.5.12042

This commit is contained in:
2022-12-12 23:28:25 -05:00
commit af1b03d79f
17653 changed files with 22692970 additions and 0 deletions

View File

@ -0,0 +1,107 @@
<?php
include(__DIR__ . '/../includes/sql-config.inc.php'); // Here required DB connect
//include(dirname(__FILE__) . '/../includes/defaults.inc.php');
//include(dirname(__FILE__) . '/../config.php');
//include(dirname(__FILE__) . '/../includes/definitions.inc.php');
//include(dirname(__FILE__) . '/../includes/functions.inc.php');
include(__DIR__ . '/../html/includes/functions.inc.php');
class HtmlIncludesFunctionsTest extends \PHPUnit\Framework\TestCase
{
/**
* @dataProvider providerNiceCase
*/
public function testNiceCase($string, $result)
{
$this->assertSame($result, nicecase($string));
}
public function providerNiceCase()
{
return array(
array('bgp_peer', 'BGP Peer'),
array('bgp_peer_af', 'BGP Peer (AFI/SAFI)'),
array('netscaler_vsvr', 'Netscaler vServer'),
array('netscaler_svc', 'Netscaler Service'),
array('mempool', 'Memory'),
array('ipsec_tunnels', 'IPSec Tunnels'),
array('vrf', 'VRF'),
array('isis', 'IS-IS'),
array('cef', 'CEF'),
array('eigrp', 'EIGRP'),
array('ospf', 'OSPF'),
array('bgp', 'BGP'),
array('ases', 'ASes'),
array('vpns', 'VPNs'),
array('dbm', 'dBm'),
array('mysql', 'MySQL'),
array('powerdns', 'PowerDNS'),
array('bind', 'BIND'),
array('ntpd', 'NTPd'),
array('powerdns-recursor', 'PowerDNS Recursor'),
array('freeradius', 'FreeRADIUS'),
array('postfix_mailgraph', 'Postfix Mailgraph'),
array('ge', 'Greater or equal'),
array('le', 'Less or equal'),
array('notequals', 'Doesn\'t equal'),
array('notmatch', 'Doesn\'t match'),
array('diskio', 'Disk I/O'),
array('ipmi', 'IPMI'),
array('snmp', 'SNMP'),
array('mssql', 'SQL Server'),
array('apower', 'Apparent power'),
array('proxysg', 'Proxy SG'),
array('', ''),
array(' some text here ', ' some text here '),
array('some text here ', 'Some text here '),
array(NULL, ''),
array(FALSE, ''),
array(array('test'), '')
);
}
/**
* @dataProvider providerGetDeviceIcon
* @group device
*/
public function testGetDeviceIcon($device, $base_icon, $result)
{
$GLOBALS['config']['base_url'] = 'http://localhost';
$this->assertSame($result, get_device_icon($device, $base_icon));
}
public function providerGetDeviceIcon()
{
return array(
// by $device['os']
array(array('os' => 'screenos', 'icon' => '', 'sysObjectID' => ''), TRUE, 'juniper-old'),
// by $device['os'] and icon definition
array(array('os' => 'ios', 'icon' => '', 'sysObjectID' => ''), TRUE, 'cisco'),
// by $device['os'] and vendor definition
array(array('os' => 'cyclades', 'icon' => '', 'sysObjectID' => ''), TRUE, 'emerson'),
// by $device['os'] and vendor defined icon
array(array('os' => 'summitd-wl', 'icon' => '', 'sysObjectID' => ''), TRUE, 'summitd'),
// by $device['os'] and vendor defined icon
array(array('os' => 'summitd-wl', 'icon' => '', 'sysObjectID' => '', 'vendor' => 'Summit Development'), TRUE, 'summitd'),
// by $device['os'] and vendor definition (with non alpha chars)
//array(array('os' => 'ccplus'), TRUE, 'c_c_power'),
// by $device['os'] and distro name in array
array(array('os' => 'linux', 'icon' => '', 'sysObjectID' => '', 'distro' => 'RedHat'), TRUE, 'redhat'),
// by $device['os'] and icon in array
array(array('os' => 'ios', 'icon' => 'cisco-old', 'sysObjectID' => ''), TRUE, 'cisco-old'),
// by all, who win?
array(array('os' => 'cyclades', 'distro' => 'RedHat', 'icon' => 'cisco-old', 'sysObjectID' => ''), TRUE, 'cisco-old'),
// unknown
array(array('os' => 'yohoho', 'icon' => '', 'sysObjectID' => ''), TRUE, 'generic'),
// empty
array(array(), TRUE, 'generic'),
// Last, check with img tag
array(array('os' => 'ios'), FALSE, '<img src="http://localhost/images/os/cisco.png" srcset="http://localhost/images/os/cisco_2x.png 2x" alt="" />'),
);
}
}
// EOF

View File

@ -0,0 +1,389 @@
<?php
$base_dir = realpath(__DIR__ . '/..');
$config['install_dir'] = $base_dir;
include(__DIR__ . '/../includes/defaults.inc.php');
//include(dirname(__FILE__) . '/../config.php');
include(__DIR__ . '/../includes/common.inc.php');
include(__DIR__ . '/../includes/definitions.inc.php');
include(__DIR__ . '/../includes/functions.inc.php');
include(__DIR__ . '/../html/includes/functions.inc.php');
class HtmlIncludesPrintTest extends \PHPUnit\Framework\TestCase
{
/**
* @dataProvider providerGetTableHeader
* @group common
*/
public function testGetTableHeader($vars, $result)
{
$cols = array(
array(NULL, 'class="state-marker"'),
array(NULL, 'style="width: 1px;"'),
'device' => array('Local address', 'style="width: 150px;"'),
array(NULL, 'style="width: 20px;"'),
'peer_ip' => array('Peer address', 'style="width: 150px;"'),
'type' => array('Type', 'style="width: 50px;"'),
array('Family'),
'peer_as' => 'Remote AS',
'state' => 'State',
'Uptime / Updates',
NULL
);
$this->assertSame($result, get_table_header($cols, $vars));
}
public function providerGetTableHeader()
{
return array(
array( // Sorting enabled
array('page' => 'routing', 'protocol' => 'bgp', 'type' => 'all'),
' <thead>
<tr>
<th class="state-marker"></th>
<th style="width: 1px;"></th>
<th style="width: 150px;"><a href="routing/protocol=bgp/type=all/sort=device/">Local address</a></th>
<th style="width: 20px;"></th>
<th style="width: 150px;"><a href="routing/protocol=bgp/type=all/sort=peer_ip/">Peer address</a></th>
<th style="width: 50px;"><a href="routing/protocol=bgp/type=all/sort=type/">Type</a></th>
<th >Family</th>
<th><a href="routing/protocol=bgp/type=all/sort=peer_as/">Remote AS</a></th>
<th><a href="routing/protocol=bgp/type=all/sort=state/">State</a></th>
<th>Uptime / Updates</th>
<th></th>
</tr>
</thead>' . PHP_EOL
),
array( // Sorting enabled, selected type
array('page' => 'routing', 'protocol' => 'bgp', 'type' => 'all', 'sort' => 'type'),
' <thead>
<tr>
<th class="state-marker"></th>
<th style="width: 1px;"></th>
<th style="width: 150px;"><a href="routing/protocol=bgp/type=all/sort=device/">Local address</a></th>
<th style="width: 20px;"></th>
<th style="width: 150px;"><a href="routing/protocol=bgp/type=all/sort=peer_ip/">Peer address</a></th>
<th style="width: 50px;"><a href="routing/protocol=bgp/type=all/sort=type/sort_order=desc/">Type&nbsp;&nbsp;<i class="small glyphicon glyphicon-triangle-bottom"></i></a></th>
<th >Family</th>
<th><a href="routing/protocol=bgp/type=all/sort=peer_as/">Remote AS</a></th>
<th><a href="routing/protocol=bgp/type=all/sort=state/">State</a></th>
<th>Uptime / Updates</th>
<th></th>
</tr>
</thead>' . PHP_EOL
),
array( // Sorting disabled
array(),
' <thead>
<tr>
<th class="state-marker"></th>
<th style="width: 1px;"></th>
<th style="width: 150px;">Local address</th>
<th style="width: 20px;"></th>
<th style="width: 150px;">Peer address</th>
<th style="width: 50px;">Type</th>
<th >Family</th>
<th>Remote AS</th>
<th>State</th>
<th>Uptime / Updates</th>
<th></th>
</tr>
</thead>' . PHP_EOL
),
);
}
/**
* @dataProvider providerGetForm
* @group forms
*/
public function testGetForm($form, $html)
{
//echo "\n<<<FORM\n" . generate_form($form) . "\nFORM\n";
$this->assertSame($html, generate_form($form));
}
public function providerGetForm()
{
// Temporary use direct array, need switch to json+txt includes
$array = [];
$form = ['type' => 'horizontal',
'id' => 'logonform',
//'space' => '20px',
//'title' => 'Logon',
//'icon' => 'oicon-key',
'class' => NULL, // Use empty class here, to not add additional divs
'fieldset' => ['logon' => 'Please log in:'],
];
$form['row'][0]['username'] = [
'type' => 'text',
'fieldset' => 'logon',
'name' => 'Username',
'placeholder' => '',
'class' => 'input-xlarge',
//'width' => '95%',
'value' => ''];
$form['row'][1]['password'] = [
'type' => 'password',
'fieldset' => 'logon',
'name' => 'Password',
'autocomplete' => TRUE,
'placeholder' => '',
'class' => 'input-xlarge',
//'width' => '95%',
'value' => ''];
$form['row'][3]['submit'] = [
'type' => 'submit',
'name' => 'Log in',
'icon' => 'icon-lock',
//'right' => TRUE,
'div_class' => 'controls',
'class' => 'btn-large'];
$html = <<<FORM
<!-- START logonform -->
<form method="POST" id="logonform" name="logonform" action="" class="form form-horizontal" style="margin-bottom: 0px;">
<fieldset> <!-- START fieldset-logon -->
<div class="control-group">
<div class="controls">
<h3>Please log in:</h3>
</div>
</div>
<div id="username_div" class="control-group" style="margin-bottom: 5px;"> <!-- START row-0 -->
<label class="control-label" for="username">Username</label>
<div id="username_div" class="controls">
<input type="text" placeholder="" name="username" id="username" class="input input-xlarge" value="" />
</div>
</div> <!-- END row-0 -->
<div id="password_div" class="control-group" style="margin-bottom: 5px;"> <!-- START row-1 -->
<label class="control-label" for="password">Password</label>
<div id="password_div" class="controls">
<input type="password" placeholder="" name="password" id="password" class="input input-xlarge" value="" />
</div>
</div> <!-- END row-1 -->
</fieldset> <!-- END fieldset-logon -->
<div id="submit_div" class="controls">
<button id="submit" name="submit" type="submit" class="btn btn-default btn-large text-nowrap" value=""><i style="margin-right: 0px;" class="icon-lock"></i>&nbsp;&nbsp;Log in</button>
</div>
</form>
<!-- END logonform -->
FORM;
$array[] = [$form, $html];
// Force text field with autocomplete OFF
$form['row'][0]['username']['autocomplete'] = FALSE;
$html = <<<FORM
<!-- START logonform -->
<form method="POST" id="logonform" name="logonform" action="" class="form form-horizontal" style="margin-bottom: 0px;">
<fieldset> <!-- START fieldset-logon -->
<div class="control-group">
<div class="controls">
<h3>Please log in:</h3>
</div>
</div>
<div id="username_div" class="control-group" style="margin-bottom: 5px;"> <!-- START row-0 -->
<label class="control-label" for="username">Username</label>
<div id="username_div" class="controls">
<input type="text" autocomplete="off" placeholder="" name="username" id="username" class="input input-xlarge" value="" />
</div>
</div> <!-- END row-0 -->
<div id="password_div" class="control-group" style="margin-bottom: 5px;"> <!-- START row-1 -->
<label class="control-label" for="password">Password</label>
<div id="password_div" class="controls">
<input type="password" placeholder="" name="password" id="password" class="input input-xlarge" value="" />
</div>
</div> <!-- END row-1 -->
</fieldset> <!-- END fieldset-logon -->
<div id="submit_div" class="controls">
<button id="submit" name="submit" type="submit" class="btn btn-default btn-large text-nowrap" value=""><i style="margin-right: 0px;" class="icon-lock"></i>&nbsp;&nbsp;Log in</button>
</div>
</form>
<!-- END logonform -->
FORM;
$array[] = [$form, $html];
// Removed password autocomplete
unset($form['row'][1]['password']['autocomplete'], $form['row'][0]['username']['autocomplete']);
$html = <<<FORM
<!-- START logonform -->
<form method="POST" id="logonform" name="logonform" action="" class="form form-horizontal" style="margin-bottom: 0px;">
<fieldset> <!-- START fieldset-logon -->
<div class="control-group">
<div class="controls">
<h3>Please log in:</h3>
</div>
</div>
<div id="username_div" class="control-group" style="margin-bottom: 5px;"> <!-- START row-0 -->
<label class="control-label" for="username">Username</label>
<div id="username_div" class="controls">
<input type="text" placeholder="" name="username" id="username" class="input input-xlarge" value="" />
</div>
</div> <!-- END row-0 -->
<div id="password_div" class="control-group" style="margin-bottom: 5px;"> <!-- START row-1 -->
<label class="control-label" for="password">Password</label>
<div id="password_div" class="controls">
<input type="password" id="disable-pwd-mgr-1" autocomplete="off" style="display:none;" tabindex="-1" value="disable-pwd-mgr-1" /><input type="password" id="disable-pwd-mgr-2" autocomplete="off" style="display:none;" tabindex="-1" value="disable-pwd-mgr-2" /><input type="password" id="disable-pwd-mgr-3" autocomplete="off" style="display:none;" tabindex="-1" value="disable-pwd-mgr-3" /> <input type="password" autocomplete="new-password" placeholder="" name="password" id="password" class="input input-xlarge" value="" />
</div>
</div> <!-- END row-1 -->
</fieldset> <!-- END fieldset-logon -->
<div id="submit_div" class="controls">
<button id="submit" name="submit" type="submit" class="btn btn-default btn-large text-nowrap" value=""><i style="margin-right: 0px;" class="icon-lock"></i>&nbsp;&nbsp;Log in</button>
</div>
</form>
<!-- END logonform -->
FORM;
$array[] = [$form, $html];
// Append checkbox
$form['row'][2]['remember'] = [
'type' => 'checkbox',
'fieldset' => 'logon',
'placeholder' => 'Remember my login'];
$html = <<<FORM
<!-- START logonform -->
<form method="POST" id="logonform" name="logonform" action="" class="form form-horizontal" style="margin-bottom: 0px;">
<fieldset> <!-- START fieldset-logon -->
<div class="control-group">
<div class="controls">
<h3>Please log in:</h3>
</div>
</div>
<div id="username_div" class="control-group" style="margin-bottom: 5px;"> <!-- START row-0 -->
<label class="control-label" for="username">Username</label>
<div id="username_div" class="controls">
<input type="text" placeholder="" name="username" id="username" class="input input-xlarge" value="" />
</div>
</div> <!-- END row-0 -->
<div id="password_div" class="control-group" style="margin-bottom: 5px;"> <!-- START row-1 -->
<label class="control-label" for="password">Password</label>
<div id="password_div" class="controls">
<input type="password" id="disable-pwd-mgr-1" autocomplete="off" style="display:none;" tabindex="-1" value="disable-pwd-mgr-1" /><input type="password" id="disable-pwd-mgr-2" autocomplete="off" style="display:none;" tabindex="-1" value="disable-pwd-mgr-2" /><input type="password" id="disable-pwd-mgr-3" autocomplete="off" style="display:none;" tabindex="-1" value="disable-pwd-mgr-3" /> <input type="password" autocomplete="new-password" placeholder="" name="password" id="password" class="input input-xlarge" value="" />
</div>
</div> <!-- END row-1 -->
<div id="remember_div" class="control-group" style="margin-bottom: 5px;"> <!-- START row-2 -->
<div id="remember_div" class="controls">
<input type="checkbox" name="remember" id="remember" value="1" /> <label for="remember" class="help-inline" style="margin-top: 4px;"><span style="min-width: 150px;">Remember my login</span></label>
</div>
</div> <!-- END row-2 -->
</fieldset> <!-- END fieldset-logon -->
<div id="submit_div" class="controls">
<button id="submit" name="submit" type="submit" class="btn btn-default btn-large text-nowrap" value=""><i style="margin-right: 0px;" class="icon-lock"></i>&nbsp;&nbsp;Log in</button>
</div>
</form>
<!-- END logonform -->
FORM;
$array[] = [$form, $html];
return $array;
}
/**
* @dataProvider providerGetMarkdown
* @group html
*/
public function testGetMarkdown($text, $result, $extra = FALSE) {
$this->assertSame($result, get_markdown($text, TRUE, $extra));
}
public function providerGetMarkdown() {
$array = [];
// Simple
$array[] = [ 'Hello _Observium_!', '<span style="min-width: 150px;">Hello <em>Observium</em>!</span>' ];
$array[] = [ 'an autolink http://example.com',
'<span style="min-width: 150px;">an autolink <a href="http://example.com">http://example.com</a></span>' ];
$array[] = [ 'inside of brackets [http://example.com], inside of braces {http://example.com}, inside of parentheses (http://example.com)',
'<span style="min-width: 150px;">inside of brackets [<a href="http://example.com">http://example.com</a>], inside of braces {<a href="http://example.com">http://example.com</a>}, inside of parentheses (<a href="http://example.com">http://example.com</a>)</span>' ];
$array[] = [ 'trailing slash http://example.com/ and http://example.com/path/',
'<span style="min-width: 150px;">trailing slash <a href="http://example.com/">http://example.com/</a> and <a href="http://example.com/path/">http://example.com/path/</a></span>' ];
// Extra
$array[] = [ 'Please read [FAQ](' . OBSERVIUM_DOCS_URL . '/faq/#snmpv3-strong-authentication-or-encryption){target=_blank}.',
'<span style="min-width: 150px;">Please read <a href="' . OBSERVIUM_DOCS_URL . '/faq/#snmpv3-strong-authentication-or-encryption" target="_blank">FAQ</a>.</span>', TRUE ];
// Multiline
$text = <<<TEXT
Welcome to the demo:
1. Write Markdown text on the left
2. Hit the __Parse__ button or `⌘ + Enter`
3. See the result to on the right
TEXT;
$html = <<<HTML
<div style="min-width: 150px;">
<p>Welcome to the demo:</p>
<ol>
<li>Write Markdown text on the left</li>
<li>Hit the <strong>Parse</strong> button or <code>⌘ + Enter</code></li>
<li>See the result to on the right</li>
</ol>
</div>
HTML;
$array[] = [ $text, $html ];
return $array;
}
}
// EOF

View File

@ -0,0 +1,333 @@
<?php
$base_dir = realpath(__DIR__ . '/..');
$config['install_dir'] = $base_dir;
include(__DIR__ . '/../includes/defaults.inc.php');
//include(dirname(__FILE__) . '/../config.php');
include(__DIR__ . '/../includes/common.inc.php');
include(__DIR__ . '/../includes/definitions.inc.php');
include(__DIR__ . '/../includes/functions.inc.php');
class IncludesAlertsTest extends \PHPUnit\Framework\TestCase
{
/**
* @dataProvider providerTestCondition
* @group condition
*/
public function testTestCondition($result, $value_a, $condition, $value_b)
{
$this->assertSame($result, test_condition($value_a, $condition, $value_b));
}
public function providerTestCondition()
{
$array = array(); // Init
// >=
$array[] = array( TRUE, 0, 'ge', -1);
$array[] = array( TRUE, 0, '>=', -1);
$array[] = array(FALSE, 0, '>=', 1);
$array[] = array( TRUE, 0, '>=', 0);
$array[] = array( TRUE, 1, '>=', 1);
$array[] = array( TRUE, -1, '>=', -1);
$array[] = array( TRUE, 0.11, '>=', 0.11);
$array[] = array(FALSE, 1474559, '>=', '1440kB');
$array[] = array( TRUE, 1474560, '>=', '1440kB');
$array[] = array( TRUE, 1474561, '>=', '1440kB');
// note, for string compared char maps and strlen
$array[] = array( TRUE, 'sweet', '>=', 'swee');
$array[] = array( TRUE, 'sweet', '>=', 'sweet');
$array[] = array( TRUE, 'swoot', '>=', 'sweet');
$array[] = array(FALSE, 'sweet', '>=', 'sweett');
$array[] = array(FALSE, 0, 'ge', 'acPowerAndSwitchAreOnPowerSupplyIsOnIsOkAndOnline');
$array[] = array( TRUE, 'acPowerAndSwitchAreOnPowerSupplyIsOnIsOkAndOnline', 'ge', 0);
// version compare
//$array[] = array(FALSE, '15.1R4.55', 'version_>=', '15.1R5.5');
$array[] = array(FALSE, '15.1R4.55', '>=', '15.1R5.5');
//$array[] = array( TRUE, '15.1R5.55', 'version_>=', '15.1R5.5');
$array[] = array( TRUE, '15.1R5.55', '>=', '15.1R5.5');
//$array[] = array( TRUE, '15.1R5.5', 'version_>=', '15.1R5.5');
$array[] = array( TRUE, '15.1R5.5', '>=', '15.1R5.5');
//$array[] = array(FALSE, '15.1R5.5', 'version_>=', '15.1X5.5');
$array[] = array(FALSE, '15.1R5.5', '>=', '15.1X5.5');
//$array[] = array( TRUE, '15.1X5.5', 'version_>=', '15.1R5.5');
$array[] = array( TRUE, '15.1X5.5', '>=', '15.1R5.5');
//$array[] = array(FALSE, '1.2.3x', 'version_>=', '1.2.3z');
$array[] = array(FALSE, '1.2.3x', '>=', '1.2.3z');
// >
$array[] = array( TRUE, 0, 'gt', -1);
$array[] = array( TRUE, 0, 'greater', -1);
$array[] = array( TRUE, 0, '>', -1);
$array[] = array(FALSE, 0, '>', 1);
$array[] = array(FALSE, 0, '>', 0);
$array[] = array(FALSE, 1, '>', 1);
$array[] = array(FALSE, -1, '>', -1);
$array[] = array(FALSE, 0.11, '>', 0.11);
$array[] = array(FALSE, 1474559, '>', '1440kB');
$array[] = array(FALSE, 1474560, '>', '1440kB');
$array[] = array( TRUE, 1474561, '>', '1440kB');
// note, for string compared char maps and strlen
$array[] = array( TRUE, 'sweet', '>', 'swee');
$array[] = array(FALSE, 'sweet', '>', 'sweet');
$array[] = array( TRUE, 'swoot', '>', 'sweet');
$array[] = array(FALSE, 'sweet', '>', 'sweett');
$array[] = array(FALSE, 0, 'gt', 'acPowerAndSwitchAreOnPowerSupplyIsOnIsOkAndOnline');
$array[] = array( TRUE, 'acPowerAndSwitchAreOnPowerSupplyIsOnIsOkAndOnline', 'gt', 0);
//$array[] = array(FALSE, 1474559, '>', NULL);
// version compare
//$array[] = array(FALSE, '15.1R4.55', 'version_>', '15.1R5.5');
$array[] = array(FALSE, '15.1R4.55', '>', '15.1R5.5');
//$array[] = array( TRUE, '15.1R5.55', 'version_>', '15.1R5.5');
$array[] = array( TRUE, '15.1R5.55', '>', '15.1R5.5');
//$array[] = array(FALSE, '15.1R5.5', 'version_>', '15.1R5.5');
$array[] = array(FALSE, '15.1R5.5', '>', '15.1R5.5');
//$array[] = array(FALSE, '15.1R5.5', 'version_>', '15.1X5.5');
$array[] = array(FALSE, '15.1R5.5', '>', '15.1X5.5');
//$array[] = array( TRUE, '15.1X5.5', 'version_>', '15.1R5.5');
$array[] = array( TRUE, '15.1X5.5', '>', '15.1R5.5');
//$array[] = array(FALSE, '1.2.3x', 'version_>', '1.2.3z');
$array[] = array(FALSE, '1.2.3x', '>', '1.2.3z');
// <=
$array[] = array( TRUE, -1, 'le', -1);
$array[] = array(FALSE, 0, '<=', -1);
$array[] = array( TRUE, 0, '<=', 1);
$array[] = array( TRUE, 0, '<=', 0);
$array[] = array( TRUE, 1, '<=', 1);
$array[] = array( TRUE, -1, '<=', -1);
$array[] = array( TRUE, 0.11, '<=', 0.11);
$array[] = array( TRUE, 1474559, '<=', '1440kB');
$array[] = array( TRUE, 1474560, '<=', '1440kB');
$array[] = array(FALSE, 1474561, '<=', '1440kB');
// note, for string compared char maps and strlen
$array[] = array(FALSE, 'sweet', '<=', 'swee');
$array[] = array( TRUE, 'sweet', '<=', 'sweet');
$array[] = array(FALSE, 'swoot', '<=', 'sweet');
$array[] = array( TRUE, 'sweet', '<=', 'sweett');
$array[] = array( TRUE, 0, 'le', 'acPowerAndSwitchAreOnPowerSupplyIsOnIsOkAndOnline');
$array[] = array(FALSE, 'acPowerAndSwitchAreOnPowerSupplyIsOnIsOkAndOnline', 'le', 0);
// version compare
//$array[] = array( TRUE, '15.1R4.55', 'version_<=', '15.1R5.5');
$array[] = array( TRUE, '15.1R4.55', '<=', '15.1R5.5');
//$array[] = array(FALSE, '15.1R5.55', 'version_<=', '15.1R5.5');
$array[] = array(FALSE, '15.1R5.55', '<=', '15.1R5.5');
//$array[] = array( TRUE, '15.1R5.5', 'version_<=', '15.1R5.5');
$array[] = array( TRUE, '15.1R5.5', '<=', '15.1R5.5');
//$array[] = array( TRUE, '15.1R5.5', 'version_<=', '15.1X5.5');
$array[] = array( TRUE, '15.1R5.5', '<=', '15.1X5.5');
//$array[] = array(FALSE, '15.1X5.5', 'version_<=', '15.1R5.5');
$array[] = array(FALSE, '15.1X5.5', '<=', '15.1R5.5');
//$array[] = array( TRUE, '1.2.3x', 'version_<=', '1.2.3z');
$array[] = array( TRUE, '1.2.3x', '<=', '1.2.3z');
// <
$array[] = array( TRUE, -2, 'lt', -1);
$array[] = array( TRUE, -2, 'less', -1);
$array[] = array(FALSE, 0, '<', -1);
$array[] = array( TRUE, 0, '<', 1);
$array[] = array(FALSE, 0, '<', 0);
$array[] = array(FALSE, 1, '<', 1);
$array[] = array(FALSE, -1, '<', -1);
$array[] = array(FALSE, 0.11, '<', 0.11);
$array[] = array( TRUE, 1474559, '<', '1440kB');
$array[] = array(FALSE, 1474560, '<', '1440kB');
$array[] = array(FALSE, 1474561, '<', '1440kB');
// note, for string compared char maps and strlen
$array[] = array(FALSE, 'sweet', '<', 'swee');
$array[] = array(FALSE, 'sweet', '<', 'sweet');
$array[] = array(FALSE, 'swoot', '<', 'sweet');
$array[] = array( TRUE, 'sweet', '<', 'sweett');
$array[] = array( TRUE, 0, 'lt', 'acPowerAndSwitchAreOnPowerSupplyIsOnIsOkAndOnline');
$array[] = array(FALSE, 'acPowerAndSwitchAreOnPowerSupplyIsOnIsOkAndOnline', 'lt', 0);
// version compare
//$array[] = array( TRUE, '5.11R5.5', 'version_<', '15.1R5.5');
$array[] = array( TRUE, '5.11R5.5', '<', '15.1R5.5');
//$array[] = array(FALSE, '15.1R5.55', 'version_<', '15.1R5.5');
$array[] = array(FALSE, '15.1R5.55', '<', '15.1R5.5');
//$array[] = array(FALSE, '15.1R5.5', 'version_<', '15.1R5.5');
$array[] = array(FALSE, '15.1R5.5', '<', '15.1R5.5');
//$array[] = array( TRUE, '15.1R5.5', 'version_<', '15.1X5.5');
$array[] = array( TRUE, '15.1R5.5', '<', '15.1X5.5');
//$array[] = array(FALSE, '15.1X5.5', 'version_<', '15.1R5.5');
$array[] = array(FALSE, '15.1X5.5', '<', '15.1R5.5');
//$array[] = array( TRUE, '1.2.3x', 'version_<', '1.2.3z');
$array[] = array( TRUE, '1.2.3x', '<', '1.2.3z');
// !=
$array[] = array( TRUE, 0, 'notequals', -1);
$array[] = array( TRUE, 0, 'isnot', -1);
$array[] = array( TRUE, 0, 'ne', -1);
$array[] = array( TRUE, 0, 'ne', 'acPowerAndSwitchAreOnPowerSupplyIsOnIsOkAndOnline');
$array[] = array( TRUE, 'acPowerAndSwitchAreOnPowerSupplyIsOnIsOkAndOnline', 'ne', 0);
$array[] = array( TRUE, 0, '!=', -1);
$array[] = array( TRUE, 0, '!=', 1);
$array[] = array(FALSE, 0, '!=', 0);
$array[] = array(FALSE, 1, '!=', 1);
$array[] = array(FALSE, -1, '!=', -1);
$array[] = array(FALSE, 0.11, '!=', 0.11);
$array[] = array( TRUE, 1474559, '!=', '1440kB');
$array[] = array(FALSE, 1474560, '!=', '1440kB');
$array[] = array( TRUE, 1474561, '!=', '1440kB');
// note, for string compared char maps and strlen
$array[] = array( TRUE, 'sweet', '!=', 'swee');
$array[] = array(FALSE, 'sweet', '!=', 'sweet');
$array[] = array( TRUE, 'swoot', '!=', 'sweet');
$array[] = array( TRUE, 'sweet', '!=', 'sweett');
// version compare
//$array[] = array( TRUE, '15.1R4.55', 'version_!=', '15.1R5.5');
$array[] = array( TRUE, '15.1R4.55', '!=', '15.1R5.5');
//$array[] = array( TRUE, '15.1R5.55', 'version_!=', '15.1R5.5');
$array[] = array( TRUE, '15.1R5.55', '!=', '15.1R5.5');
//$array[] = array(FALSE, '15.1R5.5', 'version_!=', '15.1R5.5');
$array[] = array(FALSE, '15.1R5.5', '!=', '15.1R5.5');
//$array[] = array( TRUE, '1.2.3x', 'version_!=', '1.2.3z');
$array[] = array( TRUE, '1.2.3x', '!=', '1.2.3z');
// ==
$array[] = array( TRUE, -1, 'equals', -1);
$array[] = array( TRUE, -1, 'is', -1);
$array[] = array( TRUE, -1, 'eq', -1);
$array[] = array( TRUE, -1, '=', -1);
$array[] = array(FALSE, 0, '==', -1);
$array[] = array(FALSE, 0, '==', 1);
$array[] = array( TRUE, 0, '==', 0);
$array[] = array( TRUE, 1, '==', 1);
$array[] = array( TRUE, -1, '==', -1);
$array[] = array( TRUE, 0.11, '==', 0.11);
$array[] = array(FALSE, 1474559, '==', '1440kB');
$array[] = array( TRUE, 1474560, '==', '1440kB');
$array[] = array(FALSE, 1474561, '==', '1440kB');
// note, for string compared char maps and strlen
$array[] = array(FALSE, 'sweet', '==', 'swee');
$array[] = array( TRUE, 'sweet', '==', 'sweet');
$array[] = array(FALSE, 'swoot', '==', 'sweet');
$array[] = array(FALSE, 'sweet', '==', 'sweett');
$array[] = array(FALSE, 0, 'eq', 'acPowerAndSwitchAreOnPowerSupplyIsOnIsOkAndOnline');
$array[] = array(FALSE, 'acPowerAndSwitchAreOnPowerSupplyIsOnIsOkAndOnline', 'eq', 0);
// version compare
//$array[] = array(FALSE, '15.1R4.55', 'version_==', '15.1R5.5');
$array[] = array(FALSE, '15.1R4.55', '==', '15.1R5.5');
//$array[] = array(FALSE, '15.1R5.55', 'version_==', '15.1R5.5');
$array[] = array(FALSE, '15.1R5.55', '==', '15.1R5.5');
//$array[] = array( TRUE, '15.1R5.5', 'version_==', '15.1R5.5');
$array[] = array( TRUE, '15.1R5.5', '==', '15.1R5.5');
//$array[] = array(FALSE, '1.2.3x', 'version_==', '1.2.3z');
$array[] = array(FALSE, '1.2.3x', '==', '1.2.3z');
// match
$array[] = array( TRUE, 'sweet', 'matches', '.weet');
$array[] = array( TRUE, 'sweet', 'match', '.weet');
$array[] = array( TRUE, 'sweet', 'match', 'sweet');
$array[] = array( TRUE, 'sweet', 'match', 'sw..t');
$array[] = array( TRUE, 'sweet', 'match', 'swe*');
$array[] = array(FALSE, 'sweet', 'match', 'swee');
$array[] = array(FALSE, 'swoot', 'match', '.weet');
$array[] = array(FALSE, 'swoot', 'match', 'sweet');
$array[] = array( TRUE, 'swoot', 'match', 'sw..t');
$array[] = array(FALSE, 'swoot', 'match', 'swe*');
$array[] = array(FALSE, 'swoot', 'match', 'swoo');
// !match
$array[] = array( TRUE, 'sweet', 'notmatches', '.woot');
$array[] = array( TRUE, 'sweet', 'notmatch', '.woot');
$array[] = array(FALSE, 'sweet', '!match', '.weet');
$array[] = array(FALSE, 'sweet', '!match', 'sweet');
$array[] = array(FALSE, 'sweet', '!match', 'sw..t');
$array[] = array(FALSE, 'sweet', '!match', 'swe*');
$array[] = array( TRUE, 'sweet', '!match', 'swee');
$array[] = array( TRUE, 'swoot', '!match', '.weet');
$array[] = array( TRUE, 'swoot', '!match', 'sweet');
$array[] = array(FALSE, 'swoot', '!match', 'sw..t');
$array[] = array( TRUE, 'swoot', '!match', 'swe*');
$array[] = array( TRUE, 'swoot', '!match', 'swoo');
$test1 = 'Paradyne ATM ReachDSL Unit; Model: 4213-A1-530; CCA: 868-5315-8201; S/W Release: 02.03.05; Hardware Revision: 5315-82H; Serial number: 6938473 ;';
$test2 = 'Blue Coat SG600 Series, Version: SGOS 5.5.11.1, Release id: 110885 Proxy Edition';
$pattern1 = '(?<hardware>(?:Paradyne|Zhone) .+?)(?: Unit)?; Model: (?<hardware1>\w+(?:\-\w+)*);.+?; S/W Release: (?<version>[\d\.]+);.+; Serial number: (?<serial>\w+)';
$pattern2 = 'Blue Coat (?<hardware>[\w\ ]+?)(?: Series)?,(?: Proxy\w+)? Version:(?: SGOS)? (?<version>\d[\d\.]+)';
// escaped delimiter
$pattern3 = '(?<hardware>(?:Paradyne|Zhone) .+?)(?: Unit)?; Model: (?<hardware1>\w+(?:\-\w+)*);.+?; S\/W Release: (?<version>[\d\.]+);.+; Serial number: (?<serial>\w+)';
// regex
$array[] = array( TRUE, $test1, 'regexp', $pattern1);
$array[] = array( TRUE, $test1, 'regex', $pattern1);
$array[] = array(FALSE, $test1, 'regex', $pattern2);
$array[] = array( TRUE, $test1, 'regex', $pattern3);
$array[] = array(FALSE, $test2, 'regex', $pattern1);
$array[] = array( TRUE, $test2, 'regex', $pattern2);
$array[] = array(FALSE, $test2, 'regex', $pattern3);
// !regex
$array[] = array( TRUE, $test1, 'notregexp', $pattern2);
$array[] = array( TRUE, $test1, 'notregex', $pattern2);
$array[] = array( TRUE, $test1, '!regexp', $pattern2);
$array[] = array(FALSE, $test1, '!regex', $pattern1);
$array[] = array( TRUE, $test1, '!regex', $pattern2);
$array[] = array(FALSE, $test1, '!regex', $pattern3);
$array[] = array( TRUE, $test2, '!regex', $pattern1);
$array[] = array(FALSE, $test2, '!regex', $pattern2);
$array[] = array( TRUE, $test2, '!regex', $pattern3);
$test1 = 'sweet';
$test2 = 'notsweet';
$test3 = 'swoot';
$list1 = 'sweet,swoot';
$list2 = array('sweet', 'swoot');
// in
$array[] = array( TRUE, $test1, 'list', $list1);
$array[] = array( TRUE, $test1, 'in', $list1);
$array[] = array( TRUE, $test1, 'in', $list2);
$array[] = array(FALSE, $test2, 'in', $list1);
$array[] = array(FALSE, $test2, 'in', $list2);
$array[] = array( TRUE, $test3, 'in', $list1);
$array[] = array( TRUE, $test3, 'in', $list2);
// !in
$array[] = array( TRUE, $test2, '!list', $list1);
$array[] = array( TRUE, $test2, 'notin', $list1);
$array[] = array( TRUE, $test2, 'notlist', $list1);
$array[] = array(FALSE, $test1, '!in', $list1);
$array[] = array(FALSE, $test1, '!in', $list2);
$array[] = array( TRUE, $test2, '!in', $list1);
$array[] = array( TRUE, $test2, '!in', $list2);
$array[] = array(FALSE, $test3, '!in', $list1);
$array[] = array(FALSE, $test3, '!in', $list2);
// isnull (second param not used)
$array[] = array(TRUE, NULL, 'isnull', NULL);
$array[] = array(TRUE, NULL, 'null', NULL);
$array[] = array(FALSE, 1474559, 'isnull', NULL);
$array[] = array(FALSE, 1474559, 'null', NULL);
// notnull
$array[] = array(FALSE, NULL, 'notnull', NULL);
$array[] = array(FALSE, NULL, '!null', NULL);
$array[] = array(TRUE, 1474559, 'notnull', NULL);
$array[] = array(TRUE, 1474559, '!null', NULL);
return $array;
}
}
// EOF

2747
tests/IncludesCommonTest.php Normal file

File diff suppressed because it is too large Load Diff

91
tests/IncludesDbTest.php Normal file
View File

@ -0,0 +1,91 @@
<?php
// Here required DB connect and disable phpunit backupGlobals
// https://phpunit.de/manual/current/en/appendixes.annotations.html#appendixes.annotations.backupGlobals
define('OBS_DB_SKIP', FALSE);
//define('OBS_DEBUG', 2);
include(__DIR__ . '/../includes/sql-config.inc.php');
//include(dirname(__FILE__) . '/../includes/defaults.inc.php');
//include(dirname(__FILE__) . '/../config.php');
//include(dirname(__FILE__) . '/../includes/definitions.inc.php');
//include(dirname(__FILE__) . '/../includes/functions.inc.php');
include(__DIR__ . '/../html/includes/functions.inc.php');
/**
* @backupGlobals disabled
*/
class IncludesDbTest extends \PHPUnit\Framework\TestCase
{
/**
* @dataProvider providerGenerateQueryValues
* @group sql
*/
public function testGenerateQueryValues($value, $column, $condition, $result)
{
$this->assertSame($result, generate_query_values($value, $column, $condition));
}
/**
* @dataProvider providerGenerateQueryValues
* @group sql
*/
public function testGenerateQueryValuesNoAnd($value, $column, $condition, $result)
{
$result = preg_replace('/^ AND/', '', $result);
$this->assertSame($result, generate_query_values($value, $column, $condition, FALSE));
}
public function providerGenerateQueryValues()
{
return array(
// Basic values
array(0, 'test', FALSE, " AND `test` = '0'"),
array('1,sf,98u8', '`test`', FALSE, " AND `test` = '1,sf,98u8'"),
array(array('1,sf,98u8'), 'I.test', FALSE, " AND `I`.`test` = '1,sf,98u8'"),
array(array('1,sf','98u8', ''), '`I`.`test`', FALSE, " AND IFNULL(`I`.`test`, '') IN ('1,sf','98u8','')"),
array(OBS_VAR_UNSET, '`test`', FALSE, " AND IFNULL(`test`, '') = ''"),
array('"*%F@W)b\'_u<[`R1/#F"', 'test', FALSE, " AND `test` = '\\\"*%F@W)b\'_u<[`R1/#F\\\"'"),
array('*?%_', 'test', FALSE, " AND `test` = '*?%_'"),
// Negative
array(array('1,sf,98u8'), 'I.test', 'NOT', " AND `I`.`test` != '1,sf,98u8'"),
array(array('1,sf,98u8'), 'I.test', '!=', " AND `I`.`test` != '1,sf,98u8'"),
array(array('1,sf,98u8', ''), '`I`.`test`', '!=', " AND IFNULL(`I`.`test`, '') NOT IN ('1,sf,98u8','')"),
// LIKE conditions
array(0, 'test', '%LIKE', " AND (`test` LIKE '%0')"),
array('1,sf,98u8', '`test`', 'LIKE%', " AND (`test` LIKE '1,sf,98u8%')"),
array(array('1,sf,98u8'), 'I.test', '%LIKE%', " AND (`I`.`test` LIKE '%1,sf,98u8%')"),
array(array('1,sf,98u8', ''), '`I`.`test`', 'LIKE', " AND (`I`.`test` LIKE '1,sf,98u8' OR COALESCE(`I`.`test`, '') LIKE '')"),
array(OBS_VAR_UNSET, '`test`', 'LIKE', " AND (`test` LIKE '".OBS_VAR_UNSET."')"),
array('"*%F@W)b\'_u<[`R1/#F"', 'test', 'LIKE', " AND (`test` LIKE '\\\"%\%F@W)b\'\_u<[`R1/#F\\\"')"),
// LIKE with match *?
array('*?%_', 'test', 'LIKE', " AND (`test` LIKE '%_\%\_')"),
// Negative LIKE
array('1,sf,98u8', '`test`', 'NOT LIKE%', " AND (`test` NOT LIKE '1,sf,98u8%')"),
array(array('1,sf,98u8', ''), '`I`.`test`', 'NOT LIKE', " AND (`I`.`test` NOT LIKE '1,sf,98u8' AND COALESCE(`I`.`test`, '') NOT LIKE '')"),
// Duplicates
array(array('1','sf','1','1','98u8',''), '`I`.`test`', FALSE, " AND IFNULL(`I`.`test`, '') IN ('1','sf','98u8','')"),
array(array('1','sf','98u8','1','sf',''), 'I.test', '%LIKE%', " AND (`I`.`test` LIKE '%1%' OR `I`.`test` LIKE '%sf%' OR `I`.`test` LIKE '%98u8%' OR COALESCE(`I`.`test`, '') LIKE '')"),
// Wrong conditions
array('"*%F@W)b\'_u<[`R1/#F"', 'test', 'wtf', " AND `test` = '\\\"*%F@W)b\'_u<[`R1/#F\\\"'"),
array('ssdf', '`test`', TRUE, " AND (`test` LIKE 'ssdf')"),
// Empty values
array(NULL, '`test`', FALSE, " AND IFNULL(`test`, '') = ''"),
array('', '`test`', FALSE, " AND IFNULL(`test`, '') = ''"),
array(array(), '`test`', FALSE, " AND 0"),
array(NULL, '`test`', 'LIKE', " AND (COALESCE(`test`, '') LIKE '')"),
array('', '`test`', 'LIKE', " AND (COALESCE(`test`, '') LIKE '')"),
array(array(), '`test`', 'LIKE', " AND 0"),
// Empty values negative condition
array(NULL, '`test`', '!=', " AND IFNULL(`test`, '') != ''"),
array('', '`test`', '!=', " AND IFNULL(`test`, '') != ''"),
array(array(), '`test`', '!=', " AND 1"),
array(NULL, '`test`', 'NOT LIKE', " AND (COALESCE(`test`, '') NOT LIKE '')"),
array('', '`test`', 'NOT LIKE', " AND (COALESCE(`test`, '') NOT LIKE '')"),
array(array(), '`test`', 'NOT LIKE', " AND 1"),
);
}
}
// EOF

View File

@ -0,0 +1,342 @@
<?php
//define('OBS_DEBUG', 1);
$base_dir = realpath(__DIR__ . '/..');
$config['install_dir'] = $base_dir;
include(__DIR__ . '/../includes/defaults.inc.php');
//include(dirname(__FILE__) . '/../config.php'); // Do not include user editable config here
include(__DIR__ . '/../includes/common.inc.php');
include(__DIR__ . '/../includes/definitions.inc.php');
//include(dirname(__FILE__) . '/data/test_definitions.inc.php'); // Fake definitions for testing
include(__DIR__ . '/../includes/functions.inc.php');
class IncludesDefinitionsTest extends \PHPUnit\Framework\TestCase
{
/**
* @dataProvider providerOsRegex
* @group regex
*/
public function testOsRegex($type, $name, $param, $pattern)
{
$string = 'akjs//?dnasjdn28ye2384y2(&*&(*& '; // Just fake test string
preg_match($pattern, $string);
$preg_error = array_flip(get_defined_constants(true)['pcre'])[preg_last_error()];
// Additional error display
// if ($preg_error != 'PREG_NO_ERROR')
// {
// echo("\n$type -> $name -> $param -> $pattern\n");
// }
$this->assertSame('PREG_NO_ERROR', $preg_error);
}
public function providerOsRegex()
{
global $config;
$array = [];
foreach ([ 'os_group', 'os', 'mibs'] as $type)
{
foreach ($config[$type] as $name => $entry)
{
foreach ($entry as $param => $def)
{
if (in_array($param, [ 'sysDescr', 'sysDescr_regex', 'port_label', 'syslog_msg', 'syslog_program', 'comments' ]))
{
// simple definitions with regex patterns
foreach ($def as $pattern)
{
$array[] = [$type, $name, $param, $pattern];
}
}
elseif ($param === 'discovery')
{
// discovery definition, additional array level
foreach ($def as $disovery)
{
foreach ($disovery as $discovery_param => $patterns)
{
if (in_array($discovery_param, [ 'sysObjectID', 'os', 'os_group', 'type', 'vendor' ])) { continue; } // All except sysObjectID is regexp
foreach ((array)$patterns as $pattern) {
$array[] = [ $type, $name, $param . '->' . $discovery_param, $pattern ];
}
}
}
}
}
}
}
return $array;
}
/**
* @dataProvider providerDefinitionPatterns
* @group constants
*/
public function testDefinitionPatterns($pattern, $string, $result, $match = NULL) {
$test = preg_match($pattern, $string, $matches);
//var_dump($matches);
$this->assertSame($result, (bool)$test);
if ($test && !is_null($match)) {
// Validate $match
$this->assertSame($match, $matches[1]);
}
}
public function providerDefinitionPatterns() {
$array = array();
$pattern = OBS_PATTERN_IPV4_FULL;
// IPv4 valid
$array[] = array($pattern, '1.2.3.4', TRUE, '1.2.3.4');
$array[] = array($pattern, '255.255.255.255', TRUE, '255.255.255.255');
// IPv4 invalid
$array[] = array($pattern, '1.2.3', FALSE);
$array[] = array($pattern, '1.2.3.', FALSE);
$array[] = array($pattern, '.1.2.3', FALSE);
$array[] = array($pattern, '1.2.3.4.5.6.7.8', FALSE);
$array[] = array($pattern, '999.999.999.999', FALSE);
$array[] = array($pattern, '299.299.299.299', FALSE);
$array[] = array($pattern, '001.002.003.004', FALSE);
// IPv4 in strings
$array[] = array($pattern, '"1.2.3.4"', TRUE, '1.2.3.4');
$array[] = array($pattern, '(1.2.3.4)', TRUE, '1.2.3.4');
$array[] = array($pattern, '(1.2.3.4, tprrrr)', TRUE, '1.2.3.4');
$array[] = array($pattern, 'PING is1.nic.local (192.168.10.110): 56 data bytes', TRUE, '192.168.10.110');
$array[] = array($pattern, '64 bytes from 192.168.10.110: icmp_seq=0 ttl=122 time=10.643 ms', TRUE, '192.168.10.110');
$array[] = array($pattern, 'Invalid user test from 213.149.105.28', TRUE, '213.149.105.28');
$array[] = array($pattern, 'Invalid user test from 213.149.105.28 hs', TRUE, '213.149.105.28');
$array[] = array($pattern, 'Invalid user test from 213.149.105.28. Next.', TRUE, '213.149.105.28');
$array[] = array($pattern, 'Invalid user test from 213.149.105.28sss', FALSE);
$pattern = OBS_PATTERN_IPV4_NET_FULL;
// IPv4 network valid
$array[] = array($pattern, '1.2.3.4/0', TRUE, '1.2.3.4/0');
$array[] = array($pattern, '1.2.3.4/29', TRUE, '1.2.3.4/29');
$array[] = array($pattern, '1.2.3.4/32', TRUE, '1.2.3.4/32');
// IPv4 network with netmask valid
$array[] = array($pattern, '1.2.3.4/0.0.0.0', TRUE, '1.2.3.4/0.0.0.0');
$array[] = array($pattern, '1.2.3.4/255.255.255.248', TRUE, '1.2.3.4/255.255.255.248');
$array[] = array($pattern, '1.2.3.4/255.255.255.255', TRUE, '1.2.3.4/255.255.255.255');
// IPv4 network with Cisco inverse netmask valid
$array[] = array($pattern, '1.2.3.4/0.0.63.255', TRUE, '1.2.3.4/0.0.63.255');
$array[] = array($pattern, '1.2.3.4/0.0.0.1', TRUE, '1.2.3.4/0.0.0.1');
$array[] = array($pattern, '1.2.3.4/127.255.255.255', TRUE, '1.2.3.4/127.255.255.255');
// IPv4 network invalid
$array[] = array($pattern, '1.2.3.4/-1', FALSE);
$array[] = array($pattern, '1.2.3.4/33', FALSE);
$array[] = array($pattern, '1.2.3.4/123', FALSE);
// IPv4 network with invalid netmask
$array[] = array($pattern, '1.2.3.4/1.2.3.4', FALSE);
$array[] = array($pattern, '1.2.3.4/128.128.128.300', FALSE);
// IPv4 address (without prefix) also invalid
$array[] = array($pattern, '1.2.3.4', FALSE);
$pattern = OBS_PATTERN_IPV6_FULL;
// IPv6 valid
$array[] = array($pattern, '1762:0:0:0:0:B03:1:AF18', TRUE, '1762:0:0:0:0:B03:1:AF18');
$array[] = array($pattern, 'FE80:FFFF:0:FFFF:129:144:52:38', TRUE, 'FE80:FFFF:0:FFFF:129:144:52:38');
$array[] = array($pattern, 'FF01:0:0:0:CA:0:0:2', TRUE, 'FF01:0:0:0:CA:0:0:2');
$array[] = array($pattern, '0:0:0:0:0:0:0:1', TRUE, '0:0:0:0:0:0:0:1');
$array[] = array($pattern, '0:0:0:0:0:0:0:0', TRUE, '0:0:0:0:0:0:0:0');
$array[] = array($pattern, '1762::B03:1:AF18', TRUE, '1762::B03:1:AF18');
$array[] = array($pattern, 'FF01:7:CA:0::', TRUE, 'FF01:7:CA:0::');
$array[] = array($pattern, '::FF01:7:CA:0', TRUE, '::FF01:7:CA:0');
$array[] = array($pattern, '::1', TRUE, '::1');
$array[] = array($pattern, '1::', TRUE, '1::');
$array[] = array($pattern, '::', TRUE, '::');
$array[] = array($pattern, '::1:2:3:4:5:6:7', TRUE, '::1:2:3:4:5:6:7');
$array[] = array($pattern, '1:2:3:4:5:6:7::', TRUE, '1:2:3:4:5:6:7::');
$array[] = array($pattern, '0:0:0:0:0:0:127.32.67.15', TRUE, '0:0:0:0:0:0:127.32.67.15');
$array[] = array($pattern, '0:0:0:0:0:FFFF:127.32.67.15', TRUE, '0:0:0:0:0:FFFF:127.32.67.15');
$array[] = array($pattern, '::127.32.67.15', TRUE, '::127.32.67.15');
$array[] = array($pattern, '::FFFF:127.32.67.15', TRUE, '::FFFF:127.32.67.15');
$array[] = array($pattern, 'FFFF::127.32.67.15', TRUE, 'FFFF::127.32.67.15');
$array[] = array($pattern, '::1:2:3:4:5:127.32.67.15', TRUE, '::1:2:3:4:5:127.32.67.15');
// IPv6 invalid
$array[] = array($pattern, '1762:0:0:0:0:B03G:1:AF18', FALSE);
$array[] = array($pattern, ':127.32.67.15', FALSE);
$array[] = array($pattern, ':1234:127.32.67.15', FALSE);
$array[] = array($pattern, ':1234:1234:1234', FALSE);
$array[] = array($pattern, '1234:1234:1234:', FALSE);
$array[] = array($pattern, '1234::234::234::2342', FALSE);
$array[] = array($pattern, '1234:1234:1234:1234:1234:1234:1234:1234:1234:1234:1234', FALSE);
$array[] = array($pattern, '1234:1234:1234:1234::1234:1234:1234:1234:1234:1234:1234', FALSE);
$array[] = array($pattern, '1234:1234:1234:1234::1234:1234:1234:1234:1234::1234:1234', FALSE);
// IPv6 in strings
$array[] = array($pattern, '"FF01:7:CA:0::"', TRUE, 'FF01:7:CA:0::');
$array[] = array($pattern, '(FF01:7:CA:0::)', TRUE, 'FF01:7:CA:0::');
$array[] = array($pattern, '(FF01:7:CA:0::, hoho)', TRUE, 'FF01:7:CA:0::');
$array[] = array($pattern, 'PING6(56=40+8+8 bytes) 2a02:408:8093:fff2::4 --> 2a02:408:7722:41::150', TRUE, '2a02:408:8093:fff2::4');
$array[] = array($pattern, '16 bytes from 2a02:408:7722:41::150, icmp_seq=0 hlim=62 time=1.717 ms', TRUE, '2a02:408:7722:41::150');
$array[] = array($pattern, 'RP/0/RSP0/CPU0:May 31 16:23:46.207 : bgp[1046]: %ROUTING-BGP-5-ADJCHANGE : neighbor 2a02:2090:e400:4400::9:2 Up (VRF: default) (AS: 43489)', TRUE, '2a02:2090:e400:4400::9:2');
$array[] = array($pattern, 'RP/0/RSP0/CPU0:May 31 16:23:46.207 : bgp[1046]: %ROUTING-BGP-5-ADJCHANGE : neighbor 2a02:2090:e400:4400::9:2', TRUE, '2a02:2090:e400:4400::9:2');
$array[] = array($pattern, 'RP/0/RSP0/CPU0:May 31 16:23:46.207 : bgp[1046]: %ROUTING-BGP-5-ADJCHANGE : neighbor 2a02:2090:e400:4400::9:2Up', FALSE);
$pattern = OBS_PATTERN_IPV6_NET_FULL;
// IPv6 network valid
$array[] = array($pattern, '1762:0:0:0:0:B03:1:AF18/0', TRUE, '1762:0:0:0:0:B03:1:AF18/0');
$array[] = array($pattern, '1762:0:0:0:0:B03:1:AF18/29', TRUE, '1762:0:0:0:0:B03:1:AF18/29');
$array[] = array($pattern, '1762:0:0:0:0:B03:1:AF18/99', TRUE, '1762:0:0:0:0:B03:1:AF18/99');
$array[] = array($pattern, '1762:0:0:0:0:B03:1:AF18/119', TRUE, '1762:0:0:0:0:B03:1:AF18/119');
$array[] = array($pattern, '1762:0:0:0:0:B03:1:AF18/128', TRUE, '1762:0:0:0:0:B03:1:AF18/128');
// IPv6 network invalid
$array[] = array($pattern, '1762:0:0:0:0:B03:1:AF18/-1', FALSE);
$array[] = array($pattern, '1762:0:0:0:0:B03:1:AF18/129', FALSE);
// IPv6 address (without prefix) also invalid
$array[] = array($pattern, '1762:0:0:0:0:B03:1:AF18', FALSE);
$pattern = OBS_PATTERN_IP_FULL;
// IPv4 OR IPv6 valid (combination of patterns)
$array[] = array($pattern, '1.2.3.4', TRUE, '1.2.3.4');
$array[] = array($pattern, '1762:0:0:0:0:B03:1:AF18', TRUE, '1762:0:0:0:0:B03:1:AF18');
$pattern = OBS_PATTERN_MAC_FULL;
// MAC valid
$array[] = array($pattern, '0026.22eb.3bef', TRUE, '0026.22eb.3bef'); // Cisco
$array[] = array($pattern, '00-02-2D-11-55-4D', TRUE, '00-02-2D-11-55-4D'); // Windows
$array[] = array($pattern, '00 0D 93 13 51 1A', TRUE, '00 0D 93 13 51 1A'); // Old Unix
$array[] = array($pattern, '0x000E7F0D81D6', TRUE, '0x000E7F0D81D6'); // HP-UX
$array[] = array($pattern, '0004E25AA118', TRUE, '0004E25AA118'); // DOS, RAW
$array[] = array($pattern, '00:08:C7:1B:8C:02', TRUE, '00:08:C7:1B:8C:02'); // Unix/Linux
$array[] = array($pattern, '8:0:86:b6:82:9f', TRUE, '8:0:86:b6:82:9f'); // SNMP, Solaris
// MAC invalid
$array[] = array($pattern, 'F1:0:0:0:CA:0:0:2', FALSE); // IPv6
$array[] = array($pattern, '0026.22eb.3be', FALSE);
$array[] = array($pattern, '00-2-2D-11-55-4D', FALSE);
$array[] = array($pattern, '00 D 93 13 51 1A', FALSE);
$array[] = array($pattern, '0x00E7F0D81D6', FALSE);
$array[] = array($pattern, '004E25AA118', FALSE);
$array[] = array($pattern, '00:0G:C7:1B:8C:02', FALSE);
$array[] = array($pattern, '8::86:b6:82:9f', FALSE);
$array[] = array($pattern, '00 0D-93 13 51 1A', FALSE);
$array[] = array($pattern, '00 0D 93:13 51 1A', FALSE);
$array[] = array($pattern, '00 0D.93 13.51 1A', FALSE);
$array[] = array($pattern, '0x901b', FALSE);
$array[] = array($pattern, '08-00-27-00-5049', FALSE);
$array[] = array($pattern, '08:00:27:00:5049', FALSE);
$array[] = array($pattern, '08-00-27-00-50--49', FALSE);
$array[] = array($pattern, '08:00:27:00:50::49', FALSE);
$array[] = array($pattern, '08-00-27-00-50-49-', FALSE);
$array[] = array($pattern, '08:00:27:00:50:49:', FALSE);
$array[] = array($pattern, '-08-00-27-00-50-49', FALSE);
$array[] = array($pattern, ':08:00:27:00:50:49', FALSE);
$array[] = array($pattern, ':080027005049', FALSE);
// MAC in strings
$array[] = array($pattern, '"0026.22eb.3bef"', TRUE, '0026.22eb.3bef');
$array[] = array($pattern, '(0026.22eb.3bef)', TRUE, '0026.22eb.3bef');
$array[] = array($pattern, '(0026.22eb.3bef, qu-qu)', TRUE, '0026.22eb.3bef');
$array[] = array($pattern, 'wevent.ubnt_custom_event(): EVENT_STA_IP ath3: 9c:4f:da:73:5c:cc / 10.10.35.16', TRUE, '9c:4f:da:73:5c:cc');
$array[] = array($pattern, 'ath0: STA 44:d9:e7:f7:18:f2 DRIVER: Sead AUTH addr=9c:4f:da:73:5c:cc status_code=0', TRUE, '44:d9:e7:f7:18:f2');
$array[] = array($pattern, 'ath0: STA 44:d9:e7:f7:18:f2. DRIVER: Sead AUTH addr=9c:4f:da:73:5c:cc status_code=0', TRUE, '44:d9:e7:f7:18:f2');
$array[] = array($pattern, 'wevent.ubnt_custom_event(): EVENT_STA_IP ath3: 9c:4f:da:73:5c:cccc', FALSE);
$array[] = array($pattern, 'Host 0016.3e2e.2b98 in vlan 400 is flapping between port Gi1/0/25 and port Te1/0/1', TRUE, '0016.3e2e.2b98');
$pattern = OBS_PATTERN_FQDN_FULL;
// Domain name valid
$array[] = array($pattern, 'observium.org', TRUE, 'observium.org');
$array[] = array($pattern, 'my.host-name.test', TRUE, 'my.host-name.test');
$array[] = array($pattern, 'qq.ff.ee.my.host-name.test', TRUE, 'qq.ff.ee.my.host-name.test');
$array[] = array($pattern, 'localhost', TRUE, 'localhost');
// 1234567890123456789012345678901234567890123456789012345678901234
$array[] = array($pattern, 'my-yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy-63char.name', TRUE, 'my-yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy-63char.name');
$array[] = array($pattern, 'external.asd1230-123.asd_internal.asd.gm-_ail.com', TRUE, 'external.asd1230-123.asd_internal.asd.gm-_ail.com');
// Domain name IDN
$array[] = array($pattern, 'xn--b1agh1afp.xn--p1ai', TRUE, 'xn--b1agh1afp.xn--p1ai'); // привет.рф
$array[] = array($pattern, 'привет.рф', TRUE, 'привет.рф'); // привет.рф
// Domain name invalid
$array[] = array($pattern, '::127.32.67.15', FALSE);
$array[] = array($pattern, '1.2.3', FALSE);
$array[] = array($pattern, '1.2.3.4', FALSE);
$array[] = array($pattern, '.1.2.3', FALSE);
$array[] = array($pattern, '1.2.3.4.5.6.7.8', FALSE);
$array[] = array($pattern, '999.999.999.999', FALSE);
$array[] = array($pattern, '299.299.299.299', FALSE);
$array[] = array($pattern, '001.002.003.004', FALSE);
$array[] = array($pattern, 'test', FALSE);
$array[] = array($pattern, 'example..com', FALSE);
$array[] = array($pattern, 'http://example.com', FALSE);
$array[] = array($pattern, 'subdomain.-example.com', FALSE);
$array[] = array($pattern, 'example.com/parameter', FALSE);
$array[] = array($pattern, 'example.com?anything', FALSE);
$array[] = array($pattern, 'GigabitEthernet0/1.ServiceInstance.206', FALSE);
// 1234567890123456789012345678901234567890123456789012345678901234
$array[] = array($pattern, 'my-yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy-64char.name', FALSE);
// Domain name in strings
$array[] = array($pattern, '"my.host-name.test"', TRUE, 'my.host-name.test');
$array[] = array($pattern, '(my.host-name.test)', TRUE, 'my.host-name.test');
$array[] = array($pattern, '(my.host-name.test, help)', TRUE, 'my.host-name.test');
$array[] = array($pattern, 'Invalid user test from my.host-name.test', TRUE, 'my.host-name.test');
$array[] = array($pattern, 'Invalid user test from my.host-name.test hs', TRUE, 'my.host-name.test');
$array[] = array($pattern, 'Invalid user test from my.host-name.test.', TRUE, 'my.host-name.test');
$pattern = OBS_PATTERN_EMAIL_FULL;
// Email valid
$array[] = array($pattern, 'president@whitehouse.gov', TRUE, 'president@whitehouse.gov');
$array[] = array($pattern, 'pharaoh@egyptian.museum', TRUE, 'pharaoh@egyptian.museum');
$array[] = array($pattern, 'john.doe+test@ee.my.host-name.test', TRUE, 'john.doe+test@ee.my.host-name.test');
$array[] = array($pattern, 'Mike.O\'Dell@ireland.com', TRUE, 'Mike.O\'Dell@ireland.com');
$array[] = array($pattern, '"Mike\\\\ O\'Dell"@ireland.com', TRUE, '"Mike\\\\ O\'Dell"@ireland.com');
// 1234567890123456789012345678901234567890123456789012345678901234
$array[] = array($pattern, 'user-----------------------------------------------------63char@my-yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy-63char.name', TRUE,
'user-----------------------------------------------------63char@my-yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy-63char.name');
//$array[] = array($pattern, 'external.asd1230-123.asd_internal.asd.gm-_ail.com', TRUE, 'external.asd1230-123.asd_internal.asd.gm-_ail.com');
// Email IDN
$array[] = array($pattern, 'mike@xn--b1agh1afp.xn--p1ai', TRUE, 'mike@xn--b1agh1afp.xn--p1ai'); // mike@привет.рф
$array[] = array($pattern, 'майк@привет.рф', TRUE, 'майк@привет.рф'); // майк@привет.рф
// Email invalid
$array[] = array($pattern, '1024x768@60Hz', FALSE);
$array[] = array($pattern, 'not.a.valid.email', FALSE);
$array[] = array($pattern, 'john@example...com', FALSE);
$array[] = array($pattern, 'joe@ha!ha!.com', FALSE);
// 1234567890123456789012345678901234567890123456789012345678901234
$array[] = array($pattern, 'joe@a_domain_name_with_more_than_sixty-four_characters_is_invalid_6465.com', FALSE);
$array[] = array($pattern, 'a_local_part_with_more_than_sixty-four_characters_is_invalid_6465@mail.com', FALSE);
//$array[] = array($pattern, 'the_total_length_of_an_email_address_is_limited@two-hundred-fifty-four-characters.because-the-SMTP-protocol-for-sending-email.does-not-support-more-than-that.really-hard-to-come-up-with-a-bogus-address-as-long-as-this.still-not-long-enough.too-long-now.com', FALSE);
// Email in strings
$array[] = array($pattern, '"test@domain.name"', TRUE, 'test@domain.name');
$array[] = array($pattern, '(test@domain.name)', TRUE, 'test@domain.name');
$array[] = array($pattern, '(test@domain.name, help)', TRUE, 'test@domain.name');
$array[] = array($pattern, 'The email address president@whitehouse.gov is valid.', TRUE, 'president@whitehouse.gov');
$array[] = array($pattern, 'fabio@disapproved.solutions has a long TLD', TRUE, 'fabio@disapproved.solutions');
$pattern = OBS_PATTERN_EMAIL_LONG_FULL;
// Email valid
$array[] = array($pattern, '<test@domain.name>', TRUE, '<test@domain.name>');
$array[] = array($pattern, 'Pharaoh <pharaoh@egyptian.museum>', TRUE, 'Pharaoh <pharaoh@egyptian.museum>');
$array[] = array($pattern, 'in Egypt "Pharaoh" <pharaoh@egyptian.museum>', TRUE, '"Pharaoh" <pharaoh@egyptian.museum>');
$array[] = array($pattern, 'Pharaoh of Egypt <pharaoh@egyptian.museum>', TRUE, 'Pharaoh of Egypt <pharaoh@egyptian.museum>');
$array[] = array($pattern, '"Mike O\'Dell" <Mike.O\'Dell@ireland.com>', TRUE, '"Mike O\'Dell" <Mike.O\'Dell@ireland.com>');
// Email invalid
$array[] = array($pattern, '<domain.name>', FALSE);
$array[] = array($pattern, 'Pharaoh <pharaoh@>', FALSE);
$array[] = array($pattern, 'Test Title test@example.com', FALSE);
/*
$pattern = OBS_PATTERN_URL_FULL;
// URL IDN
$array[] = array($pattern, 'https://www.get.no/v3/bredb%C3%A5nd/tr%C3%A5dl%C3%B8st-modem', TRUE,
'https://www.get.no/v3/bredb%C3%A5nd/tr%C3%A5dl%C3%B8st-modem');
// URL in string
$array[] = array($pattern, '<a href="https://www.get.no/v3/bredb%C3%A5nd/tr%C3%A5dl%C3%B8st-modem" rel="nofollow">https://www.get.no/v3/bredbånd/trådløst-modem</a>', TRUE,
'https://www.get.no/v3/bredb%C3%A5nd/tr%C3%A5dl%C3%B8st-modem');
*/
$pattern = OBS_PATTERN_NOPRINT;
// Not printable chars
$array[] = array($pattern, "ABC \n", TRUE);
$array[] = array($pattern, "ABC \r", TRUE);
$array[] = array($pattern, "ABC \t", TRUE);
// All printable
$array[] = array($pattern, "ABC ËЙЦ 10 œ∑√∫Ω≈∆µ \"',.:`~!@#$%^&*()_+-=<>?/[]{}|\\", FALSE);
return $array;
}
}
// EOF

View File

@ -0,0 +1,257 @@
<?php
//define('OBS_DEBUG', 2);
include(__DIR__ . '/../includes/sql-config.inc.php');
//include(dirname(__FILE__) . '/../includes/defaults.inc.php');
//include(dirname(__FILE__) . '/../config.php');
//include(dirname(__FILE__) . '/../includes/definitions.inc.php');
//include(dirname(__FILE__) . '/../includes/functions.inc.php');
class IncludesEncryptTest extends \PHPUnit\Framework\TestCase
{
/**
* @dataProvider providerSafeBase64
* @group base64
*/
public function testSafeBase64Encode($string, $result)
{
$this->assertSame($result, safe_base64_encode($string));
}
/**
* @depends testSafeBase64Encode
* @dataProvider providerSafeBase64
* @group base64
*/
public function testSafeBase64Decode($result, $string)
{
$this->assertSame($result, safe_base64_decode($string));
}
/**
* @depends testSafeBase64Encode
* @dataProvider providerSafeBase64Random
* @group base64
*/
public function testSafeBase64Random($string)
{
$encode = safe_base64_encode($string);
$decode = safe_base64_decode($encode);
$this->assertSame($decode, $string);
}
public function providerSafeBase64()
{
$result = array(
array('Zlwv(,/E%>ieDr25Mr,-?ZOiL', 'Wmx3digsL0UlPmllRHIyNU1yLC0_Wk9pTA'),
array('w&8=K@.3}ULxnw"8+j`I\'yRQyL%RDijctN."', 'dyY4PUtALjN9VUx4bnciOCtqYEkneVJReUwlUkRpamN0Ti4i'),
array('T_\\u[WGG6c{o;i*J1/}\'5"\'nJJ.RY', 'VF9cdVtXR0c2Y3tvO2kqSjEvfSc1IiduSkouUlk'),
array('(?fY".Q/g7>=cjtK@p[m$v,', 'KD9mWSIuUS9nNz49Y2p0S0BwW20kdiw'),
array('kaoaDKPg;ek"rVi`4{mA,=KQZ%yOz<J;2~E', 'a2FvYURLUGc7ZWsiclZpYDR7bUEsPUtRWiV5T3o8SjsyfkU'),
array('Bow[#R+\'A*\':gIpRsL{3q-*2s', 'Qm93WyNSKydBKic6Z0lwUnNMezNxLSoycw'),
array('NG6JqTVjnZ>j}NP&#u%|e=i`n2@*QQ^T#o":xo/', 'Tkc2SnFUVmpuWj5qfU5QJiN1JXxlPWlgbjJAKlFRXlQjbyI6eG8v'),
array('e\',n,5S/UJoVZOTCHZx6Tn9Hsk7Cn2p', 'ZScsbiw1Uy9VSm9WWk9UQ0haeDZUbjlIc2s3Q24ycA'),
array('7+Wz}\'GgFUl=;=A8M]~b1GfS3P`mJCV#', 'NytXen0nR2dGVWw9Oz1BOE1dfmIxR2ZTM1BgbUpDViM'),
array('}.X8sPK0D)./=mQmVw,!A|VG', 'fS5YOHNQSzBEKS4vPW1RbVZ3LCFBfFZH'),
array('cDlpvOGgnIlojBkDmU?:vHLVo9{oYaj7u0^jx', 'Y0RscHZPR2duSWxvakJrRG1VPzp2SExWbzl7b1lhajd1MF5qeA'),
array('*loZQI@L[P?nq4f-px?J<~TDxK%BmLE,xdLs(C!]', 'KmxvWlFJQExbUD9ucTRmLXB4P0o8flREeEslQm1MRSx4ZExzKEMhXQ'),
array('{Nx6#5tgz">e"gLh2\\wkqYOH/ZvX&U*97NBL', 'e054NiM1dGd6Ij5lImdMaDJcd2txWU9IL1p2WCZVKjk3TkJM'),
array('ZGYP`R\\!{4`pZ^s1~4gSrbr^>mk', 'WkdZUGBSXCF7NGBwWl5zMX40Z1NyYnJePm1r'),
array('"J4l*A8%6D<#Q;0F~m3~m[|D938', 'Iko0bCpBOCU2RDwjUTswRn5tM35tW3xEOTM4'),
array('JzY:LY$(^0<Rv*TjAwAx[q/+mRGhA+I;,[2(y', 'SnpZOkxZJCheMDxSdipUakF3QXhbcS8rbVJHaEErSTssWzIoeQ'),
array('GQ&>l5tMX!CA<?5Wo-dMuw', 'R1EmPmw1dE1YIUNBPD81V28tZE11dw'),
array('!V=K\\?NkP^4ruh_*?<.UA&L6\\', 'IVY9S1w_TmtQXjRydWhfKj88LlVBJkw2XA'),
array('8,G(?\'A>_7p`>qbr!;9``1ssc$WZpc\'>KxD*?Py3', 'OCxHKD8nQT5fN3BgPnFiciE7OWBgMXNzYyRXWnBjJz5LeEQqP1B5Mw'),
array('6K\')zm&][xm0m/}G}<I)u)', 'NksnKXptJl1beG0wbS99R308SSl1KQ'),
);
return $result;
}
public function providerSafeBase64Random()
{
$charlist = ' 0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ`~!@#$%^&*()_+-=[]{}\|/?,.<>;:"'."'";
$result = array();
for ($i=0; $i<20; $i++)
{
$string = generate_random_string(mt_rand(20, 40), $charlist);
$result[] = array($string);
}
return $result;
}
/**
* @dataProvider providerEncrypt
* @group encrypt
*/
public function testEncrypt($string, $key, $result)
{
// Fot tests use static nonce
if (OBS_ENCRYPT_MODULE === 'sodium')
{
$nonce = 'test';
} else {
$nonce = NULL;
}
$this->assertSame($result, encrypt($string, $key, $nonce));
}
/**
* @dataProvider providerEncrypt
* @group decrypt
*/
public function testDecrypt($result, $key, $string)
{
// Fot tests use static nonce
if (OBS_ENCRYPT_MODULE === 'sodium')
{
$nonce = 'test';
} else {
$nonce = NULL;
}
$this->assertSame($result, decrypt($string, $key, $nonce));
}
/**
* @dataProvider providerEncryptIncorrect
* @group decrypt
*/
public function testDecryptIncorrect($result, $key, $string)
{
$this->assertFalse(decrypt($string, $key));
}
/**
* @dataProvider providerEncryptRandom
* @group random
*/
public function testEncryptRandom($string, $key)
{
$encrypt = encrypt($string, $key);
$decrypt = decrypt($encrypt, $key);
$this->assertSame($decrypt, $string);
}
/**
* @requires extension sodium
* @dataProvider providerEncryptSodiumRandom
* @group random
*/
public function testEncryptSodiumRandom($string, $key)
{
$encrypt = encrypt_sodium($string, $key);
$decrypt = decrypt_sodium($encrypt, $key);
$this->assertSame($decrypt, $string);
}
public function providerEncrypt()
{
if (OBS_ENCRYPT_MODULE === 'sodium')
{
$result = array(
array('1)AEo@^Cq&n[i&K5Rbk)YmYto|iK6&:j,3w.9', '1e78V2', 'po1Yr3rjOhi04wDOsyt2W-DEbObyBNLtssRuIxENOe3worH1MiuqNr5ZGmbAElwoU76DFho'),
array(',>3(K!$eu0QXr6SBW[$', 'jPpz9', '8u73mdXrtw4ToQw9CBvMLfrugtd7gS_JtoU695dyInfpnm0'),
array('Xm+0JOu1pZ#mLu4k !h<J~nRC', 'q1I5LcMX', 'MgXHgCN6WtNNsjUW1i5p6sp9j79gT_BGDXhSYUFnRftEi8rZMn3bsgA'),
array('nU1I|X61$s WT \'{Ia)25|\'f.F', 'tTfKUX6', 'Ut5IyaVVRaCYW2aJPAXc5qiiLsdJ1jd7sUAfr8LDqORrpk9NQcSd4aj-'),
array('3UrLXOOI/*/VW3\\@l8#DkLFpm(8U@$%bsKTmC', '803aRMNF', 'CRqvvvSTUaUCK3pQr2ScK4P1gewotrT76bIcCfeTX2Kz-USHTS1KjO2TAEykRtK3ITdiFIE'),
array('g&W$w[K(rt(jwWC{fYDw\'M;I/1gNo', 'MpRE', 'PVenPWwrPzd15RhKLLjIm9ma8iFAcNZnH34Ts2Br4pI5U5Hsw3fDjzpLwtMs'),
array('*R$oh3nu-pe2#}ovVT!Wr/Rk?hj<', 'EGqi', '2BlR5cS-6WGPz-xXHdh8mv79wncsR4Ca4HHDKiqh2pgtCeppn8-9RCFpK2A'),
array('CUo<&\\Te-s2O[zsQg&m%_', 'Jbyjh', 'Apxo7cRz4oQYzviARjDmYkZpNiCmS29i0quCu--sJJj58v6fmw'),
array('y+U/0i&:Z$]+\\G`<rPc|\\{-7e^', 'LuMhrEPs', 'wwtra16iR0qbMMhGWNmRlTFbjVDmZpanKoQOJ_-d4DFMi4cJ4S9Tu7Hs'),
array('=V>00QV807A7*seug3 fh^n;7\'w&CX0x!3P~', 'zbOj0', 'w5AKoKG_iGY41NzzeP4T3dZAqFnUUwo-Wky4WjbRB_fPNOtGuXxFpVuO3awmeV_ZiAwJDA'),
array('rl3yLUk<{bApLXJ@a@\\Y{M\\,z:4', 'QCGdqu', '4F6MQxnzl71QpP3vJ3yutgpLqFRYkCnez1gMVFIkhIZ4qN7RIl3x1Y6k_Q'),
array('*rF@W)b9GOu<[`RR1/,#FnQCE3PgI', 'QQOd', 'c6baoXI9uni5BAWaRYCYQF8v2WgHcGpeqeHkWP3Dp2QJ7KHKUxF2zNrarwpD'),
array('j$kY#JNym311~0hVo%HX@7Fsks(g', 'PxFdn97J', 'TwtFAgU85cU7ypq8EEx75BPk8RZaTS0bj7nEak3_4Rx6KTWFdB4RkM_Pwy8'),
array(']&rQB>~nOf!A4h7}X~G$\\!uD$zGc*a', '9wlzwu78', 'YwsuhTT5r9LGTCJoOzWLtrNJQqqCEHPTcqPzMTtY3LHQodU_QIm3z-TQccH62A'),
array('Y7RZTJV>U\\"mx3(C!5hKgBw-', '7RyavjK', 'osFXadNstXIwlACmVYICQXV-djwzcY1dYx1So7UcGYEAU-SJ_GwuBQ'),
array('!t#.;(bK}k@kVrf;#}Q-jp|;?hE|+.O', 'i1txZiB', 'e33OXAxT2XWXLODhYPgLNsed3EVvHfbTXShFS8IJNWkmKEyl3xKKTySwYk4MP-I'),
array('>1`k@Lr4|3ot4WrgA!g||8}vSZhBT=c13|,/_{', 'OGHuN', 'rO5gPJnZM8zHs3M-MzJHU-86zxvJBNwe_1cXGaJoR_nmcNNXaLJss0kaTp1zmS2zec_XmJb5'),
array('\\0TcEC6wGL# >JXv6 `eJ', '7zaLTGW', 'Fl2wMTFWLFP0pb02RlrGGut-HNm1DvAB7vC0xt0CXNJ1h4_hxg'),
array(':r")v$eXry,13E!{7?K.U%-@SDD', 'hvHW', 'kQwfSPwLmHBgz_n8wbQPhipQL_pD7ZJkdbc9IuUTE7MGpucR2ZeeibP5iw'),
array('q%S/wOQhM%f3G06C1#uJgjIMWf\\`', '4Zlb', 'A4uDbyfqHaXVSmRB2Hs6C4gIJKgKij7w_H0pgWJcTFskDlhR32h0jZdb2LI'),
);
} else {
// Mcrypt based encode
$result = array(
array('1)AEo@^Cq&n[i&K5Rbk)YmYto|iK6&:j,3w.9', '1e78V2', '22x_TJwDCwSvVmx5eGYgZwR70vN03nytSZGiAgNPYebjrQmwYs-oBAqUmRd5B9jHlk4Dmq6B45clMfEDZj4Amg'),
array(',>3(K!$eu0QXr6SBW[$', 'jPpz9', 'shwqhvs-EBr4cPKAhKwx8Tg6hSMSyNjPHDh8p-e94qU'),
array('Xm+0JOu1pZ#mLu4k !h<J~nRC', 'q1I5LcMX', '3Ze4oHSqI5oN2AwGfFLqKerVIkIO8hcpTRmMFrpVMiY'),
array('nU1I|X61$s WT \'{Ia)25|\'f.F', 'tTfKUX6', 'UBBFIuqdWz-D59B1W9v4axN5N5BONcVxK13E_cVj6jM'),
array('3UrLXOOI/*/VW3\\@l8#DkLFpm(8U@$%bsKTmC', '803aRMNF', '7e7bKnx43eHNaz-BF3DcRDIyRXc_n7i8ANX4I0vtifzjpPPofy4GAuacKA5lWmhxLcPmm0hooEfR7NbR2RpqQA'),
array('g&W$w[K(rt(jwWC{fYDw\'M;I/1gNo', 'MpRE', '35tNZp_7BdOdl78Kr7g6C9l-tGUWsDGjnPaLSVvsdk4'),
array('*R$oh3nu-pe2#}ovVT!Wr/Rk?hj<', 'EGqi', 'tp1QhPUl_OY_SdSXlEk8uUj06J2ODFMG069SfR1UWTY'),
array('CUo<&\\Te-s2O[zsQg&m%_', 'Jbyjh', 'FH1bgmum4IhTeWT_WUS_P4aKUXTBUux-UDdpBxoypmI'),
array('y+U/0i&:Z$]+\\G`<rPc|\\{-7e^', 'LuMhrEPs', 'i9Q4ugsCpZS5M0xYwmm3rnvQcupBCNEzXvhYljpI6K8'),
array('=V>00QV807A7*seug3 fh^n;7\'w&CX0x!3P~', 'zbOj0', 'DzzUC_QTjgm09jUP6opubGBec-_y2t_qTzznu6GDW5dQH-9OwogLsh8bv1E56gMtBzneWrgyb0zv9ljdKi0ssQ'),
array('rl3yLUk<{bApLXJ@a@\\Y{M\\,z:4', 'QCGdqu', 'JTUFKcO0og8-NJtvl0PY8vQbLcjpBQzOI18doptwju8'),
array('*rF@W)b9GOu<[`RR1/,#FnQCE3PgI', 'QQOd', 'PoWS8Yy7cjN8cfk44Wd_mz3wiwf_zVVDk-Sh75UAt94'),
array('j$kY#JNym311~0hVo%HX@7Fsks(g', 'PxFdn97J', 'hWwJI1bh6LM6y6lsbekda6e4Gcedf7zkZRdKe882CAE'),
array(']&rQB>~nOf!A4h7}X~G$\\!uD$zGc*a', '9wlzwu78', 'uAL00RVr8X9MSU8Z4o63CpyoU8AQv8etF5aB1ZVayfU'),
array('Y7RZTJV>U\\"mx3(C!5hKgBw-', '7RyavjK', 'M55vgEwiLOKLMSPmLGldunnkBBRAPQAEcUwpgRRrxW0'),
array('!t#.;(bK}k@kVrf;#}Q-jp|;?hE|+.O', 'i1txZiB', 'Db7ktjeBwCfp1ZNT1B3EuGN0zoJOA7Ie6C_0JINuLvU'),
array('>1`k@Lr4|3ot4WrgA!g||8}vSZhBT=c13|,/_{', 'OGHuN', 'Vc9BEP_JFshoM65Cvn7cs82W9IybUZdUtn5iBin5QGgOgTc8Gko2bVrtYC9TZ7__3v4diH8tRdN4CmBQBt9GAg'),
array('\\0TcEC6wGL# >JXv6 `eJ', '7zaLTGW', 'JPz__8TD8GIYX3IoLbicq67PU4BqC-3oyTniwirQvY8'),
array(':r")v$eXry,13E!{7?K.U%-@SDD', 'hvHW', 'x_fL0dKsVf7Rv_cWYbyB_7FGniyZgFiI_VfdLRyPPRc'),
array('q%S/wOQhM%f3G06C1#uJgjIMWf\\`', '4Zlb', 'rscMSDQGtZBBEZtj9ToKAPp1oTPZuNFJYePmGNVQMyo'),
);
}
return $result;
}
public function providerEncryptIncorrect()
{
if (OBS_ENCRYPT_MODULE === 'sodium')
{
$result = array(
array('1)AEo@^Cq&n[i&K5Rbk)YmYto|iK6&:j,3w.9', '1e78V2', 'po1Yr3rjOhi04wDOsyt2W-DEbObyBNLtssRuIxENOe3wH1MiuqNr5ZGmbAElwoU76DFho'),
array(',>3(K!$eu0QXr6SBW[$', 'jPpz900', '8u73mdXrtw4ToQw9CBvMLfrugtd7gS_JtoU695dyInfpnm0'),
);
} else {
// Mcrypt based encode
$result = array(
array('1)AEo@^Cq&n[i&K5Rbk)YmYto|iK6&:j,3w.9', '1e78V2', '22x_TJwDCwSvVmx5eGYgZwR70vN03nytSrQmwYs-oBAqUmRd5B9jHlk4Dmq6B45clMfEDZj4Amg'),
array(',>3(K!$eu0QXr6SBW[$', 'jPpz900', 'shwqhvs-EBr4cPKAhKwx8Tg6hSMSyNjPHDh8p-e94qU'),
);
}
return $result;
}
public function providerEncryptRandom()
{
$charlist = ' 0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ`~!@#$%^&*()_+-=[]{}\|/?,.<>;:"'."'";
$result = array();
for ($i=0; $i<20; $i++)
{
$string = generate_random_string(mt_rand(20, 40), $charlist);
$key = generate_random_string(mt_rand(4, 8));
$result[] = array($string, $key);
}
return $result;
}
public function providerEncryptSodiumRandom() {
$charlist = ' 0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ`~!@#$%^&*()_+-=[]{}\|/?,.<>;:"'."'";
$string = generate_random_string(mt_rand(20, 40), $charlist);
$result = array();
if (OBS_ENCRYPT_MODULE === 'sodium') {
$result[] = array( $string, generate_random_string(SODIUM_CRYPTO_SECRETBOX_KEYBYTES - 1), generate_random_string(SODIUM_CRYPTO_SECRETBOX_NONCEBYTES - 1) );
$result[] = array( $string, generate_random_string(SODIUM_CRYPTO_SECRETBOX_KEYBYTES - 1), generate_random_string(SODIUM_CRYPTO_SECRETBOX_NONCEBYTES) );
$result[] = array( $string, generate_random_string(SODIUM_CRYPTO_SECRETBOX_KEYBYTES - 1), generate_random_string(SODIUM_CRYPTO_SECRETBOX_NONCEBYTES + 1) );
$result[] = array( $string, generate_random_string(SODIUM_CRYPTO_SECRETBOX_KEYBYTES), generate_random_string(SODIUM_CRYPTO_SECRETBOX_NONCEBYTES - 1) );
$result[] = array( $string, generate_random_string(SODIUM_CRYPTO_SECRETBOX_KEYBYTES), generate_random_string(SODIUM_CRYPTO_SECRETBOX_NONCEBYTES) );
$result[] = array( $string, generate_random_string(SODIUM_CRYPTO_SECRETBOX_KEYBYTES), generate_random_string(SODIUM_CRYPTO_SECRETBOX_NONCEBYTES + 1) );
//$result[] = array($string, generate_random_string(SODIUM_CRYPTO_SECRETBOX_KEYBYTES + 1), generate_random_string(SODIUM_CRYPTO_SECRETBOX_NONCEBYTES - 1));
//$result[] = array($string, generate_random_string(SODIUM_CRYPTO_SECRETBOX_KEYBYTES + 1), generate_random_string(SODIUM_CRYPTO_SECRETBOX_NONCEBYTES));
//$result[] = array($string, generate_random_string(SODIUM_CRYPTO_SECRETBOX_KEYBYTES + 1), generate_random_string(SODIUM_CRYPTO_SECRETBOX_NONCEBYTES + 1));
}
return $result;
}
}
// EOF

View File

@ -0,0 +1,79 @@
<?php
//define('OBS_DEBUG', 2);
include(dirname(__FILE__) . '/../includes/sql-config.inc.php');
//include(dirname(__FILE__) . '/../includes/defaults.inc.php');
//include(dirname(__FILE__) . '/../config.php');
//include(dirname(__FILE__) . '/../includes/definitions.inc.php');
//include(dirname(__FILE__) . '/../includes/functions.inc.php');
class IncludesEntitiesTest extends \PHPUnit\Framework\TestCase
{
/**
* @dataProvider providerEntityDescrDefinition
* @group descr
*/
public function testEntityDescrDefinition($type, $result, $definition, $descr_entry, $count = 1)
{
$this->assertSame($result, entity_descr_definition($type, $definition, $descr_entry, $count));
}
public function providerEntityDescrDefinition()
{
$result = array();
// Mempool
$type = 'mempool';
$definition = array();
$array = array('i' => '22', 'index' => '33');
// Defaults from entity definition
$result[] = array($type, 'Memory', $definition, $array);
$result[] = array($type, 'Memory Pool 33', $definition, $array, 2);
// Descr from oid_descr, but it empty
$definition['oid_descr'] = 'OidName';
$result[] = array($type, 'Memory', $definition, $array);
// Descr from descr
$definition['descr'] = 'Name from Descr';
$result[] = array($type, 'Name from Descr', $definition, $array);
$result[] = array($type, 'Name from Descr 33', $definition, $array, 2);
// Descr from oid_descr
$array['OidName'] = 'Name from Oid';
$result[] = array($type, 'Name from Oid', $definition, $array);
$result[] = array($type, 'Name from Oid', $definition, $array, 2);
// Now descr use tags
$definition['descr'] = 'Name from Descr with Tags (%i%) {%index%} [%oid_descr%]';
$result[] = array($type, 'Name from Descr with Tags (22) {33} [Name from Oid]', $definition, $array);
$definition['descr'] = 'Name from Descr with Tags (%OidName%)';
$result[] = array($type, 'Name from Descr with Tags (Name from Oid)', $definition, $array);
// Tag multiple times
$definition['descr'] = 'Name from Descr with multiple Tags {%oid_descr%} [%oid_descr%]';
$result[] = array($type, 'Name from Descr with multiple Tags {Name from Oid} [Name from Oid]', $definition, $array);
// Multipart indexes
$definition['descr'] = 'Name from Descr with Tags {%index0%}';
$result[] = array($type, 'Name from Descr with Tags {33}', $definition, $array);
$array['index'] = '11.22.33.44.55';
$definition['descr'] = 'Name from Descr with Multipart Index {%index1%} {%index3%} {%index2%} [%index%]';
$result[] = array($type, 'Name from Descr with Multipart Index {22} {44} {33} [11.22.33.44.55]', $definition, $array);
// Sensors
$type = 'sensor';
$definition = array();
$array = array('i' => '22', 'index' => '33');
$definition['oid_descr'] = 'jnxOperatingDescr';
$definition['descr_transform'] = ['action' => 'entity_name'];
$array['jnxOperatingDescr'] = "PIC: 4x 10GE(LAN) SFP+ @ 0/0/*";
$result[] = array($type, 'PIC: 4x 10GE(LAN) SFP+ @ 0/0/*', $definition, $array);
return $result;
}
}
// EOF

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,273 @@
<?php
$base_dir = realpath(__DIR__ . '/..');
$config['install_dir'] = $base_dir;
include(__DIR__ . '/../includes/defaults.inc.php');
//include(dirname(__FILE__) . '/../config.php'); // Do not include user editable config here
include(__DIR__ . '/../includes/common.inc.php');
include(__DIR__ . '/../includes/definitions.inc.php');
include(__DIR__ . '/data/test_definitions.inc.php'); // Fake definitions for testing
include(__DIR__ . '/../includes/functions.inc.php');
include(__DIR__ . '/../includes/port-descr-parser.inc.php');
class IncludesPortDescrParserTest extends \PHPUnit\Framework\TestCase {
/**
* @dataProvider providerParser
*/
public function testParser($string, $result) {
global $config;
// Add in custom interface groups for testing
$config['int_groups'] = [ 'TestGroup1', 'TestGroup2', 'abr' ];
$this->assertSame($result, custom_port_parser([ 'ifAlias' => $string ]));
}
public function providerParser() {
return array(
array('Cust: Example Customer',
array('type' => 'cust',
'descr' => 'Example Customer',
//'circuit' => null,
//'speed' => null,
//'notes' => null,
)
),
array('Cust: Example Customer {CIRCUIT}',
array('type' => 'cust',
'descr' => 'Example Customer',
'circuit' => 'CIRCUIT',
//'speed' => null,
//'notes' => null,
)
),
array('Cust: Example Customer [SPEED]',
array('type' => 'cust',
'descr' => 'Example Customer',
//'circuit' => null,
'speed' => 'SPEED',
//'notes' => null,
)
),
array('Cust: Example Customer (NOTE)',
array('type' => 'cust',
'descr' => 'Example Customer',
//'circuit' => null,
//'speed' => null,
'notes' => 'NOTE',
)
),
array('Cust: Example Customer {CIRCUIT} (NOTE)',
array('type' => 'cust',
'descr' => 'Example Customer',
'circuit' => 'CIRCUIT',
//'speed' => null,
'notes' => 'NOTE',
)
),
array('Cust: Example Customer {CIRCUIT} [SPEED]',
array('type' => 'cust',
'descr' => 'Example Customer',
'circuit' => 'CIRCUIT',
'speed' => 'SPEED',
//'notes' => null,
)
),
array('Cust: Example Customer [SPEED] (NOTE)',
array('type' => 'cust',
'descr' => 'Example Customer',
//'circuit' => null,
'speed' => 'SPEED',
'notes' => 'NOTE',
)
),
array('Cust: Example Customer {CIRCUIT} [SPEED] (NOTE)',
array('type' => 'cust',
'descr' => 'Example Customer',
'circuit' => 'CIRCUIT',
'speed' => 'SPEED',
'notes' => 'NOTE',
)
),
array('Cust: Example Customer{CIRCUIT}[SPEED](NOTE)',
array('type' => 'cust',
'descr' => 'Example Customer',
'circuit' => 'CIRCUIT',
'speed' => 'SPEED',
'notes' => 'NOTE',
)
),
array('Cust: !@#$%^&*_-=+/|\.,`~";:<>?\' {CIRCUIT}[SPEED](NOTE)',
array('type' => 'cust',
'descr' => '!@#$%^&*_-=+/|\.,`~";:<>?\'',
'circuit' => 'CIRCUIT',
'speed' => 'SPEED',
'notes' => 'NOTE',
)
),
// website example
array('Cust: Example Customer [10Mbit] (T1 Telco Y CCID129031) {EXAMP0001}',
array('type' => 'cust',
'descr' => 'Example Customer',
'circuit' => 'EXAMP0001',
'speed' => '10Mbit',
'notes' => 'T1 Telco Y CCID129031',
)
),
# Transit
array('Transit: Example Provider {CIRCUIT} [SPEED] (NOTE)',
array('type' => 'transit',
'descr' => 'Example Provider',
'circuit' => 'CIRCUIT',
'speed' => 'SPEED',
'notes' => 'NOTE',
)
),
# Core
array('Core: Example Core {CIRCUIT} [SPEED] (NOTE)',
array('type' => 'core',
'descr' => 'Example Core',
'circuit' => 'CIRCUIT',
'speed' => 'SPEED',
'notes' => 'NOTE',
)
),
# Peering
array('Peering: Example Peer {CIRCUIT} [SPEED] (NOTE)',
array('type' => 'peering',
'descr' => 'Example Peer',
'circuit' => 'CIRCUIT',
'speed' => 'SPEED',
'notes' => 'NOTE',
)
),
# Server
array('Server: Example Server {CIRCUIT} [SPEED] (NOTE)',
array('type' => 'server',
'descr' => 'Example Server',
'circuit' => 'CIRCUIT',
'speed' => 'SPEED',
'notes' => 'NOTE',
)
),
# L2TP
array('L2TP: Example L2TP {CIRCUIT} [SPEED] (NOTE)',
array('type' => 'l2tp',
'descr' => 'Example L2TP',
'circuit' => 'CIRCUIT',
'speed' => 'SPEED',
'notes' => 'NOTE',
)
),
# Custom: TestGroup1
array('TestGroup1: Test Group 1 {CIRCUIT} [SPEED] (NOTE)',
array('type' => 'testgroup1',
'descr' => 'Test Group 1',
'circuit' => 'CIRCUIT',
'speed' => 'SPEED',
'notes' => 'NOTE',
)
),
# Custom: TestGroup2
array('TestGroup2: Test Group 2 {CIRCUIT} [SPEED] (NOTE)',
array('type' => 'testgroup2',
'descr' => 'Test Group 2',
'circuit' => 'CIRCUIT',
'speed' => 'SPEED',
'notes' => 'NOTE',
)
),
# Issues
[
'ABR: aepripb1 - RIPATRANSONE {OPEN FIBER E0000000044} [1Gbit]',
[
'type' => 'abr',
'descr' => 'aepripb1 - RIPATRANSONE',
'circuit' => 'OPEN FIBER E0000000044',
'speed' => '1Gbit',
//'notes' => NULL,
]
],
# Errors
# Missing description
array('Core: {CIRCUIT} [SPEED] (NOTE)',
array(),
),
# Missing type
array('Example {CIRCUIT} [SPEED] (NOTE)',
array(),
),
# B0rken circuit
array('Core: Example {CIRCUIT',
array('type' => 'core',
'descr' => 'Example',
//'circuit' => null,
//'speed' => null,
//'notes' => null,
)
),
# B0rken circuit
array('Core: Example CIRCUIT}',
array('type' => 'core',
'descr' => 'Example CIRCUIT',
//'circuit' => null,
//'speed' => null,
//'notes' => null,
)
),
# B0rken speed
array('Core: Example [SPEED',
array('type' => 'core',
'descr' => 'Example',
//'circuit' => null,
//'speed' => null,
//'notes' => null,
)
),
# B0rken speed
array('Core: Example SPEED]',
array('type' => 'core',
'descr' => 'Example SPEED',
//'circuit' => null,
//'speed' => null,
//'notes' => null,
)
),
# B0rken notes
array('Core: Example (NOTE',
array('type' => 'core',
'descr' => 'Example',
//'circuit' => null,
//'speed' => null,
//'notes' => null,
)
),
# B0rken notes
array('Core: Example NOTE)',
array('type' => 'core',
'descr' => 'Example NOTE',
//'circuit' => null,
//'speed' => null,
//'notes' => null,
)
),
# Bogus type
[ 'Foo: Example {CIRCUIT} [SPEED] (NOTE)',
[], ],
);
}
}
// EOF

View File

@ -0,0 +1,746 @@
<?php
// Import from CVS
require(__DIR__ . '/data/CsvFileIterator.php');
$base_dir = realpath(__DIR__ . '/..');
$config['install_dir'] = $base_dir;
// Base observium includes
include(__DIR__ . '/../includes/defaults.inc.php');
//include(dirname(__FILE__) . '/../config.php'); // Do not include user editable config here
include(__DIR__ . '/../includes/common.inc.php');
include(__DIR__ . '/../includes/definitions.inc.php');
include(__DIR__ . '/data/test_definitions.inc.php'); // Fake definitions for testing
include(__DIR__ . '/../includes/functions.inc.php');
// for generate provider data, uncomment this and run:
// php tests/IncludesRewritesTest.php
/*
// Generate provider data
foreach (array('iosrx', 'iosxe', 'ios', 'procurve', 'vrp') as $os)
{
foreach (array('entPhysicalDescr', 'entPhysicalName', 'hwEntityBomEnDesc') as $file)
{
if (!is_file(dirname(__FILE__) . "/data/$os.$file.txt")) { continue; }
$s = fopen(dirname(__FILE__) . "/data/$os.$file.txt", 'r');
while ($line = fgets($s))
{
list(,$string) = explode(' = ', $line, 2);
$string = trim($string);
if (!isset($valid[$string]))
{
$rewrite = rewrite_entity_name($string);
$valid[$string] = $rewrite;
}
}
fclose($s);
}
}
$csv = fopen(dirname(__FILE__) . "/data/providerRewriteEntityName.csv", 'w');
foreach ($valid as $string => $rewrite)
{
fputcsv($csv, array($string, $rewrite));
}
fclose($csv);
exit;
*/
class IncludesRewritesTest extends \PHPUnit\Framework\TestCase
{
/**
* @dataProvider providerRewriteEntityNameCsv
* @group rename_entity
*/
public function testRewriteEntityNameCsv($string, $result)
{
$this->assertSame($result, rewrite_entity_name($string));
}
public function providerRewriteEntityNameCsv()
{
return new CsvFileIterator(dirname(__FILE__) . '/data/providerRewriteEntityName.csv');
}
/**
* @dataProvider providerRewriteEntityName
* @group rename_entity
*/
public function testRewriteEntityName($string, $result)
{
$this->assertSame($result, rewrite_entity_name($string));
}
public function providerRewriteEntityName()
{
return array(
array('GenuineIntel Intel Celeron M processor .50GHz, 1496 MHz', 'Intel Celeron M processor .50GHz, 1496 MHz'),
array('CPU Intel Celeron M (TM) (R)', 'Intel Celeron M'),
);
}
/**
* @dataProvider providerRewriteVendor
* @group vendor
*/
public function testRewriteVendor($string, $result)
{
$this->assertSame($result, rewrite_vendor($string));
}
public function providerRewriteVendor()
{
return array(
// Simple rewrites
array('Brocade Communications Systems, Inc.', 'Brocade'),
array('Cisco Systems Inc', 'Cisco'),
array('Cisco Systems Inc.', 'Cisco'),
array('Cisco Systems, Inc.', 'Cisco'),
array('Juniper Networks, Inc.', 'Juniper'),
array('Juniper Networks', 'Juniper'),
array('Dell Inc.', 'Dell'),
array('Enterasys Networks, Inc.', 'Enterasys'),
array('FIBERXON INC.', 'Fiberxon'),
array('Netgear Inc', 'Netgear'),
array('Volex Inc.', 'Volex'),
array('Broadcom Corp.', 'Broadcom'),
array('FINISAR CORP.', 'Finisar'),
array('Oracle Corporation', 'Oracle'),
array('Methode Elec.', 'Methode'),
array('Deell Computer Corporation', 'Deell'),
array('Liebert Corporation Liebert', 'Liebert'),
// Keep MultiCase as is
array('OneAccess', 'OneAccess'),
array('3Y Power', '3Y Power'),
array('Alcatel-Lucent', 'Alcatel-Lucent'),
array('CAS-systems', 'CAS-systems'),
array('VMware', 'VMware'),
array('VMware, Inc.', 'VMware'),
array('EfficientIP', 'EfficientIP'),
// Small name also keep as is
array('NHR', 'NHR'),
array('OEM', 'OEM'),
array('JDSU', 'JDSU'),
array('TI', 'TI'),
array('HP', 'HP'),
// Search in definitions
array('Hewlett-Packard', 'HP'),
array('Hewlett Packard', 'HP'),
array('Hewlett-Packard Company', 'HP'),
array('HP Enterprise', 'HPE'),
array('H3C Comware', 'HPE'),
array('Hangzhou H3C Comware', 'HPE'),
array('HP Comware', 'HPE'),
array('Comware', 'HPE'),
array('Huawei Technologies Co., Ltd.', 'Huawei'),
array('Huawei Technologies', 'Huawei'),
array('Huawei-3Com', 'H3C'),
array('3Com', 'H3C'),
array('HUAWEI-3COM CORP.', 'H3C'),
array('Hangzhou H3C Tech. Co.', 'H3C'),
array('EC', 'Edgecore'),
array('Edge-Core', 'Edgecore'),
array('CISCO-OPNEXT,INC', 'Cisco'),
array('Dell Computer Corporation', 'Dell'),
array('MRV COMM, INC.', 'MRV'),
array('CASA-systems', 'Casa Systems'),
array('COMET SYSTEM, s.r.o.', 'Comet System'),
array('COMET SYSTEM, sro', 'Comet System'),
// This must keep Systems in name
array('Open Systems', 'Open Systems'),
array('Open Systems AG', 'Open Systems'),
// Some intersects
array('Geist', 'Geist'),
array('GE', 'GE'),
);
}
/**
* @dataProvider providerTrimQuotes
* @group string
*/
public function testTrimQuotes($string, $result)
{
$this->assertEquals($result, trim_quotes($string));
}
public function providerTrimQuotes()
{
return array(
array('\"sdfslfkm s\'fdsf" a;lm aamjn ', '"sdfslfkm s\'fdsf" a;lm aamjn'),
array('sdfslfkm s\'fdsf" a;lm aamjn \"', 'sdfslfkm s\'fdsf" a;lm aamjn "'),
array('sdfslfkm s\'fdsf" a;lm aamjn ', 'sdfslfkm s\'fdsf" a;lm aamjn'),
array('\"sdfslfkm s\'fdsf" a;lm aamjn \"', 'sdfslfkm s\'fdsf" a;lm aamjn '),
array('"sdfslfkm s\'fdsf" a;lm aamjn "', 'sdfslfkm s\'fdsf" a;lm aamjn '),
array('"\"sdfslfkm s\'fdsf" a;lm aamjn \""', 'sdfslfkm s\'fdsf" a;lm aamjn '),
array('\'\"sdfslfkm s\'fdsf" a;lm aamjn \"\'', 'sdfslfkm s\'fdsf" a;lm aamjn '),
array('"\'\"sdfslfkm s\'fdsf" a;lm aamjn \"\'"', 'sdfslfkm s\'fdsf" a;lm aamjn '),
array(' \'\"sdfslfkm s\'fdsf" a;lm aamjn \"\' ', 'sdfslfkm s\'fdsf" a;lm aamjn '),
array('"""sdfslfkm s\'fdsf" a;lm aamjn """', 'sdfslfkm s\'fdsf" a;lm aamjn '),
array('"""sdfslfkm s\'fdsf" a;lm aamjn """"""""', 'sdfslfkm s\'fdsf" a;lm aamjn """""'),
array('"""""""sdfslfkm s\'fdsf" a;lm aamjn """', '""""sdfslfkm s\'fdsf" a;lm aamjn '),
// escaped quotes
array('\"Mike Stupalov\" <mike@observium.org>', '"Mike Stupalov" <mike@observium.org>'),
// utf-8
array('Avenue Léon, België ', 'Avenue Léon, België'),
array('\"Avenue Léon, België \"', 'Avenue Léon, België '),
array('"Винни пух и все-все-все "', 'Винни пух и все-все-все '),
// multilined
array(' \'\"\"sdfslfkm s\'fdsf"
a;lm aamjn \"\"\' ', 'sdfslfkm s\'fdsf"
a;lm aamjn '),
);
}
/**
* @dataProvider providerCountryFromCode
* @group countries
*/
public function testCountryFromCode($string, $result)
{
$this->assertEquals($result, country_from_code($string));
}
public function providerCountryFromCode()
{
return array(
array('gb', 'United Kingdom'),
array('gbr', 'United Kingdom'),
array('United Kingdom', 'United Kingdom'),
array('us', 'United States'),
array('usa', 'United States'),
array('United States', 'United States'),
array('ru', 'Russian Federation'),
array('rus', 'Russian Federation'),
array('Russian Federation', 'Russian Federation'),
array('russia', 'Russian Federation'),
);
}
/**
* @dataProvider providerRewriteDefinitionHardware
* @group hardware
*/
public function testRewriteDefinitionHardware($os, $id, $result)
{
$device = array('os' => $os, 'sysObjectID' => $id);
$this->assertEquals($result, rewrite_definition_hardware($device));
}
public function providerRewriteDefinitionHardware()
{
return array(
array('calix', '.1.3.6.1.4.1.6321.1.2.2.5.3', 'E7-2'),
array('calix', '.1.3.6.1.4.1.6321.1.2.1', 'C7'),
array('calix', '.1.3.6.1.4.1.6321', 'C7'),
array('calix', '.1.3.6.1.4.1.6321.1.2.3', 'E5-100'),
);
}
/**
* @dataProvider providerArrayKeyReplace
* @group replace
*/
public function testArrayKeyReplace($string, $array, $result)
{
$this->assertEquals($result, array_key_replace($array, $string));
}
public function providerArrayKeyReplace()
{
$rewrite_array = array(
'other' => 'Other',
'rfc877x25',
'ethernetCsmacd' => 'Ethernet',
);
return array(
// empty/not exist pattern
array('Some other', array(), 'Some other'),
array('Some other', array('bleh' => 'REPLACE_STRING'), 'Some other'),
// incorrect
array('EthernetCsmacd', $rewrite_array, 'EthernetCsmacd'),
// real tests
array('other', $rewrite_array, 'Other'),
array('rfc877x25', $rewrite_array, 'rfc877x25'),
array('ethernetCsmacd', $rewrite_array, 'Ethernet'),
);
}
/**
* @dataProvider providerArrayStrReplace
* @group replace
*/
public function testArrayStrReplace($string, $array, $result)
{
$this->assertEquals($result, array_str_replace($array, $string));
}
public function providerArrayStrReplace()
{
$rewrite_array = array(
'ether' => 'Ether',
'gig' => 'Gig',
'fast' => 'Fast',
'ten' => 'Ten',
);
return array(
// empty/not exist pattern
array('Some Text', array(), 'Some Text'),
array('Some Text', array('bleh' => 'REPLACE_STRING'), 'Some Text'),
// real tests
array('Some gigabit ethernet', $rewrite_array, 'Some Gigabit Ethernet'),
array('Some gIgabit ETHERNET', $rewrite_array, 'Some Gigabit EtherNET'),
array('fastethernet', $rewrite_array, 'FastEthernet'),
);
}
/**
* @dataProvider providerArrayStrReplace2
* @group replace
*/
public function testArrayStrReplace2($string, $array, $result)
{
$this->assertEquals($result, array_str_replace($array, $string, TRUE));
}
public function providerArrayStrReplace2()
{
// Case Sensitive test
$rewrite_array = array(
'ether' => 'Ether',
'gig' => 'Gig',
'fast' => 'Fast',
'ten' => 'Ten',
);
return array(
// real tests
array('Some gigabit ethernet', $rewrite_array, 'Some Gigabit Ethernet'),
array('Some gIgabit ETHERNET', $rewrite_array, 'Some gIgabit ETHERNET'),
array('fastethernet', $rewrite_array, 'FastEthernet'),
);
}
/**
* @dataProvider providerArrayPregReplace
* @group replace
*/
public function testArrayPregReplace($string, $array, $result)
{
$this->assertEquals($result, array_preg_replace($array, $string));
}
public function providerArrayPregReplace()
{
$rewrite_regexp = array(
'/Nortel .* Module - /i' => '%TEST1%',
'/Baystack .* - /i' => '%TEST2%',
'/DEC [a-z\d]+ PCI /i' => '%TEST3%',
'!^APC !' => '%TEST4%',
);
return array(
// empty/not exist pattern
array('Some Text Baystack IUHIINind jawdbjdn - @@', array(), 'Some Text Baystack IUHIINind jawdbjdn - @@'),
array('Some Text Baystack IUHIINind jawdbjdn - @@', array('/some text/' => 'REPLACE_STRING'), 'Some Text Baystack IUHIINind jawdbjdn - @@'),
// real tests
array('Some Text Nortel IUHIINind ggg Module - @@', $rewrite_regexp, 'Some Text %TEST1%@@'),
array('Some Text Baystack IUHIINind jawdbjdn - @@', $rewrite_regexp, 'Some Text %TEST2%@@'),
array('Some Text DEC ind666618368318318368 PCI @@', $rewrite_regexp, 'Some Text %TEST3%@@'),
array('APC Some Text @@', $rewrite_regexp, '%TEST4% Some Text @@'),
);
}
/**
* @dataProvider providerArrayTagReplace
* @group replace
*/
public function testArrayTagReplace($string, $array, $result)
{
$this->assertEquals($result, array_tag_replace($array, $string));
}
public function providerArrayTagReplace()
{
// recursive from array
$rfrom = array(
'somekey' => array(
'somekey3' => 'port-%INDEX%-%index%.rrd',
'somekey4' => 'port-%descr%-%index%-% %.rrd',
),
'somekey2' => 'port-%descr%-%index%-%.rrd',
'perf-pollermodule-%index%.rrd',
// Must be keep as is
'bool' => TRUE,
'int' => 293847,
'null' => NULL
);
$rto = array(
'somekey' => array(
'somekey3' => 'port--0.rrd',
'somekey4' => 'port--0-% %.rrd',
),
'somekey2' => 'port--0-%.rrd',
'perf-pollermodule-0.rrd',
'bool' => TRUE,
'int' => 293847,
'null' => NULL
);
return array(
// empty/not exist keys
array('%some_key%', array(), ''),
array('http://some_url/%some_url%/some_url', array('some_url' => 'REPLACE_STRING'), 'http://some_url/REPLACE_STRING/some_url'),
// duplicate keys
array('http://some_url/%some_url%/%some_url%', array('some_url' => 'REPLACE_STRING'), 'http://some_url/REPLACE_STRING/REPLACE_STRING'),
// multiple keys
array('http://some_url/%some1%/%some2%', array('some1' => '1111', 'some2' => '2222'), 'http://some_url/1111/2222'),
// real test
array('perf-pollermodule-%index%.rrd', array('index' => 0), 'perf-pollermodule-0.rrd'),
array('port-%descr%-%index%.rrd', array('index' => 0), 'port--0.rrd'),
array('%url%%routing_key%', array('url' => 'https://alert.victorops.com/integrations/generic/20131114/alert/XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX/', 'routing_key' => 'everyone'),
'https://alert.victorops.com/integrations/generic/20131114/alert/XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX/everyone'),
// Tags is case-sensitive!
array('port-%INDEX%-%index%.rrd', array('index' => 0), 'port--0.rrd'),
array(1000000000, array('index' => 0), '1000000000'), // integer to string
// Keep not tagged percent signs
array('port-%descr%-%index%-%.rrd', array('index' => 0), 'port--0-%.rrd'),
array('port-%descr%-%index%-%%.rrd', array('index' => 0), 'port--0-%%.rrd'),
array('port-%descr%-%index%-% %.rrd', array('index' => 0), 'port--0-% %.rrd'),
// recursive arrays with string
array($rfrom, array('index' => 0), $rto),
);
}
/**
* @dataProvider providerProcessPortLabel
* @group process
*/
public function testProcessPortLabel($os, $array, $result)
{
// Port array template
$port = array(
'ifIndex' => '5',
//'ifDescr' => 'GigabitEthernet0/1',
'ifType' => 'ethernetCsmacd',
'ifMtu' => '1500',
'ifSpeed' => '1000000000',
'ifPhysAddress' => '4c:4e:35:fb:c7:20',
'ifAdminStatus' => 'up',
'ifOperStatus' => 'up',
'ifLastChange' => '0:0:01:03.68',
'ifInOctets' => '2336423782',
'ifInUcastPkts' => '56523160',
'ifInDiscards' => '0',
'ifInErrors' => '195562',
'ifInUnknownProtos' => '0',
'ifOutOctets' => '2769871040',
'ifOutUcastPkts' => '83292747',
'ifOutDiscards' => '0',
'ifOutErrors' => '0',
//'ifName' => 'Gi0/1',
'ifInMulticastPkts' => '1',
'ifInBroadcastPkts' => '21',
'ifOutMulticastPkts' => '16933',
'ifOutBroadcastPkts' => '2434835',
'ifHCInOctets' => '10926358374',
'ifHCInUcastPkts' => '56523160',
'ifHCInMulticastPkts' => '1',
'ifHCInBroadcastPkts' => '21',
'ifHCOutOctets' => '75784315072',
'ifHCOutUcastPkts' => '83292747',
'ifHCOutMulticastPkts' => '16933',
'ifHCOutBroadcastPkts' => '2434835',
'ifLinkUpDownTrapEnable' => 'enabled',
'ifHighSpeed' => '1000',
'ifPromiscuousMode' => 'false',
'ifConnectorPresent' => 'true',
//'ifAlias' => 'Po1#2',
'ifCounterDiscontinuityTime' => '0:0:00:32.81',
'dot3StatsDuplexStatus' => 'fullDuplex',
);
foreach ($array as $oid => $value)
{
$port[$oid] = $value;
}
// Device array template
$device = array(
'device_id' => 99999999,
'os' => $os,
);
// Process $port array
process_port_label($port, $device);
//var_dump($port);
// Select specific entries for validate
$test_array = array();
foreach (array('port_label', 'port_label_num', 'port_label_base', 'port_label_short') as $oid)
{
$test_array[$oid] = $port[$oid];
}
// Additionally test processing ifAlias on some entries
if (isset($result['ifAlias']))
{
$test_array['ifAlias'] = $port['ifAlias'];
}
$this->assertEquals($result, $test_array);
}
public function providerProcessPortLabel()
{
return array(
array('ios', array('ifDescr' => 'GigabitEthernet0/1', 'ifName' => 'Gi0/1', 'ifAlias' => 'Po1#2'),
array('port_label' => 'GigabitEthernet0/1', 'port_label_num' => '0/1', 'port_label_base' => 'GigabitEthernet', 'port_label_short' => 'Gi0/1')),
array('ios', array('ifDescr' => 'FastEthernet0/1/1', 'ifName' => 'Fa0/1/1', 'ifAlias' => 'COMSTAR BGP link'),
array('port_label' => 'FastEthernet0/1/1', 'port_label_num' => '0/1/1', 'port_label_base' => 'FastEthernet', 'port_label_short' => 'Fa0/1/1')),
array('ios', array('ifDescr' => 'Null0', 'ifName' => 'Nu0', 'ifAlias' => ''),
array('port_label' => 'Null0', 'port_label_num' => '0', 'port_label_base' => 'Null', 'port_label_short' => 'Nu0')),
array('ios', array('ifDescr' => 'Vlan1', 'ifName' => 'Vl1', 'ifAlias' => ''),
array('port_label' => 'Vlan1', 'port_label_num' => '1', 'port_label_base' => 'Vlan', 'port_label_short' => 'Vlan1')),
array('iosxe', array('ifDescr' => 'TwentyFiveGigE1/0/14', 'ifName' => 'Twe1/0/14', 'ifAlias' => ''),
array('port_label' => 'TwentyFiveGigE1/0/14', 'port_label_num' => '1/0/14', 'port_label_base' => 'TwentyFiveGigE', 'port_label_short' => 'Twe1/0/14')),
array('iosxe', array('ifDescr' => 'HundredGigE1/0/52', 'ifName' => 'Hu1/0/52', 'ifAlias' => ''),
array('port_label' => 'HundredGigE1/0/52', 'port_label_num' => '1/0/52', 'port_label_base' => 'HundredGigE', 'port_label_short' => 'Hu1/0/52')),
array('iosxr', array('ifDescr' => 'Bundle-Ether670.1793', 'ifName' => 'Bundle-Ether670.1793', 'ifAlias' => ''),
array('port_label' => 'Bundle-Ether670.1793', 'port_label_num' => '670.1793', 'port_label_base' => 'Bundle-Ether', 'port_label_short' => 'BE670.1793')),
array('iosxr', array('ifDescr' => 'ControlEthernet0/RSP0/CPU0/S0/10', 'ifName' => 'ControlEthernet0/RSP0/CPU0/S0/10', 'ifAlias' => ''),
array('port_label' => 'ControlEthernet0/RSP0/CPU0/S0/10', 'port_label_num' => '0/RSP0/CPU0/S0/10', 'port_label_base' => 'ControlEthernet', 'port_label_short' => 'CE0/RSP0/CPU0/S0/10')),
array('iosxr', array('ifDescr' => 'MgmtEth0/RP0/CPU0/0', 'ifName' => 'MgmtEth0/RP0/CPU0/0', 'ifAlias' => ''),
array('port_label' => 'MgmtEth0/RP0/CPU0/0', 'port_label_num' => '0/RP0/CPU0/0', 'port_label_base' => 'MgmtEth', 'port_label_short' => 'Mgmt0/RP0/CPU0/0')),
array('iosxr', array('ifDescr' => 'Optics0/0/0/5', 'ifName' => 'Optics0/0/0/5', 'ifAlias' => ''),
array('port_label' => 'Optics0/0/0/5', 'port_label_num' => '0/0/0/5', 'port_label_base' => 'Optics', 'port_label_short' => 'Optics0/0/0/5')),
array('iosxr', array('ifDescr' => 'HundredGigE0/0/0/19', 'ifName' => 'HundredGigE0/0/0/19', 'ifAlias' => ''),
array('port_label' => 'HundredGigE0/0/0/19', 'port_label_num' => '0/0/0/19', 'port_label_base' => 'HundredGigE', 'port_label_short' => 'Hu0/0/0/19')),
array('cisco-fxos', array('ifDescr' => 'Adaptive Security Appliance \'Ethernet1/13', 'ifName' => 'Adaptive Security Appliance \'Ethernet1/13\' interface', 'ifAlias' => ''),
array('port_label' => 'Ethernet1/13', 'port_label_num' => '1/13', 'port_label_base' => 'Ethernet', 'port_label_short' => 'Et1/13')),
array('cisco-fxos', array('ifDescr' => 'Adaptive Security Appliance \'Port-Channel13\' interface', 'ifName' => 'Adaptive Security Appliance \'Port-Channel13\' interface', 'ifAlias' => ''),
array('port_label' => 'Port-Channel13', 'port_label_num' => '13', 'port_label_base' => 'Port-Channel', 'port_label_short' => 'Po13')),
array('nxos', array('ifDescr' => '', 'ifName' => 'Ethernet1/49.2', 'ifAlias' => ''),
array('port_label' => 'Ethernet1/49.2', 'port_label_num' => '1/49.2', 'port_label_base' => 'Ethernet', 'port_label_short' => 'Et1/49.2')),
array('junos', array('ifDescr' => 'ge-4/1/0.29', 'ifName' => 'ge-4/1/0.29', 'ifAlias' => 'Cust: Europool DIA'),
array('port_label' => 'ge-4/1/0.29', 'port_label_num' => '4/1/0.29', 'port_label_base' => 'ge-', 'port_label_short' => 'ge-4/1/0.29')),
array('junos', array('ifDescr' => 'reth3.0', 'ifName' => 'reth3.0', 'ifAlias' => ''),
array('port_label' => 'reth3.0', 'port_label_num' => '3.0', 'port_label_base' => 'reth', 'port_label_short' => 'reth3.0')),
array('nos', array('ifDescr' => 'TenGigabitEthernet 122/0/41', 'ifName' => 'TenGigabitEthernet 122/0/41', 'ifAlias' => ''),
array('port_label' => 'TenGigabitEthernet 122/0/41', 'port_label_num' => '122/0/41', 'port_label_base' => 'TenGigabitEthernet ', 'port_label_short' => 'Te 122/0/41')),
array('nos', array('ifDescr' => 'FortyGigabitEthernet 122/0/49', 'ifName' => 'FortyGigabitEthernet 122/0/49', 'ifAlias' => ''),
array('port_label' => 'FortyGigabitEthernet 122/0/49', 'port_label_num' => '122/0/49', 'port_label_base' => 'FortyGigabitEthernet ', 'port_label_short' => 'Fo 122/0/49')),
array('dnos', array('ifDescr' => 'fortyGigE 0/37', 'ifName' => 'fortyGigE 0/37', 'ifAlias' => ''),
array('port_label' => 'FortyGigE 0/37', 'port_label_num' => '0/37', 'port_label_base' => 'FortyGigE ', 'port_label_short' => 'Fo 0/37')),
array('dnos', array('ifDescr' => 'ManagementEthernet 0/0', 'ifName' => 'ManagementEthernet 0/0', 'ifAlias' => ''),
array('port_label' => 'ManagementEthernet 0/0', 'port_label_num' => '0/0', 'port_label_base' => 'ManagementEthernet ', 'port_label_short' => 'Mgmt 0/0')),
array('fsos', array('ifDescr' => 'eth-0-10', 'ifName' => 'eth-0-10', 'ifAlias' => ''),
array('port_label' => 'eth-0-10', 'port_label_num' => '0-10', 'port_label_base' => 'eth-', 'port_label_short' => 'eth-0-10')),
array('vrp', array('ifDescr' => '40GE4/0/6', 'ifName' => '40GE4/0/6', 'ifAlias' => ''),
array('port_label' => '40GE4/0/6', 'port_label_num' => '4/0/6', 'port_label_base' => '40GE', 'port_label_short' => '40GE4/0/6')),
array('vrp', array('ifDescr' => 'XGigabitEthernet5/0/14', 'ifName' => 'XGigabitEthernet5/0/14', 'ifAlias' => ''),
array('port_label' => 'XGigabitEthernet5/0/14', 'port_label_num' => '5/0/14', 'port_label_base' => 'XGigabitEthernet', 'port_label_short' => 'XGi5/0/14')),
array('routeros', array('ifDescr' => 'Core: sfp-sfpplus1- Trunk to 6509', 'ifName' => 'Core: sfp-sfpplus1- Trunk to 6509', 'ifAlias' => ''),
array('port_label' => 'Core: sfp-sfpplus1- Trunk to 6509', 'port_label_num' => '', 'port_label_base' => 'Core: sfp-sfpplus1- Trunk to 6509', 'port_label_short' => 'Core: sfp-sfpplus1- Trunk to 6509')),
array('linux', array('ifDescr' => 'lo', 'ifName' => 'lo', 'ifAlias' => ''),
array('port_label' => 'lo', 'port_label_num' => '', 'port_label_base' => 'lo', 'port_label_short' => 'lo')),
array('linux', array('ifDescr' => 'Red Hat, Inc Device 0001', 'ifName' => 'eth0', 'ifAlias' => ''),
array('port_label' => 'eth0', 'port_label_num' => '0', 'port_label_base' => 'eth', 'port_label_short' => 'eth0')),
array('linux', array('ifDescr' => 'eth0.101', 'ifName' => 'eth0.101', 'ifAlias' => ''),
array('port_label' => 'eth0.101', 'port_label_num' => '0.101', 'port_label_base' => 'eth', 'port_label_short' => 'eth0.101')),
// port_label os definitions
array('vmware', array('ifDescr' => 'Device vmnic7 at 08:00.1 bnx2', 'ifName' => '', 'ifAlias' => ''),
array('port_label' => 'vmnic7', 'port_label_num' => '7', 'port_label_base' => 'vmnic', 'port_label_short' => 'vmnic7')),
array('vmware', array('ifDescr' => 'Traditional Virtual VMware switch: vSwitch0', 'ifName' => 'vSwitch0', 'ifAlias' => ''),
array('port_label' => 'vSwitch0', 'port_label_num' => '0', 'port_label_base' => 'vSwitch', 'port_label_short' => 'vSwitch0')),
array('vmware', array('ifDescr' => 'Virtual interface: vmk2 on vswitch vSwitchISCSI portgroup: iSCSI0', 'ifName' => 'vmk2', 'ifAlias' => ''),
array('port_label' => 'vmk2', 'port_label_num' => '2', 'port_label_base' => 'vmk', 'port_label_short' => 'vmk2')),
array('vmware', array('ifDescr' => 'Link Aggregation VM_iSCSI on switch: vSwitchISCSI, load balancing algorithm: source port id hash', 'ifName' => '', 'ifAlias' => ''),
array('port_label' => 'Link Aggregation VM_iSCSI', 'port_label_num' => NULL, 'port_label_base' => 'Link Aggregation VM_iSCSI', 'port_label_short' => 'Lagg VM_iSCSI')),
array('aix', array('ifDescr' => 'en0; Product: 2-Port 10/100/1000 Base-TX PCI-X Adapter Manufacturer: not available! Part Number: not available! FRU Number: not available!', 'ifName' => '', 'ifAlias' => ''),
array('port_label' => 'en0', 'port_label_num' => '0', 'port_label_base' => 'en', 'port_label_short' => 'en0')),
array('cisco-altiga', array('ifDescr' => 'DEC 21143A PCI Fast Ethernet', 'ifName' => '', 'ifAlias' => ''), // ++ ifIndex
array('port_label' => 'Fast Ethernet5', 'port_label_num' => '5', 'port_label_base' => 'Fast Ethernet', 'port_label_short' => 'Fa5')),
array('deltaups', array('ifDescr' => 'eth0............', 'ifName' => '', 'ifAlias' => ''),
array('port_label' => 'eth0', 'port_label_num' => '0', 'port_label_base' => 'eth', 'port_label_short' => 'eth0')),
array('netapp', array('ifDescr' => 'e0a'),
array('port_label' => 'e0a', 'port_label_num' => '0a', 'port_label_base' => 'e', 'port_label_short' => 'e0a')),
array('netapp', array('ifDescr' => 'vega-01:MGMT_PORT_ONLY e0M'),
array('port_label' => 'vega-01:MGMT_PORT_ONLY e0M', 'port_label_num' => '0M', 'port_label_base' => 'vega-01:MGMT_PORT_ONLY e', 'port_label_short' => 'vega-01:MGMT_PORT_ONLY e0M')),
array('speedtouch', array('ifDescr' => 'Some2thomson', 'ifName' => '', 'ifAlias' => ''),
array('port_label' => 'Some2', 'port_label_num' => '2', 'port_label_base' => 'Some', 'port_label_short' => 'Some2')),
array('mrvos', array('ifDescr' => 'Port 2 - ETH10/100/1000'),
array('port_label' => 'Port 2', 'port_label_num' => '2', 'port_label_base' => 'Port ', 'port_label_short' => 'Port 2')),
array('zxr10', array('ifDescr' => 'ZXR10 2928-SI 100BaseT port 23', 'ifName' => '', 'ifAlias' => ''),
array('port_label' => '100BaseT port 23', 'port_label_num' => '23', 'port_label_base' => '100BaseT port ', 'port_label_short' => 'port 23')),
array('extreme-ers', array('ifDescr' => 'Nortel Ethernet Routing Switch 5650TD Module - Port 36'),
array('port_label' => 'Port 36', 'port_label_num' => '36', 'port_label_base' => 'Port ', 'port_label_short' => 'Port 36')),
array('uniping', array('ifDescr' => 'UniPing Server Solution v3/SMS Enet Port'),
array('port_label' => 'Enet Port', 'port_label_num' => NULL, 'port_label_base' => 'Enet Port', 'port_label_short' => 'Enet Port')),
array('timos', array('ifDescr' => 'to-155KRD-1/1/23:1502, IP interface', 'ifName' => 'to-155KRD-1/1/23:1502', 'ifAlias' => ''),
array('port_label' => 'to-155KRD-1/1/23:1502', 'port_label_num' => '1/1/23:1502', 'port_label_base' => 'to-155KRD-', 'port_label_short' => 'to-155KRD-1/1/23:1502', 'ifAlias' => '')),
array('timos', array('ifDescr' => '1/1/26, 10-Gig Ethernet, Link to MDR-AGG-SW01 xe-0/0/4', 'ifName' => '1/1/26', 'ifAlias' => ''),
array('port_label' => '1/1/26', 'port_label_num' => '1/1/26', 'port_label_base' => '', 'port_label_short' => '1/1/26', 'ifAlias' => 'Link to MDR-AGG-SW01 xe-0/0/4')),
array('timos', array('ifDescr' => 'lag-13, LAG Group, LAG to 7750 port 1/2/3', 'ifName' => 'lag-13', 'ifAlias' => ''),
array('port_label' => 'lag-13', 'port_label_num' => '13', 'port_label_base' => 'lag-', 'port_label_short' => 'lag-13', 'ifAlias' => 'LAG to 7750 port 1/2/3')),
array('timos', array('ifDescr' => '5/1/lns-net, IP interface, "Broadband"', 'ifName' => '5/1/lns-net', 'ifAlias' => ''),
array('port_label' => '5/1/lns-net', 'port_label_num' => '5/1/lns-net', 'port_label_base' => '', 'port_label_short' => '5/1/lns-net', 'ifAlias' => 'Broadband')),
array('timos', array('ifDescr' => '_tmnx_nat-network_7/1, IP interface', 'ifName' => '_tmnx_nat-network_7/1', 'ifAlias' => ''),
array('port_label' => '_tmnx_nat-network_7/1', 'port_label_num' => '7/1', 'port_label_base' => '_tmnx_nat-network_', 'port_label_short' => '_tmnx_nat-network_7/1', 'ifAlias' => '')),
array('timos', array('ifDescr' => 'pw-24100, PW Port, "STRELA_TAISHET_EQM_MON_SVID240"', 'ifName' => 'pw-24100', 'ifAlias' => ''),
array('port_label' => 'pw-24100', 'port_label_num' => '24100', 'port_label_base' => 'pw-', 'port_label_short' => 'pw-24100', 'ifAlias' => 'STRELA_TAISHET_EQM_MON_SVID240')),
array('ekinops-360', array('ifDescr' => 'EKINOPS/C200/6/PM10010MP/Line(ROV-VOR-194,2)', 'ifName' => 'EKINOPS/C200/6/PM10010MP/Line(ROV-VOR-194,2)', 'ifAlias' => ''),
array('port_label' => '6/PM10010MP/Line', 'port_label_num' => '', 'port_label_base' => '6/PM10010MP/Line', 'port_label_short' => '6/PM10010MP/Line', 'ifAlias' => 'ROV-VOR-194,2')),
array('ekinops-360', array('ifDescr' => 'EKINOPS/C200HC/1/PM_10010MP/S1-Client1(PORT_Number 1 )', 'ifName' => 'EKINOPS/C200HC/1/PM_10010MP/S1-Client1(PORT_Number 1 )', 'ifAlias' => ''),
array('port_label' => '1/PM_10010MP/S1-Client1', 'port_label_num' => '1-Client1', 'port_label_base' => '1/PM_10010MP/S', 'port_label_short' => '1/PM_10010MP/S1-Client1', 'ifAlias' => 'PORT_Number 1')),
array('ekinops-360', array('ifDescr' => 'EKINOPS/C200/6/PM10010MP/S4-Client4()', 'ifName' => 'EKINOPS/C200/6/PM10010MP/S4-Client4()', 'ifAlias' => ''),
array('port_label' => '6/PM10010MP/S4-Client4', 'port_label_num' => '4-Client4', 'port_label_base' => '6/PM10010MP/S', 'port_label_short' => '6/PM10010MP/S4-Client4', 'ifAlias' => '')),
array('ekinops-360', array('ifDescr' => 'EKINOPS/C200/1/MGNT/FE_3', 'ifName' => 'EKINOPS/C200/1/MGNT/FE_3', 'ifAlias' => ''),
array('port_label' => '1/MGNT/FE_3', 'port_label_num' => '3', 'port_label_base' => '1/MGNT/FE_', 'port_label_short' => '1/MGNT/FE_3', 'ifAlias' => '')),
array('ekinops-360', array('ifDescr' => 'EKINOPS/C200/1/MGNT/GbE_RJ45#1', 'ifName' => 'EKINOPS/C200/1/MGNT/GbE_RJ45#1', 'ifAlias' => ''),
array('port_label' => '1/MGNT/GbE_RJ45#1', 'port_label_num' => '1', 'port_label_base' => '1/MGNT/GbE_RJ45#', 'port_label_short' => '1/MGNT/GbE_RJ45#1', 'ifAlias' => '')),
// ifType_ifDescr
array('liebert', array('ifDescr' => '', 'ifType' => 'softwareLoopback'), // ++ ifType, ifIndex
array('port_label' => 'Loopback 5', 'port_label_num' => '5', 'port_label_base' => 'Loopback ', 'port_label_short' => 'Lo 5')),
array('liebert', array('ifDescr' => '', 'ifType' => 'ethernetCsmacd'), // ++ ifType, ifIndex
array('port_label' => 'Ethernet 5', 'port_label_num' => '5', 'port_label_base' => 'Ethernet ', 'port_label_short' => 'Et 5')),
array('aos', array('ifDescr' => 'Alcatel-Lucent 1/10', 'ifName' => '', 'ifAlias' => ''), // -- ifName
array('port_label' => '1/10', 'port_label_num' => '1/10', 'port_label_base' => '', 'port_label_short' => '1/10')),
// ifname
array('aos', array('ifDescr' => 'Alcatel-Lucent 1/10', 'ifName' => '1/10', 'ifAlias' => ''),
array('port_label' => '1/10', 'port_label_num' => '1/10', 'port_label_base' => '', 'port_label_short' => '1/10')),
array('aos', array('ifDescr' => 'Alcatel-Lucent Stacking Port 1/StackA', 'ifName' => 'Stacking Port 1/StackA', 'ifAlias' => ''),
array('port_label' => 'Stacking Port 1/StackA', 'port_label_num' => '1/StackA', 'port_label_base' => 'Stacking Port ', 'port_label_short' => 'Stacking 1/StackA')),
array('aosw', array('ifDescr' => '802.1Q VLAN', 'ifName' => 'vlan 4095', 'ifAlias' => ''),
array('port_label' => 'Vlan 4095', 'port_label_num' => '4095', 'port_label_base' => 'Vlan ', 'port_label_short' => 'Vlan 4095')),
array('aosw', array('ifDescr' => 'SWITCH IP INTERFACE', 'ifName' => 'loop', 'ifAlias' => ''),
array('port_label' => 'loop', 'port_label_num' => NULL, 'port_label_base' => 'loop', 'port_label_short' => 'loop')),
array('xos', array('ifDescr' => 'X690-48x-2q-4c Port 10', 'ifName' => '1:10', 'ifAlias' => ''),
array('port_label' => '1:10', 'port_label_num' => '1:10', 'port_label_base' => '', 'port_label_short' => '1:10')),
array('hirschmann-switch', array('ifDescr' => 'Module: 1 Port: 3 - 10/100 Mbit TX', 'ifName' => '1/1/3', 'ifAlias' => ''),
array('port_label' => '1/1/3', 'port_label_num' => '1/1/3', 'port_label_base' => '', 'port_label_short' => '1/1/3')),
array('hirschmann-switch', array('ifDescr' => 'Module: 1 Port: 3 - 10/100 Mbit TX', 'ifName' => '', 'ifAlias' => ''),
array('port_label' => 'Module: 1 Port: 3', 'port_label_num' => '1 Port: 3', 'port_label_base' => 'Module: ', 'port_label_short' => 'Module: 1 Port: 3')),
array('hirschmann-switch', array('ifDescr' => 'CPU Interface for Module: 4 Port: 1', 'ifName' => 'CPU Interface: 1/4/1', 'ifAlias' => ''),
array('port_label' => 'CPU Interface: 1/4/1', 'port_label_num' => '1/4/1', 'port_label_base' => 'CPU Interface: ', 'port_label_short' => 'CPU Interface: 1/4/1')),
// hard coded rewrites
array('ciscosb', array('ifDescr' => '1', 'ifName' => '1', 'ifType' => 'propVirtual'), // ++ ifType
array('port_label' => 'Vlan1', 'port_label_num' => '1', 'port_label_base' => 'Vlan', 'port_label_short' => 'Vlan1')),
array('alliedwareplus', array('ifDescr' => 'apc-ups', 'ifName' => 'port1.0.21', 'ifType' => 'ethernetCsmacd'), // ifAlias in ifDescr
array('port_label' => 'port1.0.21', 'port_label_num' => '1.0.21', 'port_label_base' => 'port', 'port_label_short' => 'port1.0.21', 'ifAlias' => 'apc-ups')),
array('alliedwareplus', array('ifDescr' => '-', 'ifName' => 'port1.0.21', 'ifType' => 'ethernetCsmacd'), // ifAlias in ifDescr
array('port_label' => 'port1.0.21', 'port_label_num' => '1.0.21', 'port_label_base' => 'port', 'port_label_short' => 'port1.0.21', 'ifAlias' => '')),
// base/num port
array('generic', array('ifDescr' => 'GigaVUE-212 Port 8/48 (Network Port)'),
array('port_label' => 'GigaVUE-212 Port 8/48', 'port_label_num' => '8/48', 'port_label_base' => 'GigaVUE-212 Port ', 'port_label_short' => 'Port 8/48')),
array('generic', array('ifDescr' => 'rtif(172.20.30.46/28)'),
array('port_label' => 'rtif(172.20.30.46/28)', 'port_label_num' => '', 'port_label_base' => 'rtif(172.20.30.46/28)', 'port_label_short' => 'rtif(172.20.30.46/28)')),
array('generic', array('ifDescr' => '10/100 MBit Ethernet Switch Interface 6'),
array('port_label' => 'Ethernet 6', 'port_label_num' => '6', 'port_label_base' => 'Ethernet ', 'port_label_short' => 'Et 6')),
array('generic', array('ifDescr' => '1/1/1'),
array('port_label' => '1/1/1', 'port_label_num' => '1/1/1', 'port_label_base' => '', 'port_label_short' => '1/1/1')),
array('generic', array('ifDescr' => 'e1-0/2/0:13.0'),
array('port_label' => 'e1-0/2/0:13.0', 'port_label_num' => '0/2/0:13.0', 'port_label_base' => 'e1-', 'port_label_short' => 'e1-0/2/0:13.0')),
array('generic', array('ifDescr' => 'dwdm0/1/0/6'),
array('port_label' => 'dwdm0/1/0/6', 'port_label_num' => '0/1/0/6', 'port_label_base' => 'dwdm', 'port_label_short' => 'DWDM0/1/0/6')),
array('generic', array('ifDescr' => 'Cable8/1/4-upstream2'),
array('port_label' => 'Cable8/1/4-upstream2', 'port_label_num' => '8/1/4-upstream2', 'port_label_base' => 'Cable', 'port_label_short' => 'Ca8/1/4-upstream2')),
array('generic', array('ifDescr' => '16GigabitEthernet1/2/1'),
array('port_label' => '16GigabitEthernet1/2/1', 'port_label_num' => '1/2/1', 'port_label_base' => '16GigabitEthernet', 'port_label_short' => '16Gi1/2/1')),
array('generic', array('ifDescr' => 'cau4-0/2/0'),
array('port_label' => 'cau4-0/2/0', 'port_label_num' => '0/2/0', 'port_label_base' => 'cau4-', 'port_label_short' => 'cau4-0/2/0')),
array('generic', array('ifDescr' => 'dot11radio0/0'),
array('port_label' => 'dot11radio0/0', 'port_label_num' => '0/0', 'port_label_base' => 'dot11radio', 'port_label_short' => 'dot11radio0/0')),
array('generic', array('ifDescr' => '1000BaseTX Port 8/48 Name'),
array('port_label' => '1000BaseTX Port 8/48', 'port_label_num' => '8/48', 'port_label_base' => '1000BaseTX Port ', 'port_label_short' => 'Port 8/48')),
array('generic', array('ifDescr' => 'Backplane-GigabitEthernet0/3'),
array('port_label' => 'Backplane-GigabitEthernet0/3', 'port_label_num' => '0/3', 'port_label_base' => 'Backplane-GigabitEthernet', 'port_label_short' => 'Bpl-Gi0/3')),
array('generic', array('ifDescr' => 'FC port 0/19'),
array('port_label' => 'FC port 0/19', 'port_label_num' => '0/19', 'port_label_base' => 'FC port ', 'port_label_short' => 'FC port 0/19')),
array('generic', array('ifDescr' => 'GigabitEthernet0/1.ServiceInstance.206'),
array('port_label' => 'GigabitEthernet0/1.ServiceInstance.206', 'port_label_num' => '0/1.ServiceInstance.206', 'port_label_base' => 'GigabitEthernet', 'port_label_short' => 'Gi0/1.SI.206')),
array('generic', array('ifDescr' => 'Integrated-Cable7/0/0:0'),
array('port_label' => 'Integrated-Cable7/0/0:0', 'port_label_num' => '7/0/0:0', 'port_label_base' => 'Integrated-Cable', 'port_label_short' => 'In7/0/0:0')),
array('generic', array('ifDescr' => 'Logical Upstream Channel 1/0.0/0'),
array('port_label' => 'Logical Upstream Channel 1/0.0/0', 'port_label_num' => '1/0.0/0', 'port_label_base' => 'Logical Upstream Channel ', 'port_label_short' => 'Upstream 1/0.0/0')),
array('generic', array('ifDescr' => 'Video Downstream 0/0/38'),
array('port_label' => 'Video Downstream 0/0/38', 'port_label_num' => '0/0/38', 'port_label_base' => 'Video Downstream ', 'port_label_short' => 'Downstream 0/0/38')),
array('generic', array('ifDescr' => 'Downstream RF Port 4/7'),
array('port_label' => 'Downstream RF Port 4/7', 'port_label_num' => '4/7', 'port_label_base' => 'Downstream RF Port ', 'port_label_short' => 'Downstream 4/7')),
array('generic', array('ifDescr' => 'Slot0/1'),
array('port_label' => 'Slot0/1', 'port_label_num' => '0/1', 'port_label_base' => 'Slot', 'port_label_short' => 'Slot0/1')),
array('generic', array('ifDescr' => 'sonet_12/1'),
array('port_label' => 'sonet_12/1', 'port_label_num' => '12/1', 'port_label_base' => 'sonet_', 'port_label_short' => 'sonet_12/1')),
array('generic', array('ifDescr' => 'gigabitEthernet 1/0/24 : copper'),
array('port_label' => 'GigabitEthernet 1/0/24', 'port_label_num' => '1/0/24', 'port_label_base' => 'GigabitEthernet ', 'port_label_short' => 'Gi 1/0/24')),
array('generic', array('ifDescr' => '1:38'),
array('port_label' => '1:38', 'port_label_num' => '1:38', 'port_label_base' => '', 'port_label_short' => '1:38')),
array('generic', array('ifDescr' => '1/4/x24, mx480-xe-0-0-0'),
array('port_label' => '1/4/x24', 'port_label_num' => '1/4/x24', 'port_label_base' => '', 'port_label_short' => '1/4/x24')),
array('generic', array('ifDescr' => '1/4/x24'),
array('port_label' => '1/4/x24', 'port_label_num' => '1/4/x24', 'port_label_base' => '', 'port_label_short' => '1/4/x24')),
array('generic', array('ifDescr' => 'MMC-A s3 SW Port'),
array('port_label' => 'MMC-A s3', 'port_label_num' => '3', 'port_label_base' => 'MMC-A s', 'port_label_short' => 'MMC-A s3')),
array('generic', array('ifDescr' => 'Atm0_Physical_Interface'),
array('port_label' => 'Atm0', 'port_label_num' => '0', 'port_label_base' => 'Atm', 'port_label_short' => 'Atm0')),
array('generic', array('ifDescr' => 'wan1_phys'),
array('port_label' => 'wan1_phys', 'port_label_num' => '1_phys', 'port_label_base' => 'wan', 'port_label_short' => 'wan1_phys')),
array('generic', array('ifDescr' => 'fwbr101i0'),
array('port_label' => 'fwbr101i0', 'port_label_num' => '101i0', 'port_label_base' => 'fwbr', 'port_label_short' => 'fwbr101i0')),
array('generic', array('ifDescr' => 'lo0.32768'),
array('port_label' => 'lo0.32768', 'port_label_num' => '0.32768', 'port_label_base' => 'lo', 'port_label_short' => 'lo0.32768')),
array('generic', array('ifDescr' => 'Vlan.818'),
array('port_label' => 'Vlan.818', 'port_label_num' => '818', 'port_label_base' => 'Vlan.', 'port_label_short' => 'Vlan.818')),
array('generic', array('ifDescr' => 'Bundle-Ether1.1701'),
array('port_label' => 'Bundle-Ether1.1701', 'port_label_num' => '1.1701', 'port_label_base' => 'Bundle-Ether', 'port_label_short' => 'BE1.1701')),
array('generic', array('ifDescr' => 'BVI900'),
array('port_label' => 'BVI900', 'port_label_num' => '900', 'port_label_base' => 'BVI', 'port_label_short' => 'BVI900')),
array('generic', array('ifDescr' => 'A/1'),
array('port_label' => 'A/1', 'port_label_num' => '1', 'port_label_base' => 'A/', 'port_label_short' => 'A/1')),
array('generic', array('ifDescr' => 'e1'),
array('port_label' => 'e1', 'port_label_num' => '1', 'port_label_base' => 'e', 'port_label_short' => 'e1')),
array('generic', array('ifDescr' => 'CATV-MAC 1'),
array('port_label' => 'CATV-MAC 1', 'port_label_num' => '1', 'port_label_base' => 'CATV-MAC ', 'port_label_short' => 'CATV-MAC 1')),
array('generic', array('ifDescr' => 'Control Plane'),
array('port_label' => 'Control Plane', 'port_label_num' => NULL, 'port_label_base' => 'Control Plane', 'port_label_short' => 'Control Plane')),
array('generic', array('ifDescr' => 'port 3: Gigabit Fiber'), // TP-LINK
array('port_label' => 'port 3', 'port_label_num' => '3', 'port_label_base' => 'port ', 'port_label_short' => 'port 3')),
//array('generic', array('ifDescr' => 'microsens'),
// array('port_label' => 'microsens', 'port_label_num' => 'microsens', 'port_label_base' => '', 'port_label_short' => 'microsens')),
//array('generic', array('ifDescr' => 'microsens'),
// array('port_label' => 'microsens', 'port_label_num' => 'microsens', 'port_label_base' => '', 'port_label_short' => 'microsens')),
);
}
}
// EOF

557
tests/IncludesSnmpTest.php Normal file
View File

@ -0,0 +1,557 @@
<?php
$base_dir = realpath(__DIR__ . '/..');
$config['install_dir'] = $base_dir;
//define('OBS_DEBUG', 2);
include(__DIR__ . '/../includes/defaults.inc.php');
//include(dirname(__FILE__) . '/../config.php'); // Do not include user editable config here
include(__DIR__ . '/../includes/common.inc.php');
include(__DIR__ . '/../includes/definitions.inc.php');
//include(dirname(__FILE__) . '/data/test_definitions.inc.php'); // Fake definitions for testing
include(__DIR__ . '/../includes/functions.inc.php');
class IncludesSnmpTest extends \PHPUnit\Framework\TestCase
{
/**
* @dataProvider providerMibDirs
* @group mib
*/
public function testMibDirs($result, $value)
{
global $config;
$config['mib_dir'] = '/opt/observium/mibs';
$this->assertSame($result, mib_dirs($value));
}
public function providerMibDirs()
{
$results = array(
array('/opt/observium/mibs/rfc:/opt/observium/mibs/net-snmp', ''),
array('/opt/observium/mibs/rfc:/opt/observium/mibs/net-snmp', ['rfc', 'net-snmp']),
array('/opt/observium/mibs/rfc:/opt/observium/mibs/net-snmp:/opt/observium/mibs/cisco', 'cisco'),
array('/opt/observium/mibs/rfc:/opt/observium/mibs/net-snmp:/opt/observium/mibs/areca:/opt/observium/mibs/dell', ['areca', 'dell']),
array('/opt/observium/mibs/rfc:/opt/observium/mibs/net-snmp:/opt/observium/mibs/cisco:/opt/observium/mibs/dell:/opt/observium/mibs/broadcom:/opt/observium/mibs/netgear', array('cisco','dell', 'broadcom','netgear')),
array('/opt/observium/mibs/rfc:/opt/observium/mibs/net-snmp:/opt/observium/mibs/d-link:/opt/observium/mibs/d_link', array('d-link','d_link')),
array('/opt/observium/mibs/rfc:/opt/observium/mibs/net-snmp:/opt/observium/mibs/dell', array('inv@lid.name','dell')),
array('/opt/observium/mibs/rfc:/opt/observium/mibs/net-snmp:/opt/observium/mibs/banana', ['banana', '######']),
array('/opt/observium/mibs/rfc:/opt/observium/mibs/net-snmp:/opt/observium/mibs/banana', ['banana', 'banana']),
array('/opt/observium/mibs/rfc:/opt/observium/mibs/net-snmp:/opt/observium/mibs', 'mibs'),
);
return $results;
}
/**
* @dataProvider providerSnmpMib2MibDir
* @group mib
*/
public function testSnmpMib2MibDir($result, $mib)
{
global $config;
$config['mib_dir'] = '/opt/observium/mibs';
$this->assertSame($result, snmp_mib2mibdirs($mib));
// Test with alternative install/mib dirs
$config['mib_dir'] = '/appl/observium/mibs';
$dirs = str_replace('/opt/observium', '/appl/observium', $result);
//var_dump($dirs);
$this->assertSame($dirs, snmp_mib2mibdirs($mib));
}
public function providerSnmpMib2MibDir()
{
$results = array(
// Basic
array('/opt/observium/mibs/rfc:/opt/observium/mibs/net-snmp', 'HOST-RESOURCES-MIB'),
array('/opt/observium/mibs/rfc:/opt/observium/mibs/net-snmp', 'HOST-RESOURCES-MIB:HOST-RESOURCES-TYPES'),
array('/opt/observium/mibs/rfc:/opt/observium/mibs/net-snmp:/opt/observium/mibs/cisco', 'CISCO-RTTMON-MIB'),
array('/opt/observium/mibs/rfc:/opt/observium/mibs/net-snmp:/opt/observium/mibs/cisco', 'ENTITY-MIB:CISCO-ENTITY-VENDORTYPE-OID-MIB'),
array('/opt/observium/mibs/rfc:/opt/observium/mibs/net-snmp:/opt/observium/mibs/cisco:/opt/observium/mibs/broadcom', 'ENTITY-MIB:CISCO-ENTITY-VENDORTYPE-OID-MIB:FASTPATH-SWITCHING-MIB'),
// Unknown
//array('/opt/observium/mibs', 'HOST-RESOURCES'),
array('/opt/observium/mibs/rfc:/opt/observium/mibs/net-snmp', 'HOST-RESOURCES'),
);
return $results;
}
/**
* @dataProvider providerSnmpMibEntityVendortype
* @group mib
*/
public function testSnmpMibEntityVendortype($device, $mib, $result)
{
//global $config;
//
//$config['mib_dir'] = '/opt/observium/mibs';
$this->assertSame($result, snmp_mib_entity_vendortype($device, $mib));
}
public function providerSnmpMibEntityVendortype()
{
$device_linux = array('device_id' => 999, 'os' => 'linux');
$device_ios = array('device_id' => 998, 'os' => 'ios');
$device_vrp = array('device_id' => 997, 'os' => 'vrp');
$results = array(
// Basic, no additional mibs
array($device_linux, 'UCD-SNMP-MIB', 'UCD-SNMP-MIB'),
// Expand
array($device_linux, 'ENTITY-MIB', 'ENTITY-MIB:CISCO-ENTITY-VENDORTYPE-OID-MIB'),
array($device_ios, 'ENTITY-MIB', 'ENTITY-MIB:CISCO-ENTITY-VENDORTYPE-OID-MIB'),
array($device_vrp, 'ENTITY-MIB', 'ENTITY-MIB:HUAWEI-TC-MIB:HUAWEI-ENTITY-VENDORTYPE-MIB:H3C-ENTITY-VENDORTYPE-OID-MIB'),
);
return $results;
}
/**
* @dataProvider providerSnmpDewrap32bit
* @group numbers
*/
public function testSnmpDewrap32bit($result, $value)
{
$this->assertSame($result, snmp_dewrap32bit($value));
}
public function providerSnmpDewrap32bit()
{
return array(
array( 0, 0),
array( 65000, 65000),
array( '65000', '65000'),
array( '', ''),
array( 'some.0', 'some.0'),
array( FALSE, FALSE),
// Here wrong (negative) 32bit values
array(4294967289, '-7'),
array(4200000080, '-94967216'),
array(4200000066, -94967230),
);
}
/**
* @dataProvider providerSnmpSize64HighLow
* @group numbers
*/
public function testSnmpSize64HighLow($high, $low, $result)
{
$this->assertSame($result, snmp_size64_high_low($high, $low));
}
public function providerSnmpSize64HighLow()
{
return array(
array( 0, 0, 0),
array( 65000, 0, 279172874240000),
array( '65000', '65000', 279172874305000),
array( '0', '65000', 65000),
array(4294967295, 4294967295, 18446744073709551615), // Max 32/64bit value
);
}
/**
* @dataProvider providerSnmpFixNumeric
* @group numbers
*/
public function testSnmpFixNumeric($value, $result, $unit)
{
$this->assertSame($result, snmp_fix_numeric($value, $unit));
}
public function providerSnmpFixNumeric()
{
$array = array(
array( 0, 0),
array( '-65000', -65000),
array( '', ''),
array( 'Some.0', 'Some.0'),
array( FALSE, FALSE),
array(4200000066, 4200000066),
// Here numeric fixes
array('"-7"', -7),
array('+7', 7),
array(' 20,4', 20.4),
array('4,200000067', 4.200000067),
array('" -002.4336 dBm: Normal "', -2.4336),
array('"66.1 C (151.0 F)"', 66.1),
array('"36 C/96 F"', 36),
array('"8232W"', 8232),
array('"1628W (+/- 3.0%)"', 1628),
array('3.09(W-)', 3.09),
array('-26.02(A-)', -26.02),
array('-0.00(A-)', 0.0),
// Convert some passed units
array('512 MB', 512),
array('512 MB', 536870912.0, 'bytes'),
array('119.1 GB', 119.1),
array('119.1 GB', 127882651238.4, 'bytes'),
array('0x01', 1, 'hex'),
array('0x00', 0, 'hex'),
// More complex
array('CPU Temperature-Ctlr B: 58 C 136.40F', 58),
array('Capacitor Cell 1 Voltage-Ctlr B: 2.04V', 2.04),
array('Voltage 12V Rail Loc: left-PSU: 12.22V', 12.22),
array('Current 12V Rail Loc: right-PSU: 9.53A', 9.53),
array('Capacitor Charge-Ctlr B: 100%', 100),
array('Spinning at 5160 RPM', 5160),
);
foreach ($array as $index => $entry)
{
if (!isset($entry[2]))
{
$array[$index][] = NULL;
}
}
return $array;
}
/**
* @dataProvider providerSnmpFixString
* @group string
*/
/* Needed real data for test
public function testSnmpFixString($value, $result)
{
$this->assertSame($result, snmp_fix_string($value));
}
public function providerSnmpFixString()
{
return array(
array("This is a &#269;&#x5d0; test&#39; &#250;", "This is a čא test' ú"),
array("P<FA>lt stj<F3>rnst<F6><F0>", "Púlt stjórnstöð"),
);
}
*/
/**
* @dataProvider providerSnmpHexString
* @group string
*/
public function testSnmpHexString($value, $result)
{
$this->assertSame($result, snmp_hexstring($value));
}
public function providerSnmpHexString()
{
return array(
array("42 6C 61 63 6B 20 43 61 72 74 72 69 64 67 65 20", "Black Cartridge "),
array("42 6C 61 63 6B 20 43 61 72 74 72 69 64 67 65 20 38 31 58 20 48 50 20 43 46 32 38 31 58 00 ", "Black Cartridge 81X HP CF281X"),
array("Maintenance Kit HP 110V-F2G76A, 220V-F2G77A.", "Maintenance Kit HP 110V-F2G76A, 220V-F2G77A."),
array('4A 7D 34 3D', 'J}4='),
array('73 70 62 2D 6F 66 66 2D 67 77', 'spb-off-gw'),
array('32 35 00 ', '25'),
// UTF-8
array("44 61 74 61 3A 20 41 20 41 64 64 72 65 73 73 3A 20 32 32 35 2E 35 2E 31 2E 36 20 41 6C 69 61 73 3A 20 D0 94 D1 80 D0 B0 D0 B9 D0 B2 20 62 75 66 66 65 72 20 61 64 64 72 65 73 73 20 63 68 61 6E 67 65 64 20 31 31 30 34", 'Data: A Address: 225.5.1.6 Alias: Драйв buffer address changed 1104'),
array("C3 9C 62 65 72 74 72 61 67 75 6E 67 73 77 61 6C 7A 65 2C 20 50 4E 20 31 31 35 52 30 30 31 32 36", "Übertragungswalze, PN 115R00126"),
// Multiline string
array("67 6F 6F 67 6C 65 2E 73 65 00 6E 61 6D 65 2D 73 65 72 76 65 72 00 31 37 32 2E 31 37 2E 32 30 34 2E 31 30 00", "google.se\nname-server\n172.17.204.10"),
//Incorrect HEX strings
array('496E707574203100', '496E707574203100'), // HEX string without spaces (not SNMP HEX STRING)
array('49 6E 70 75 74 20 31 0', '49 6E 70 75 74 20 31 0'),
array('Simple String', 'Simple String'),
array('49 6E 70 75 74 20 31 0R ', '49 6E 70 75 74 20 31 0R '),
// 2char strings
array('10', '10'), // string
array('10 ', hex2str('10', '')), // hex
array('99', '99'), // string
array('99 ', hex2str('99', '')), // hex
array('A1', 'A1'), // string
array('A1 ', hex2str('A1', '')), // hex
array('B3', 'B3'), // string
array('B3 ', hex2str('B3', '')), // hex
array('FF', 'FF'), // string
);
}
/**
* @dataProvider providerSnmpStringToOid
* @group index
*/
public function testSnmpStringToOid($value, $result)
{
$this->assertSame($result, snmp_string_to_oid($value));
}
/**
* @dataProvider providerSnmpStringToOid
* @group index
*/
public function testSnmpOidToString($result, $value)
{
$this->assertSame((string)$result, snmp_oid_to_string($value));
}
public function providerSnmpStringToOid()
{
return array(
array( '', '0'),
array( ' ', '1.32'),
array( 0, '1.48'),
array( '-65000', '6.45.54.53.48.48.48'),
array( 'Some.0', '6.83.111.109.101.46.48'),
array( 'Observium', '9.79.98.115.101.114.118.105.117.109'),
array('Observium Great Again', '21.79.98.115.101.114.118.105.117.109.32.71.114.101.97.116.32.65.103.97.105.110'),
);
}
/**
* @dataProvider providerSnmpParseLine
* @group index
*/
public function testSnmpParseLine($flags, $value, $result)
{
$this->assertSame($result, snmp_parse_line($value, $flags));
}
public function providerSnmpParseLine()
{
$flags = OBS_SNMP_ALL;
return array(
array($flags,
'jnxVpnPwLocalSiteId.l2Circuit."ge-0/1/1.0".621 = "some"',
array('oid' => 'jnxVpnPwLocalSiteId.l2Circuit."ge-0/1/1.0".621',
'value' => 'some',
'oid_name' => 'jnxVpnPwLocalSiteId',
'index_parts' => array('l2Circuit', 'ge-0/1/1.0', '621'),
'index_count' => 3,
'index' => 'l2Circuit.ge-0/1/1.0.621',
),
),
array($flags | OBS_SNMP_INDEX_PARTS,
'jnxVpnPwLocalSiteId.l2Circuit."ge-0/1/1.0".621 = "some"',
array('oid' => 'jnxVpnPwLocalSiteId.l2Circuit."ge-0/1/1.0".621',
'value' => 'some',
'oid_name' => 'jnxVpnPwLocalSiteId',
'index_parts' => array('l2Circuit', 'ge-0/1/1.0', '621'),
'index_count' => 3,
'index' => 'l2Circuit->ge-0/1/1.0->621',
),
),
array($flags,
'vacmSecurityModel.0."wes" = xxx',
array('oid' => 'vacmSecurityModel.0."wes"',
'value' => 'xxx',
'oid_name' => 'vacmSecurityModel',
'index_parts' => array('0', 'wes'),
'index_count' => 2,
'index' => '0.wes',
),
),
array($flags,
'nodeUuid.\'WSLNetapp02-01\' = d924dfcf-418e-11eb-91eb-d039ea255860',
array('oid' => 'nodeUuid.\'WSLNetapp02-01\'',
'value' => 'd924dfcf-418e-11eb-91eb-d039ea255860',
'oid_name' => 'nodeUuid',
'index_parts' => array('WSLNetapp02-01'),
'index_count' => 1,
'index' => 'WSLNetapp02-01',
),
),
array($flags,
'vacmSecurityModel.0.3.119.101.115 = xxx',
array('oid' => 'vacmSecurityModel.0.3.119.101.115',
'value' => 'xxx',
'oid_name' => 'vacmSecurityModel',
'index_parts' => array('0', '3', '119', '101', '115'),
'index_count' => 5,
'index' => '0.3.119.101.115',
),
),
array($flags,
'jnxFWCounterDisplayName."__flowspec_default_inet__"."0/0,*,proto=17,port=445".counter = "0/0,*,proto=17,port=445"',
array('oid' => 'jnxFWCounterDisplayName."__flowspec_default_inet__"."0/0,*,proto=17,port=445".counter',
'value' => '0/0,*,proto=17,port=445',
'oid_name' => 'jnxFWCounterDisplayName',
'index_parts' => array('__flowspec_default_inet__', '0/0,*,proto=17,port=445', 'counter'),
'index_count' => 3,
'index' => '__flowspec_default_inet__.0/0,*,proto=17,port=445.counter',
),
),
array($flags,
'jnxFWCounterDisplayName."__flowspec_default_inet__"."205.213.5.242,*,proto=17,port=123".counter = "205.213.5.242,*,proto=17,port=123"',
array('oid' => 'jnxFWCounterDisplayName."__flowspec_default_inet__"."205.213.5.242,*,proto=17,port=123".counter',
'value' => '205.213.5.242,*,proto=17,port=123',
'oid_name' => 'jnxFWCounterDisplayName',
'index_parts' => array('__flowspec_default_inet__', '205.213.5.242,*,proto=17,port=123', 'counter'),
'index_count' => 3,
'index' => '__flowspec_default_inet__.205.213.5.242,*,proto=17,port=123.counter',
),
),
array($flags | OBS_SNMP_CONCAT,
'lldpRemChassisId.0.71.31591 = "08 2E 5F 17 E7 71 "',
array('oid' => 'lldpRemChassisId.0.71.31591',
'value' => '08 2E 5F 17 E7 71 ',
'oid_name' => 'lldpRemChassisId',
'index_parts' => array('0', '71', '31591'),
'index_count' => 3,
'index' => '0.71.31591',
),
),
array($flags | OBS_SNMP_TABLE,
'ipv6RouteIfIndex[3ffe:100:ff00:0:0:0:0:0][64][1] = 2',
array('oid' => 'ipv6RouteIfIndex[3ffe:100:ff00:0:0:0:0:0][64][1]',
'value' => '2',
'oid_name' => 'ipv6RouteIfIndex',
'index_parts' => array('3ffe:100:ff00:0:0:0:0:0', '64', '1'),
'index_count' => 3,
'index' => '3ffe:100:ff00:0:0:0:0:0.64.1',
),
),
array($flags | OBS_SNMP_TABLE,
'ipv6RouteIfIndex[3ffe:100:ff00:0:0:0:0:0][64].1 = 2',
array('oid' => 'ipv6RouteIfIndex[3ffe:100:ff00:0:0:0:0:0][64].1',
'value' => '2',
'oid_name' => 'ipv6RouteIfIndex',
'index_parts' => array('3ffe:100:ff00:0:0:0:0:0', '64', '1'),
'index_count' => 3,
'index' => '3ffe:100:ff00:0:0:0:0:0.64.1',
),
),
array($flags | OBS_SNMP_TABLE,
'wcAccessPointMac[6:20:c:c8:39:b].96 = 20:c:c8:39:b:60',
array('oid' => 'wcAccessPointMac[6:20:c:c8:39:b].96',
'value' => '20:c:c8:39:b:60',
'oid_name' => 'wcAccessPointMac',
'index_parts' => array('6:20:c:c8:39:b', '96'),
'index_count' => 2,
'index' => '6:20:c:c8:39:b.96',
),
),
array($flags | OBS_SNMP_TABLE,
'wcAccessPointMac[6:20:c:c8:39:b].96.1 = 20:c:c8:39:b:60',
array('oid' => 'wcAccessPointMac[6:20:c:c8:39:b].96.1',
'value' => '20:c:c8:39:b:60',
'oid_name' => 'wcAccessPointMac',
'index_parts' => array('6:20:c:c8:39:b', '96', '1'),
'index_count' => 3,
'index' => '6:20:c:c8:39:b.96.1',
),
),
array($flags | OBS_SNMP_TABLE,
'wcAccessPointMac[6:20:c:c8:39:b].96."qkd dj" = 20:c:c8:39:b:60',
array('oid' => 'wcAccessPointMac[6:20:c:c8:39:b].96."qkd dj"',
'value' => '20:c:c8:39:b:60',
'oid_name' => 'wcAccessPointMac',
'index_parts' => array('6:20:c:c8:39:b', '96', 'qkd dj'),
'index_count' => 3,
'index' => '6:20:c:c8:39:b.96.qkd dj',
),
),
array($flags | OBS_SNMP_TABLE | OBS_SNMP_INDEX_PARTS,
'rlIpAddressPrefixLength[ipv6z]["fe:80:00:00:00:00:00:00:86:78:ac:ff:fe:a3:3f:49%100000"] = 64',
array('oid' => 'rlIpAddressPrefixLength[ipv6z]["fe:80:00:00:00:00:00:00:86:78:ac:ff:fe:a3:3f:49%100000"]',
'value' => '64',
'oid_name' => 'rlIpAddressPrefixLength',
'index_parts' => array('ipv6z', 'fe:80:00:00:00:00:00:00:86:78:ac:ff:fe:a3:3f:49%100000'),
'index_count' => 2,
'index' => 'ipv6z->fe:80:00:00:00:00:00:00:86:78:ac:ff:fe:a3:3f:49%100000',
),
),
array($flags | OBS_SNMP_TABLE | OBS_SNMP_INDEX_PARTS,
'wcAccessPointMac[6:20:c:c8:39:b].96."qkd dj" = 20:c:c8:39:b:60',
array('oid' => 'wcAccessPointMac[6:20:c:c8:39:b].96."qkd dj"',
'value' => '20:c:c8:39:b:60',
'oid_name' => 'wcAccessPointMac',
'index_parts' => array('6:20:c:c8:39:b', '96', 'qkd dj'),
'index_count' => 3,
'index' => '6:20:c:c8:39:b->96->qkd dj',
),
),
array($flags | OBS_SNMP_NUMERIC,
'.1.3.6.1.2.1.1.3.0 = 15:09:27.63',
array('oid' => '.1.3.6.1.2.1.1.3.0',
'value' => '15:09:27.63',
'index_count' => 1,
'index' => '.1.3.6.1.2.1.1.3.0',
),
),
// Not used, but allowed:
array($flags,
'vacmSecurityModel.0.\"wes\" = xxx', // not used
array('oid' => 'vacmSecurityModel.0.\"wes\"',
'value' => 'xxx',
'oid_name' => 'vacmSecurityModel',
'index_parts' => array('0', '\"wes\"'),
'index_count' => 2,
'index' => '0.\"wes\"',
),
),
// WARNING for cleaners, here trailing spaces!!!
array($flags,
'vacmSecurityModel.0."wes" = 00 66
AA BB ', // not used
array('oid' => 'vacmSecurityModel.0."wes"',
'value' => '00 66
AA BB',
'oid_name' => 'vacmSecurityModel',
'index_parts' => array('0', 'wes'),
'index_count' => 2,
'index' => '0.wes',
),
),
// Empty, wrong
array($flags,
'jnxVpnPwLocalSiteId.l2Circuit."ge-0/1/1.0".621', // Complete not exist value part
array('oid' => 'jnxVpnPwLocalSiteId.l2Circuit."ge-0/1/1.0".621',
'value' => NULL,
'oid_name' => 'jnxVpnPwLocalSiteId',
'index_parts' => array('l2Circuit', 'ge-0/1/1.0', '621'),
'index_count' => 3,
'index' => 'l2Circuit.ge-0/1/1.0.621',
),
),
array($flags,
'jnxVpnPwLocalSiteId.l2Circuit."ge-0/1/1.0".621 = ', // Value is string ''
array('oid' => 'jnxVpnPwLocalSiteId.l2Circuit."ge-0/1/1.0".621',
'value' => '',
'oid_name' => 'jnxVpnPwLocalSiteId',
'index_parts' => array('l2Circuit', 'ge-0/1/1.0', '621'),
'index_count' => 3,
'index' => 'l2Circuit.ge-0/1/1.0.621',
),
),
array($flags, // Yah, numeric passed without OBS_SNMP_NUMERIC flag
'.1.3.6.1.2.1.1.3.0 = 15:09:27.63',
array('oid' => '.1.3.6.1.2.1.1.3.0',
'value' => '15:09:27.63',
'oid_name' => '',
'index_parts' => array('1', '3', '6', '1', '2', '1', '1', '3', '0'),
'index_count' => 9,
'index' => '1.3.6.1.2.1.1.3.0',
),
),
array($flags | OBS_SNMP_NUMERIC,
' = 15:09:27.63',
array('oid' => '',
'value' => '15:09:27.63',
'index_count' => 0,
'index' => '',
),
),
array($flags,
'',
array('oid' => '',
'value' => NULL,
'oid_name' => '',
'index_parts' => array(),
'index_count' => 0,
'index' => '',
),
),
);
}
}
// EOF

View File

@ -0,0 +1,661 @@
<?php
//define('OBS_DEBUG', 1);
include(__DIR__ . '/../includes/sql-config.inc.php');
include(__DIR__ . '../html/includes/functions.inc.php');
class IncludesSyslogTest extends \PHPUnit\Framework\TestCase {
/**
* @dataProvider providerProcessSyslogLine
* @group process
*/
public function testProcessSyslogLine($line, $result) {
// Create fake device array from syslog line
list($os) = explode('||', $line, 2);
$device = array('hostname' => $os, 'device_id' => crc32($os), 'os' => $os);
if (isset($GLOBALS['config']['os'][$os]['os_group'])) {
$device['os_group'] = $GLOBALS['config']['os'][$os]['os_group'];
}
//var_dump($GLOBALS['config']['os'][$os]);
// Override device cache for syslog processing:
$host = $device['hostname'];
$dev_cache = array();
$dev_cache[$host]['lastchecked'] = time();
$dev_cache[$host]['device_id'] = $device['device_id'];
$dev_cache[$host]['os'] = $device['os'];
if (isset($device['os_group'])) {
$dev_cache[$host]['os_group'] = $device['os_group'];
}
$GLOBALS['dev_cache'] = $dev_cache;
// Override config syslog filter
$GLOBALS['config']['syslog']['filter'] = array('TEST', 'derp');
if ($tmp = process_syslog_line($line))
{
// Just custom resort array
$entry = array();
foreach (array('facility', 'priority', 'level', 'tag', // array('host', 'facility', 'priority', 'level', 'tag',
'program', 'msg', 'msg_orig') as $key)
{
$entry[$key] = $tmp[$key];
}
} else {
$entry = $tmp; // FALSE positive
}
$this->assertSame($result, $entry);
}
public function providerProcessSyslogLine()
{
$result = array();
// Linux/Unix
$result[] = array('linux||9||6||6||CRON[3196]:||2018-03-13 06:25:01|| (root) CMD (test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.daily ))||CRON',
array('facility' => 'cron', 'priority' => '6', 'level' => '6',
'tag' => 'CRON[3196]', 'program' => 'CRON',
'msg' => '(root) CMD (test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.daily ))',
'msg_orig' => '(root) CMD (test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.daily ))',
));
$result[] = array('linux||4||6||6||sshd[10809]:||2018-03-19 15:28:47|| message repeated 2 times: [ Failed password for root from 221.194.44.211 port 49810 ssh2]||sshd',
array('facility' => 'auth', 'priority' => '6', 'level' => '6',
'tag' => 'sshd[10809]', 'program' => 'SSHD',
'msg' => 'Failed password for root from 221.194.44.211 port 49810 ssh2',
'msg_orig' => 'message repeated 2 times: [ Failed password for root from 221.194.44.211 port 49810 ssh2]',
));
$result[] = array('linux||5||6||6||rsyslogd0:||2018-03-14 06:28:18|| action \'action 18\' resumed (module \'builtin:ompipe\') [try http://www.rsyslog.com/e/0 ]||rsyslogd0',
array('facility' => 'syslog', 'priority' => '6', 'level' => '6',
'tag' => 'rsyslogd0', 'program' => 'RSYSLOGD',
'msg' => 'action \'action 18\' resumed (module \'builtin:ompipe\') [try http://www.rsyslog.com/e/0 ]',
'msg_orig' => 'action \'action 18\' resumed (module \'builtin:ompipe\') [try http://www.rsyslog.com/e/0 ]',
));
$result[] = array('linux||5||4||4||rsyslogd-2007:||2018-03-14 06:55:50|| action \'action 18\' suspended, next retry is Wed Mar 14 06:56:20 2018 [try http://www.rsyslog.com/e/2007 ]||rsyslogd-2007',
array('facility' => 'syslog', 'priority' => '4', 'level' => '4',
'tag' => 'rsyslogd-2007', 'program' => 'RSYSLOGD',
'msg' => 'action \'action 18\' suspended, next retry is Wed Mar 14 06:56:20 2018 [try http://www.rsyslog.com/e/2007 ]',
'msg_orig' => 'action \'action 18\' suspended, next retry is Wed Mar 14 06:56:20 2018 [try http://www.rsyslog.com/e/2007 ]',
));
$result[] = [ 'linux||9||5||5||run-parts(/etc/cron.hourly)[2654||2021-11-26 08:01:01|| starting 0anacron||run-parts(',
[ 'facility' => 'cron', 'priority' => '5', 'level' => '5',
'tag' => 'run-parts,/etc/cron.hourly', 'program' => '0ANACRON',
'msg' => 'starting 0anacron',
'msg_orig' => 'starting 0anacron', ]
];
$result[] = [ 'linux||3||6||6||fail2ban-client[20598]:||2018-06-07 14:36:03|| 2018-06-07 14:36:03,699 fail2ban.server [20601]: INFO Starting Fail2ban v0.9.3||fail2ban-client',
[ 'facility' => 'daemon', 'priority' => '6', 'level' => '6',
'tag' => 'client,INFO', 'program' => 'FAIL2BAN',
'msg' => 'Starting Fail2ban v0.9.3',
'msg_orig' => '2018-06-07 14:36:03,699 fail2ban.server [20601]: INFO Starting Fail2ban v0.9.3', ]
];
$result[] = [ 'linux||3||6||6||fail2ban-server:||2021-11-12 11:51:25|| Server ready||fail2ban-server',
[ 'facility' => 'daemon', 'priority' => '6', 'level' => '6',
'tag' => 'server', 'program' => 'FAIL2BAN',
'msg' => 'Server ready',
'msg_orig' => 'Server ready', ]
];
$result[] = [ 'linux||3||5||5||fail2ban.actions[4314]:||2021-11-26 11:15:57|| NOTICE [sshd] Unban 116.98.170.132||fail2ban.actions',
[ 'facility' => 'daemon', 'priority' => '5', 'level' => '5',
'tag' => 'actions,NOTICE', 'program' => 'FAIL2BAN',
'msg' => '[sshd] Unban 116.98.170.132',
'msg_orig' => 'NOTICE [sshd] Unban 116.98.170.132', ]
];
// from group definition
$result[] = array('linux||10||5||5||sshd[9071]:||2018-03-20 17:40:43|| PAM 2 more authentication failures; logname= uid=0 euid=0 tty=ssh ruser= rhost=221.194.47.243 user=root||sshd',
array('facility' => 'authpriv', 'priority' => '5', 'level' => '5',
'tag' => 'sshd[9071]', 'program' => 'SSHD',
'msg' => 'PAM 2 more authentication failures; logname= uid=0 euid=0 tty=ssh ruser= rhost=221.194.47.243 user=root',
'msg_orig' => 'PAM 2 more authentication failures; logname= uid=0 euid=0 tty=ssh ruser= rhost=221.194.47.243 user=root',
));
$result[] = array('linux||10||5||5||sshd[9071]:||2018-03-20 17:40:43|| pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=221.194.47.243 user=root||sshd',
array('facility' => 'authpriv', 'priority' => '5', 'level' => '5',
'tag' => 'sshd[9071],pam_unix,auth', 'program' => 'SSHD',
'msg' => 'pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=221.194.47.243 user=root',
'msg_orig' => 'pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=221.194.47.243 user=root',
));
$result[] = array('linux||10||5||5||sshd[9071]:||2018-03-20 17:40:43|| pam_krb5[sshd:auth]: authentication failure; logname=root uid=0 euid=0 tty=ssh ruser= rhost=123.213.132.231||sshd',
array('facility' => 'authpriv', 'priority' => '5', 'level' => '5',
'tag' => 'sshd[9071],pam_krb5,auth', 'program' => 'SSHD',
'msg' => 'pam_krb5[sshd:auth]: authentication failure; logname=root uid=0 euid=0 tty=ssh ruser= rhost=123.213.132.231',
'msg_orig' => 'pam_krb5[sshd:auth]: authentication failure; logname=root uid=0 euid=0 tty=ssh ruser= rhost=123.213.132.231',
));
$result[] = array('linux||10||5||5||sshd[9071]:||2018-03-20 17:40:43|| pam_krb5: authentication failure; logname=root uid=0 euid=0 tty=ssh ruser= rhost=123.213.132.231||sshd',
array('facility' => 'authpriv', 'priority' => '5', 'level' => '5',
'tag' => 'sshd[9071],pam_krb5', 'program' => 'SSHD',
'msg' => 'pam_krb5: authentication failure; logname=root uid=0 euid=0 tty=ssh ruser= rhost=123.213.132.231',
'msg_orig' => 'pam_krb5: authentication failure; logname=root uid=0 euid=0 tty=ssh ruser= rhost=123.213.132.231',
));
$result[] = array('freebsd||14||6||6||kernel:||2018-03-21 13:07:05|| Mar 21 13:07:05 somehost syslogd: exiting on signal 15||kernel',
array('facility' => 'console', 'priority' => '6', 'level' => '6',
'tag' => 'kernel', 'program' => 'KERNEL',
'msg' => 'somehost syslogd: exiting on signal 15',
'msg_orig' => 'Mar 21 13:07:05 somehost syslogd: exiting on signal 15',
));
$result[] = array('freebsd||9||6||6||/usr/sbin/cron[19422]:||2018-03-21 13:10:00|| (root) CMD (/usr/libexec/atrun)||',
array('facility' => 'cron', 'priority' => '6', 'level' => '6',
'tag' => 'cron[19422]', 'program' => 'CRON',
'msg' => '(root) CMD (/usr/libexec/atrun)',
'msg_orig' => '(root) CMD (/usr/libexec/atrun)',
));
$result[] = array('freebsd||3||6||6||transmission-daemon[56416]:||2018-03-21 14:53:11|| Сезон 1 Scrape error: Could not connect to tracker (announcer.c:1279) ||transmission-daemon',
array('facility' => 'daemon', 'priority' => '6', 'level' => '6',
'tag' => 'transmission-daemon[56416],announcer.c', 'program' => 'TRANSMISSION-DAEMON',
'msg' => 'Сезон 1 Scrape error: Could not connect to tracker (announcer.c:1279)',
'msg_orig' => 'Сезон 1 Scrape error: Could not connect to tracker (announcer.c:1279)',
));
$result[] = [ 'linux||3||5||5||dbus[523]:||2021-11-26 11:07:35|| [system] Activating service name=\'org.freedesktop.problems\' (using servicehelper)||dbus',
[ 'facility' => 'daemon', 'priority' => '5', 'level' => '5',
'tag' => 'dbus[523],system', 'program' => 'DBUS',
'msg' => '[system] Activating service name=\'org.freedesktop.problems\' (using servicehelper)',
'msg_orig' => '[system] Activating service name=\'org.freedesktop.problems\' (using servicehelper)', ]
];
// Another repeated message
$result[] = array('freebsd||1||4||4||message||2018-03-21 14:50:37|| repeated 2 times||message',
FALSE);
// Windows
$result[] = array('windows||3||3||3||Security-Auditing:||2018-03-17 15:53:43|| 4625: AUDIT_FAILURE An account failed to log on. Subject: Security ID: S-1-0-0 Account Name: - Account Domain: - Logon ID: 0x0 Logon Type: 3 Account For Which Logon Failed: Security ID: S-1-0-0 Account Name: ADMINISTRATOR Account Domain: Failure Information: Failure Reason: Unknown user name or bad password. Status: 0xc000006d Sub Status: 0xc000006a Process Information: Caller Process ID: 0x0 Caller Process Name: - Network Information: Workstation Name: Source Network Address: - Source Port: - Detailed Authentication Information: Logon Process: NtLmSsp Authentication Package: NTLM Transited Services: - Package Name (NTLM only): - Key Length: 0 This event is generated when a logon request fails. It is generated on the computer where access was attempted. The Subject fields indicate the account on the local system which requested the logon. This is most commonly a service such as the Server service, or a local process such as Winlogon.exe or Services.exe. The Logon Type field indicates the kind of logon that was requested. The most common types are 2 (interactive) and 3 (network). The Process Information fields indicate which account and process on the system requested the logon. The Network Information fields indicate where a remote logon request originated. Workstation name is not always available and may be left blank in some cases. The authentication information fields provide detailed information about this specific logon request. - Transited services indicate which intermediate services have participated in this logon request. - Package name indicates which sub-protocol was used among the NTLM protocols. - Key length indicates the length of the generated session key. This will be 0 if no session key was requested.||Security-Auditing',
array('facility' => 'daemon', 'priority' => '3', 'level' => '3',
'tag' => 'Security-Auditing', 'program' => 'SECURITY-AUDITING',
'msg' => '4625: AUDIT_FAILURE An account failed to log on. Subject: Security ID: S-1-0-0 Account Name: - Account Domain: - Logon ID: 0x0 Logon Type: 3 Account For Which Logon Failed: Security ID: S-1-0-0 Account Name: ADMINISTRATOR Account Domain: Failure Information: Failure Reason: Unknown user name or bad password. Status: 0xc000006d Sub Status: 0xc000006a Process Information: Caller Process ID: 0x0 Caller Process Name: - Network Information: Workstation Name: Source Network Address: - Source Port: - Detailed Authentication Information: Logon Process: NtLmSsp Authentication Package: NTLM Transited Services: - Package Name (NTLM only): - Key Length: 0 This event is generated when a logon request fails. It is generated on the computer where access was attempted. The Subject fields indicate the account on the local system which requested the logon. This is most commonly a service such as the Server service, or a local process such as Winlogon.exe or Services.exe. The Logon Type field indicates the kind of logon that was requested. The most common types are 2 (interactive) and 3 (network). The Process Information fields indicate which account and process on the system requested the logon. The Network Information fields indicate where a remote logon request originated. Workstation name is not always available and may be left blank in some cases. The authentication information fields provide detailed information about this specific logon request. - Transited services indicate which intermediate services have participated in this logon request. - Package name indicates which sub-protocol was used among the NTLM protocols. - Key length indicates the length of the generated session key. This will be 0 if no session key was requested.',
'msg_orig' => '4625: AUDIT_FAILURE An account failed to log on. Subject: Security ID: S-1-0-0 Account Name: - Account Domain: - Logon ID: 0x0 Logon Type: 3 Account For Which Logon Failed: Security ID: S-1-0-0 Account Name: ADMINISTRATOR Account Domain: Failure Information: Failure Reason: Unknown user name or bad password. Status: 0xc000006d Sub Status: 0xc000006a Process Information: Caller Process ID: 0x0 Caller Process Name: - Network Information: Workstation Name: Source Network Address: - Source Port: - Detailed Authentication Information: Logon Process: NtLmSsp Authentication Package: NTLM Transited Services: - Package Name (NTLM only): - Key Length: 0 This event is generated when a logon request fails. It is generated on the computer where access was attempted. The Subject fields indicate the account on the local system which requested the logon. This is most commonly a service such as the Server service, or a local process such as Winlogon.exe or Services.exe. The Logon Type field indicates the kind of logon that was requested. The most common types are 2 (interactive) and 3 (network). The Process Information fields indicate which account and process on the system requested the logon. The Network Information fields indicate where a remote logon request originated. Workstation name is not always available and may be left blank in some cases. The authentication information fields provide detailed information about this specific logon request. - Transited services indicate which intermediate services have participated in this logon request. - Package name indicates which sub-protocol was used among the NTLM protocols. - Key length indicates the length of the generated session key. This will be 0 if no session key was requested.',
));
// Cisco IOS
$result[] = array('ios||23||5||5||26644:||2013-11-08 07:19:24|| *Mar 1 18:48:50.483 UTC: %SYS-5-CONFIG_I: Configured from console by vty2 (10.34.195.36)||26644',
array('facility' => 'local7', 'priority' => '5', 'level' => '5',
'tag' => 'CONFIG_I', 'program' => 'SYS',
'msg' => 'Configured from console by vty2 (10.34.195.36)',
'msg_orig' => '*Mar 1 18:48:50.483 UTC: %SYS-5-CONFIG_I: Configured from console by vty2 (10.34.195.36)',
));
$result[] = array('ios||23||5||5||26644:||2013-11-08 07:19:24|| 00:00:48: %LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet2/0/1, changed state to down 2 (Switch-2)||26644',
array('facility' => 'local7', 'priority' => '5', 'level' => '5',
'tag' => 'UPDOWN', 'program' => 'LINEPROTO',
'msg' => 'Line protocol on Interface GigabitEthernet2/0/1, changed state to down 2 (Switch-2)',
'msg_orig' => '00:00:48: %LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet2/0/1, changed state to down 2 (Switch-2)',
));
// Unknown program and tag
$result[] = array('ios||23||7||7||12602:||2016-10-24 11:34:02|| Oct 24 11:34:01.275: VSTACK_ERR: ||12602',
array('facility' => 'local7', 'priority' => '7', 'level' => '7',
'tag' => 'debug', 'program' => 'DEBUG',
'msg' => 'VSTACK_ERR:',
'msg_orig' => 'Oct 24 11:34:01.275: VSTACK_ERR:',
));
$result[] = array('ios||23||7||7||12603:||2016-10-24 11:34:02|| smi_ibc_dl_handle_events : invalid message||12603',
array('facility' => 'local7', 'priority' => '7', 'level' => '7',
'tag' => 'debug', 'program' => 'DEBUG',
'msg' => 'smi_ibc_dl_handle_events : invalid message',
'msg_orig' => 'smi_ibc_dl_handle_events : invalid message',
));
$result[] = array('ios||23||7||7||12622:||2016-10-26 10:05:37|| Oct 26 10:05:36.301: Invalid packet (too small) length=0',
array('facility' => 'local7', 'priority' => '7', 'level' => '7',
'tag' => 'debug', 'program' => 'DEBUG',
'msg' => 'Invalid packet (too small) length=0',
'msg_orig' => 'Oct 26 10:05:36.301: Invalid packet (too small) length=0',
));
// Examples from real system
$result[] = array('ios||23||4||4||26644:||2013-11-08 07:19:24|| 033884: Nov 8 07:19:23.993: %FW-4-TCP_OoO_SEG: Dropping TCP Segment: seq:-1169729434 1500 bytes is out-of-order; expected seq:3124765814. Reason: TCP reassembly queue overflow - session 10.10.32.37:56316 to 93.186.239.142:80 on zone-pair Local->Internet class All_Inspection||26644',
array('facility' => 'local7', 'priority' => '4', 'level' => '4',
'tag' => 'TCP_OoO_SEG', 'program' => 'FW',
'msg' => 'Dropping TCP Segment: seq:-1169729434 1500 bytes is out-of-order; expected seq:3124765814. Reason: TCP reassembly queue overflow - session 10.10.32.37:56316 to 93.186.239.142:80 on zone-pair Local->Internet class All_Inspection',
'msg_orig' => '033884: Nov 8 07:19:23.993: %FW-4-TCP_OoO_SEG: Dropping TCP Segment: seq:-1169729434 1500 bytes is out-of-order; expected seq:3124765814. Reason: TCP reassembly queue overflow - session 10.10.32.37:56316 to 93.186.239.142:80 on zone-pair Local->Internet class All_Inspection',
));
$result[] = array('ios||23||5||5||1747:||2018-03-12 13:47:44|| 001743: *Apr 25 04:16:54.749: %SSH-5-SSH2_SESSION: SSH2 Session request from 10.12.0.251 (tty = 0) using crypto cipher \'3des-cbc\', hmac \'hmac-md5\' Succeeded||1747',
array('facility' => 'local7', 'priority' => '5', 'level' => '5',
'tag' => 'SSH2_SESSION', 'program' => 'SSH',
'msg' => 'SSH2 Session request from 10.12.0.251 (tty = 0) using crypto cipher \'3des-cbc\', hmac \'hmac-md5\' Succeeded',
'msg_orig' => '001743: *Apr 25 04:16:54.749: %SSH-5-SSH2_SESSION: SSH2 Session request from 10.12.0.251 (tty = 0) using crypto cipher \'3des-cbc\', hmac \'hmac-md5\' Succeeded',
));
$result[] = array('ios||23||5||5||908:||2018-03-12 13:45:15|| Mar 12 13:45:14.241: %SSH-5-SSH2_SESSION: SSH2 Session request from 10.10.10.10 (tty = 0) using crypto cipher \'3des-cbc\', hmac \'hmac-md5\' Succeeded||908',
array('facility' => 'local7', 'priority' => '5', 'level' => '5',
'tag' => 'SSH2_SESSION', 'program' => 'SSH',
'msg' => 'SSH2 Session request from 10.10.10.10 (tty = 0) using crypto cipher \'3des-cbc\', hmac \'hmac-md5\' Succeeded',
'msg_orig' => 'Mar 12 13:45:14.241: %SSH-5-SSH2_SESSION: SSH2 Session request from 10.10.10.10 (tty = 0) using crypto cipher \'3des-cbc\', hmac \'hmac-md5\' Succeeded',
));
$result[] = array('ios||23||5||5||2559:||2017-01-26 04:27:10|| 003174: Jan 26 04:27:09.174 MSK: %BGP-5-ADJCHANGE: neighbor 10.0.1.17 vpn vrf hostcomm-private Up ||2559',
array('facility' => 'local7', 'priority' => '5', 'level' => '5',
'tag' => 'ADJCHANGE', 'program' => 'BGP',
'msg' => 'neighbor 10.0.1.17 vpn vrf hostcomm-private Up',
'msg_orig' => '003174: Jan 26 04:27:09.174 MSK: %BGP-5-ADJCHANGE: neighbor 10.0.1.17 vpn vrf hostcomm-private Up',
));
$result[] = array('ios||23||4||4||12601:||2016-10-24 11:34:01|| -Traceback= BF7490z 195628z 10D3A0Cz 10D30B8z 10D8C28z 10D9B70z 10DAFE0z 10DB174z 10D34ECz 133F918z 133A9D4z||12601',
array('facility' => 'local7', 'priority' => '4', 'level' => '4',
'tag' => 'Traceback', 'program' => 'TRACEBACK',
'msg' => 'BF7490z 195628z 10D3A0Cz 10D30B8z 10D8C28z 10D9B70z 10DAFE0z 10DB174z 10D34ECz 133F918z 133A9D4z',
'msg_orig' => '-Traceback= BF7490z 195628z 10D3A0Cz 10D30B8z 10D8C28z 10D9B70z 10DAFE0z 10DB174z 10D34ECz 133F918z 133A9D4z',
));
// Cisco IOS-XR
$result[] = array('iosxr||23||5||5||920:||2014-11-26 17:29:48||RP/0/RSP0/CPU0:Nov 26 16:29:48.161 : bgp[1046]: %ROUTING-BGP-5-ADJCHANGE : neighbor 1.1.1.2 Up (VRF: default) (AS: 11111) ||920',
array('facility' => 'local7', 'priority' => '5', 'level' => '5',
'tag' => 'ADJCHANGE,ROUTING,bgp[1046]', 'program' => 'BGP',
'msg' => 'neighbor 1.1.1.2 Up (VRF: default) (AS: 11111)',
'msg_orig' => 'RP/0/RSP0/CPU0:Nov 26 16:29:48.161 : bgp[1046]: %ROUTING-BGP-5-ADJCHANGE : neighbor 1.1.1.2 Up (VRF: default) (AS: 11111)',
));
$result[] = array('iosxr||23||6||6||253:||2014-11-26 17:30:21||RP/0/RSP0/CPU0:Nov 26 16:30:21.710 : SSHD_[65755]: %SECURITY-SSHD-6-INFO_GENERAL : Client closes socket connection ||253',
array('facility' => 'local7', 'priority' => '6', 'level' => '6',
'tag' => 'INFO_GENERAL,SECURITY,SSHD_[65755]', 'program' => 'SSHD',
'msg' => 'Client closes socket connection',
'msg_orig' => 'RP/0/RSP0/CPU0:Nov 26 16:30:21.710 : SSHD_[65755]: %SECURITY-SSHD-6-INFO_GENERAL : Client closes socket connection',
));
$result[] = array('iosxr||23||6||6||10127:||2016-10-19 09:17:07|| LC/0/0/CPU0:Oct 19 09:17:07.433 : nfsvr[277]: %MGBL-NETFLOW-6-INFO_CACHE_SIZE_EXCEEDED : Cache size of 262144 for monitor nf_ipv4 has been exceeded ||10127',
array('facility' => 'local7', 'priority' => '6', 'level' => '6',
'tag' => 'INFO_CACHE_SIZE_EXCEEDED,MGBL,nfsvr[277]', 'program' => 'NETFLOW',
'msg' => 'Cache size of 262144 for monitor nf_ipv4 has been exceeded',
'msg_orig' => 'LC/0/0/CPU0:Oct 19 09:17:07.433 : nfsvr[277]: %MGBL-NETFLOW-6-INFO_CACHE_SIZE_EXCEEDED : Cache size of 262144 for monitor nf_ipv4 has been exceeded',
));
$result[] = array('iosxr||local0||err||err||83||2015-01-14 07:29:45||oly-er-01 LC/0/0/CPU0:Jan 14 07:29:45.556 CET: pfilter_ea[301]: %L2-PFILTER_EA-3-ERR_IM_CAPS : uidb set acl failed on interface Bundle-Ether1.1501.ip43696. (null) ||94795',
array('facility' => 'local0', 'priority' => '3', 'level' => '3',
'tag' => 'ERR_IM_CAPS,L2,pfilter_ea[301]', 'program' => 'PFILTER_EA',
'msg' => 'uidb set acl failed on interface Bundle-Ether1.1501.ip43696. (null)',
'msg_orig' => 'oly-er-01 LC/0/0/CPU0:Jan 14 07:29:45.556 CET: pfilter_ea[301]: %L2-PFILTER_EA-3-ERR_IM_CAPS : uidb set acl failed on interface Bundle-Ether1.1501.ip43696. (null)',
));
// Cisco NX-OS
$result[] = array('nxos||23||5||5||:||2019-02-27 13:23:54|| 2019 Feb 27 13:23:54 GMT: %VSHD-5-VSHD_SYSLOG_CONFIG_I: Configured from vty by username on x.x.x.x@pts/1||',
array('facility' => 'local7', 'priority' => '5', 'level' => '5',
'tag' => 'VSHD_SYSLOG_CONFIG_I', 'program' => 'VSHD',
'msg' => 'Configured from vty by username on x.x.x.x@pts/1',
'msg_orig' => '2019 Feb 27 13:23:54 GMT: %VSHD-5-VSHD_SYSLOG_CONFIG_I: Configured from vty by username on x.x.x.x@pts/1',
));
$result[] = array('nxos||23||2||2||:||2020-02-17 11:37:03|| 2020 Feb 17 11:37:03 MSK: %USER-2-SYSTEM_MSG: <<%USBHSD-2-USB_SWAP>> USB insertion or removal detected - usbhsd||',
array('facility' => 'local7', 'priority' => '2', 'level' => '2',
'tag' => 'SYSTEM_MSG', 'program' => 'USER',
'msg' => '<<%USBHSD-2-USB_SWAP>> USB insertion or removal detected - usbhsd',
'msg_orig' => '2020 Feb 17 11:37:03 MSK: %USER-2-SYSTEM_MSG: <<%USBHSD-2-USB_SWAP>> USB insertion or removal detected - usbhsd',
));
$result[] = array('nxos||23||2||2||:||2020-03-21 17:18:58|| 2020 Mar 21 17:18:58 MSK: %MTM-SLOT1-2-MTM_BUFFERS_FULL: MTM buffers are full for unit 0. MAC tables might be inconsistent. Pls use l2 consistency-checker to verify.||',
array('facility' => 'local7', 'priority' => '2', 'level' => '2',
'tag' => 'MTM_BUFFERS_FULL', 'program' => 'MTM-SLOT1',
'msg' => 'MTM buffers are full for unit 0. MAC tables might be inconsistent. Pls use l2 consistency-checker to verify.',
'msg_orig' => '2020 Mar 21 17:18:58 MSK: %MTM-SLOT1-2-MTM_BUFFERS_FULL: MTM buffers are full for unit 0. MAC tables might be inconsistent. Pls use l2 consistency-checker to verify.',
));
$result[] = array('nxos||23||5||5||:||2020-03-11 10:50:23|| 2020 Mar 11 10:50:23 MSK: vshd: process \'28488\' recieved signal 2||',
array('facility' => 'local7', 'priority' => '5', 'level' => '5',
'tag' => 'vshd', 'program' => 'VSHD',
'msg' => 'process \'28488\' recieved signal 2',
'msg_orig' => '2020 Mar 11 10:50:23 MSK: vshd: process \'28488\' recieved signal 2',
));
// Cisco ASA
// Old syslog format
$result[] = array('asa||23||4||4||12601:||2016-10-24 11:34:01||Apr 24 2013 16:00:28 INT-FW01 : %ASA-6-106100: access-list inside denied udp inside/172.29.2.101(1039) -> outside/192.203.230.10(53) hit-cnt 1 first hit [0xd820e56a, 0x0]||12601',
array('facility' => 'local7', 'priority' => '4', 'level' => '4',
'tag' => '106100', 'program' => 'ASA',
'msg' => 'access-list inside denied udp inside/172.29.2.101(1039) -> outside/192.203.230.10(53) hit-cnt 1 first hit [0xd820e56a, 0x0]',
'msg_orig' => 'Apr 24 2013 16:00:28 INT-FW01 : %ASA-6-106100: access-list inside denied udp inside/172.29.2.101(1039) -> outside/192.203.230.10(53) hit-cnt 1 first hit [0xd820e56a, 0x0]',
));
// New syslog format
$result[] = array('asa||19||5||5||:||2018-03-19 15:11:57||Mar 19 15:11:57 MSK/MSD: %ASA-config-5-111008: User \'enable_15\' executed the \'logging host inside 10.12.0.251 format emblem\' command.||',
array('facility' => 'local3', 'priority' => '5', 'level' => '5',
'tag' => '111008', 'program' => 'CONFIG',
'msg' => 'User \'enable_15\' executed the \'logging host inside 10.12.0.251 format emblem\' command.',
'msg_orig' => 'Mar 19 15:11:57 MSK/MSD: %ASA-config-5-111008: User \'enable_15\' executed the \'logging host inside 10.12.0.251 format emblem\' command.',
));
$result[] = array('asa||19||4||4||:||2018-03-19 15:12:23||Mar 19 15:12:23 MSK/MSD: %ASA--4-733100: [ Interface] drop rate-1 exceeded. Current burst rate is 0 per second, max configured rate is 8000; Current average rate is 22088 per second, max configured rate is 2000; Cumulative total count is 13253349||',
array('facility' => 'local3', 'priority' => '4', 'level' => '4',
'tag' => '733100', 'program' => 'INTERFACE',
'msg' => '[ Interface] drop rate-1 exceeded. Current burst rate is 0 per second, max configured rate is 8000; Current average rate is 22088 per second, max configured rate is 2000; Cumulative total count is 13253349',
'msg_orig' => 'Mar 19 15:12:23 MSK/MSD: %ASA--4-733100: [ Interface] drop rate-1 exceeded. Current burst rate is 0 per second, max configured rate is 8000; Current average rate is 22088 per second, max configured rate is 2000; Cumulative total count is 13253349',
));
$result[] = array('asa||19||6||6||:||2018-03-19 15:14:53|| message repeated 27 times: [Mar 19 15:14:53 MSK/MSD: %ASA-session-6-106015: Deny TCP (no connection) from 192.168.22.6/57537 to 88.221.73.29/443 flags RST on interface inside]||',
array('facility' => 'local3', 'priority' => '6', 'level' => '6',
'tag' => '106015', 'program' => 'SESSION',
'msg' => 'Deny TCP (no connection) from 192.168.22.6/57537 to 88.221.73.29/443 flags RST on interface inside',
'msg_orig' => 'message repeated 27 times: [Mar 19 15:14:53 MSK/MSD: %ASA-session-6-106015: Deny TCP (no connection) from 192.168.22.6/57537 to 88.221.73.29/443 flags RST on interface inside]',
));
// Uniquity Unifi
// Old syslog format
$result[] = array('unifi||3||6||6||hostapd:||2014-07-18 11:29:35|| ath2: STA c8:dd:c9:d1:d4:aa IEEE 802.11: associated||hostapd',
array('facility' => 'daemon', 'priority' => '6', 'level' => '6',
'tag' => 'hostapd', 'program' => 'HOSTAPD',
'msg' => 'ath2: STA c8:dd:c9:d1:d4:aa IEEE 802.11: associated',
'msg_orig' => 'ath2: STA c8:dd:c9:d1:d4:aa IEEE 802.11: associated',
));
// New syslog format
$result[] = array('unifi||3||6||6||(BZ2LR,00272250c1cd,v3.2.5.2791)||2014-12-12 09:36:39|| hostapd: ath2: STA dc:a9:71:1b:d6:c7 IEEE 802.11: associated||(BZ2LR,00272250c1cd,v3.2.5.2791)',
array('facility' => 'daemon', 'priority' => '6', 'level' => '6',
'tag' => 'hostapd', 'program' => 'HOSTAPD',
'msg' => 'ath2: STA dc:a9:71:1b:d6:c7 IEEE 802.11: associated',
'msg_orig' => 'hostapd: ath2: STA dc:a9:71:1b:d6:c7 IEEE 802.11: associated',
));
$result[] = array('unifi||1||6||6||("BZ2LR,00272250c119,v3.7.8.5016")||2016-10-06 18:20:25|| syslog: wevent.ubnt_custom_event(): EVENT_STA_LEAVE ath0: dc:a9:71:1b:d6:c7 / 3||("BZ2LR,00272250c119,v3.7.8.5016")',
array('facility' => 'user', 'priority' => '6', 'level' => '6',
'tag' => 'syslog', 'program' => 'SYSLOG',
'msg' => 'wevent.ubnt_custom_event(): EVENT_STA_LEAVE ath0: dc:a9:71:1b:d6:c7 / 3',
'msg_orig' => 'syslog: wevent.ubnt_custom_event(): EVENT_STA_LEAVE ath0: dc:a9:71:1b:d6:c7 / 3',
));
$result[] = array('unifi||1||6||6||("U7LR,44d9e7f618f2,v3.7.17.5220")||2016-10-06 18:21:22|| libubnt[16915]: wevent.ubnt_custom_event(): EVENT_STA_JOIN ath0: fc:64:ba:c1:7d:28 / 1||("U7LR,44d9e7f618f2,v3.7.17.5220")',
array('facility' => 'user', 'priority' => '6', 'level' => '6',
'tag' => 'libubnt[16915]', 'program' => 'LIBUBNT',
'msg' => 'wevent.ubnt_custom_event(): EVENT_STA_JOIN ath0: fc:64:ba:c1:7d:28 / 1',
'msg_orig' => 'libubnt[16915]: wevent.ubnt_custom_event(): EVENT_STA_JOIN ath0: fc:64:ba:c1:7d:28 / 1',
));
$result[] = array('unifi||0||4||4||("U7LR,44d9e7f618f2,v3.9.19.8123")||2018-03-12 12:55:20|| kernel: [420813.870000] wmi_unified_event_rx : no registered event handler : event id 0x901b ||("U7LR,44d9e7f618f2,v3.9.19.8123")',
array('facility' => 'kern', 'priority' => '4', 'level' => '4',
'tag' => 'kernel', 'program' => 'KERNEL',
'msg' => '[420813.870000] wmi_unified_event_rx : no registered event handler : event id 0x901b',
'msg_orig' => 'kernel: [420813.870000] wmi_unified_event_rx : no registered event handler : event id 0x901b',
));
$result[] = array('unifi||1||6||6||U7LR,44d9e7f618f2,v4.3.21.11325:||2020-10-05 16:28:50|| : stahtd[2839]: [STA-TRACKER].stahtd_dump_event(): {"mac":"0c:70:4a:7d:5c:73","message_type":"STA_ASSOC_TRACKER","vap":"ath4","auth_ts":"0.0","event_type":"fixup","event_id":"1","assoc_status":"0","arp_reply_gw_seen":"yes","dns_resp_seen":"yes"}||U7LR,44d9e7f618f2,v4.3.21.11325',
array('facility' => 'user', 'priority' => '6', 'level' => '6',
'tag' => 'stahtd[2839]', 'program' => 'STAHTD',
'msg' => '[STA-TRACKER].stahtd_dump_event(): {"mac":"0c:70:4a:7d:5c:73","message_type":"STA_ASSOC_TRACKER","vap":"ath4","auth_ts":"0.0","event_type":"fixup","event_id":"1","assoc_status":"0","arp_reply_gw_seen":"yes","dns_resp_seen":"yes"}',
'msg_orig' => ': stahtd[2839]: [STA-TRACKER].stahtd_dump_event(): {"mac":"0c:70:4a:7d:5c:73","message_type":"STA_ASSOC_TRACKER","vap":"ath4","auth_ts":"0.0","event_type":"fixup","event_id":"1","assoc_status":"0","arp_reply_gw_seen":"yes","dns_resp_seen":"yes"}',
));
// JunOS/JunOSe
$result[] = array('junos||9||6||6||/usr/sbin/cron[50991]:||2016-10-07 00:15:00|| (root) CMD ( /usr/libexec/atrun)||',
array('facility' => 'cron', 'priority' => '6', 'level' => '6',
'tag' => 'cron[50991]', 'program' => 'CRON',
'msg' => '(root) CMD ( /usr/libexec/atrun)',
'msg_orig' => '(root) CMD ( /usr/libexec/atrun)',
));
$result[] = array('junos||0||7||7||/kernel:||2018-02-28 16:15:37|| rts_gencfg_ifstate_free(): Removing RTS_IFSTATE_ID_PENDING_DEL flag from GENCFG Major 8 Minor 8||',
array('facility' => 'kern', 'priority' => '7', 'level' => '7',
'tag' => 'kernel', 'program' => 'KERNEL',
'msg' => 'rts_gencfg_ifstate_free(): Removing RTS_IFSTATE_ID_PENDING_DEL flag from GENCFG Major 8 Minor 8',
'msg_orig' => 'rts_gencfg_ifstate_free(): Removing RTS_IFSTATE_ID_PENDING_DEL flag from GENCFG Major 8 Minor 8',
));
$result[] = array('junos||3||4||4||mib2d[1230]:||2015-04-08 14:30:11|| SNMP_TRAP_LINK_DOWN: ifIndex 602, ifAdminStatus up(1), ifOperStatus down(2), ifName ge-0/1/0||mib2d',
array('facility' => 'daemon', 'priority' => '4', 'level' => '4',
'tag' => 'SNMP_TRAP_LINK_DOWN', 'program' => 'MIB2D',
'msg' => 'ifIndex 602, ifAdminStatus up(1), ifOperStatus down(2), ifName ge-0/1/0',
'msg_orig' => 'SNMP_TRAP_LINK_DOWN: ifIndex 602, ifAdminStatus up(1), ifOperStatus down(2), ifName ge-0/1/0',
));
$result[] = array('junos||3||6||6||eswd[1237]:||2018-03-11 07:25:06|| ESWD_STP_STATE_CHANGE_INFO: STP state for interface ge-0/0/8.0 context id 23 changed from FORWARDING to BLOCKING||eswd',
array('facility' => 'daemon', 'priority' => '6', 'level' => '6',
'tag' => 'ESWD_STP_STATE_CHANGE_INFO', 'program' => 'ESWD',
'msg' => 'STP state for interface ge-0/0/8.0 context id 23 changed from FORWARDING to BLOCKING',
'msg_orig' => 'ESWD_STP_STATE_CHANGE_INFO: STP state for interface ge-0/0/8.0 context id 23 changed from FORWARDING to BLOCKING',
));
$result[] = array('junos||23||6||6||mgd[87681]:||2017-07-27 14:45:11|| UI_AUTH_EVENT: Authenticated user \'tpetrov\' at permission level \'j-super-user\'||mgd',
array('facility' => 'local7', 'priority' => '6', 'level' => '6',
'tag' => 'UI_AUTH_EVENT', 'program' => 'MGD',
'msg' => 'Authenticated user \'tpetrov\' at permission level \'j-super-user\'',
'msg_orig' => 'UI_AUTH_EVENT: Authenticated user \'tpetrov\' at permission level \'j-super-user\'',
));
$result[] = array('junos||3||6||6||rpd[1247]:||2018-03-11 07:25:09|| EVENT <UpDown> ge-0/0/8.0 index 79 <Up Broadcast Multicast> address #0 3c.61.4.f1.da.b||rpd',
array('facility' => 'daemon', 'priority' => '6', 'level' => '6',
'tag' => 'EVENT,UpDown', 'program' => 'RPD',
'msg' => 'ge-0/0/8.0 index 79 <Up Broadcast Multicast> address #0 3c.61.4.f1.da.b',
'msg_orig' => 'EVENT <UpDown> ge-0/0/8.0 index 79 <Up Broadcast Multicast> address #0 3c.61.4.f1.da.b',
));
// Always skip this unusefull entries
$result[] = array('junos||12||3||3||last||2018-02-16 16:15:49|| message repeated 3 times||last',
FALSE);
// FTOS
$result[] = array('ftos||23||5||5||||2018-03-12 13:48:18|| Mar 12 14:48:18.631: spb-rad-sw1: %STKUNIT0-M:CP %SEC-5-TACACS_ACCESS_ACCEPTED: Tacacs access accepted for user "rancid"||',
array('facility' => 'local7', 'priority' => '5', 'level' => '5',
'tag' => 'TACACS_ACCESS_ACCEPTED', 'program' => 'SEC',
'msg' => 'Tacacs access accepted for user "rancid"',
'msg_orig' => 'Mar 12 14:48:18.631: spb-rad-sw1: %STKUNIT0-M:CP %SEC-5-TACACS_ACCESS_ACCEPTED: Tacacs access accepted for user "rancid"',
));
$result[] = array('ftos||23||5||5||||2018-03-19 05:48:18|| Mar 19 06:48:18.19: spb-rad-sw1: %STKUNIT0-M:CP %SEC-5-LOGOUT: Exec session is terminated for user rancid on line vty0 (1.1.1.1)||',
array('facility' => 'local7', 'priority' => '5', 'level' => '5',
'tag' => 'LOGOUT', 'program' => 'SEC',
'msg' => 'Exec session is terminated for user rancid on line vty0 (1.1.1.1)',
'msg_orig' => 'Mar 19 06:48:18.19: spb-rad-sw1: %STKUNIT0-M:CP %SEC-5-LOGOUT: Exec session is terminated for user rancid on line vty0 (1.1.1.1)',
));
$result[] = array('ftos||23||6||6||||2018-03-19 06:46:39|| Mar 19 07:46:39.430: spb-rad-sw1: %STKUNIT0-M:CP %NTP-6-INCOMP VER: Incompatible NTP Versions||',
array('facility' => 'local7', 'priority' => '6', 'level' => '6',
'tag' => 'INCOMP VER', 'program' => 'NTP',
'msg' => 'Incompatible NTP Versions',
'msg_orig' => 'Mar 19 07:46:39.430: spb-rad-sw1: %STKUNIT0-M:CP %NTP-6-INCOMP VER: Incompatible NTP Versions',
));
$result[] = array('ftos||23||5||5||||2018-03-19 05:48:12|| Mar 19 06:48:12.692: spb-rad-sw1: %STKUNIT0-M:CP %SEC-5-LOGIN_SUCCESS: Login successful for user rancid on line vty0 (1.1.1.1)||',
array('facility' => 'local7', 'priority' => '5', 'level' => '5',
'tag' => 'LOGIN_SUCCESS', 'program' => 'SEC',
'msg' => 'Login successful for user rancid on line vty0 (1.1.1.1)',
'msg_orig' => 'Mar 19 06:48:12.692: spb-rad-sw1: %STKUNIT0-M:CP %SEC-5-LOGIN_SUCCESS: Login successful for user rancid on line vty0 (1.1.1.1)',
));
// XOS
$result[] = array('xos||20||4||4||<Warn:||2018-06-08 10:02:09||NetTools.SNTP.SrvrNameNotRslved> Slot-1: Host name timesrv1 is not DNS resolved yet||<Warn',
array('facility' => 'local4', 'priority' => '4', 'level' => '4',
'tag' => 'SNTP,SrvrNameNotRslved', 'program' => 'NETTOOLS',
'msg' => 'Slot-1: Host name timesrv1 is not DNS resolved yet',
'msg_orig' => 'NetTools.SNTP.SrvrNameNotRslved> Slot-1: Host name timesrv1 is not DNS resolved yet',
));
$result[] = array('xos||20||6||6||<Info:||2018-06-08 10:02:09||vlan.msgs.portLinkStateDown> MSM-B: Port 4:32 link down||<Info',
array('facility' => 'local4', 'priority' => '6', 'level' => '6',
'tag' => 'msgs,portLinkStateDown', 'program' => 'VLAN',
'msg' => 'MSM-B: Port 4:32 link down',
'msg_orig' => 'vlan.msgs.portLinkStateDown> MSM-B: Port 4:32 link down',
));
$result[] = array('xos||20||5||5||<Noti:||2018-06-08 10:02:09||DM.Notice> Slot-1: Setting hwclock time to system time, and broadcasting time||<Noti',
array('facility' => 'local4', 'priority' => '5', 'level' => '5',
'tag' => 'Notice', 'program' => 'DM',
'msg' => 'Slot-1: Setting hwclock time to system time, and broadcasting time',
'msg_orig' => 'DM.Notice> Slot-1: Setting hwclock time to system time, and broadcasting time',
));
$result[] = array('xos||20||4||4||<Warn:||2018-06-08 03:32:55||NetTools.SNTP.TxReqToSrvrFail> Slot-1: Failed to send SNTP request to server 160.103.4.115||<Warn',
array('facility' => 'local4', 'priority' => '4', 'level' => '4',
'tag' => 'SNTP,TxReqToSrvrFail', 'program' => 'NETTOOLS',
'msg' => 'Slot-1: Failed to send SNTP request to server 160.103.4.115',
'msg_orig' => 'NetTools.SNTP.TxReqToSrvrFail> Slot-1: Failed to send SNTP request to server 160.103.4.115',
));
$result[] = array('xos||20||6||6||<Info:||2018-06-08 10:02:11||vlan.msgs.portLinkStateUp> MSM-B: Port 4:32 link UP at speed 100 Mbps and full-duplex||<Info',
array('facility' => 'local4', 'priority' => '6', 'level' => '6',
'tag' => 'msgs,portLinkStateUp', 'program' => 'VLAN',
'msg' => 'MSM-B: Port 4:32 link UP at speed 100 Mbps and full-duplex',
'msg_orig' => 'vlan.msgs.portLinkStateUp> MSM-B: Port 4:32 link UP at speed 100 Mbps and full-duplex',
));
// Arista EOS
$result[] = array('arista_eos||local4||5||notice||a5||2018-08-27 12:19:52||%SYS-5-CONFIG_STARTUP: Startup config saved from system:/running-config by admin on vty6 (172.21.131.237).||Cli',
array('facility' => 'local4', 'priority' => '5', 'level' => '5',
'tag' => 'CONFIG_STARTUP', 'program' => 'SYS',
'msg' => 'Startup config saved from system:/running-config by admin on vty6 (172.21.131.237).',
'msg_orig' => '%SYS-5-CONFIG_STARTUP: Startup config saved from system:/running-config by admin on vty6 (172.21.131.237).',
));
// HPE Switches
$result[] = array('hh3c||local7||5||notice||bd||2018-08-27 12:21:31||Line protocol on the interface Ten-GigabitEthernet1/0/38 is up.||%10IFNET/5/LINK_UPDOWN',
array('facility' => 'local7', 'priority' => '5', 'level' => '5',
'tag' => 'LINK_UPDOWN', 'program' => 'IFNET',
'msg' => 'Line protocol on the interface Ten-GigabitEthernet1/0/38 is up.',
'msg_orig' => 'Line protocol on the interface Ten-GigabitEthernet1/0/38 is up.',
));
$result[] = array('hh3c||local7||6||6||bd||2018-08-27 12:21:31||Member port XGE1/0/33 of aggregation group BAGG33 changed to the inactive state, because the physical state of the port is down.||%10LAGG/6/LAGG_INACTIVE_PHYSTATE',
array('facility' => 'local7', 'priority' => '6', 'level' => '6',
'tag' => 'LAGG_INACTIVE_PHYSTATE', 'program' => 'LAGG',
'msg' => 'Member port XGE1/0/33 of aggregation group BAGG33 changed to the inactive state, because the physical state of the port is down.',
'msg_orig' => 'Member port XGE1/0/33 of aggregation group BAGG33 changed to the inactive state, because the physical state of the port is down.',
));
// NS-BSD
$result[] = array('ns-bsd||user||5||notice||0d||2018-10-16 18:13:05||2018-10-16T18:13:03+02:00 fw.hostname.net tproxyd - - - id=firewall time=\"2018-10-16 18:13:03\" fw=\"fw.hostname.net\" tz=+0200 startime=\"2018-10-16 18:13:02\" pri=5 proto=http confid=1 slotlevel=2 ruleid=9 rulename=\"16663e6700f_5\" op=GET result=416 user=\"\" domain=\"\" src=192.168.0.148 srcport=59365 srcportname=ephemeral_fw_tcp dst=88.221.145.155 dstport=80 dstportname=http srcmac=54:27:1e:5c:22:bb dstname=2.tlu.dl.delivery.mp.microsoft.com modsrc=192.168.1.2 modsrcport=9619 origdst=88.221.145.155 origdstport=80 ipv=4 sent=484 rcvd=0 duration=0.00 dstcontinent=\"eu\" dstcountry=\"it\" action=block contentpolicy=1 urlruleid=2 cat_site=\"vpnssl_owa\" arg=\"/filestreamingservice/files/5fa99684-8931-4eff-bc5d-27ff2a406a31%3FP1%3D1539706618%26P2%3D402%26P3%3D2%26P4%3DHCvXZchoZYgzbdK0XkO2CelafFHcA%252bUrQcgT5u%252b6WDwtpi5jZJu%252fUjCHpbffRGU5iG8kuHW1C5uQ68drtUWh%252fA%253d%253d\" msg=\"Requested range not satisfiable\" logtype=\"web\"||1',
array('facility' => 'user', 'priority' => '5', 'level' => '5',
'tag' => 'firewall', 'program' => 'TPROXYD',
'msg' => 'id=firewall time="2018-10-16 18:13:03" fw="fw.hostname.net" tz=+0200 startime="2018-10-16 18:13:02" pri=5 proto=http confid=1 slotlevel=2 ruleid=9 rulename="16663e6700f_5" op=GET result=416 user="" domain="" src=192.168.0.148 srcport=59365 srcportname=ephemeral_fw_tcp dst=88.221.145.155 dstport=80 dstportname=http srcmac=54:27:1e:5c:22:bb dstname=2.tlu.dl.delivery.mp.microsoft.com modsrc=192.168.1.2 modsrcport=9619 origdst=88.221.145.155 origdstport=80 ipv=4 sent=484 rcvd=0 duration=0.00 dstcontinent="eu" dstcountry="it" action=block contentpolicy=1 urlruleid=2 cat_site="vpnssl_owa" arg="/filestreamingservice/files/5fa99684-8931-4eff-bc5d-27ff2a406a31%3FP1%3D1539706618%26P2%3D402%26P3%3D2%26P4%3DHCvXZchoZYgzbdK0XkO2CelafFHcA%252bUrQcgT5u%252b6WDwtpi5jZJu%252fUjCHpbffRGU5iG8kuHW1C5uQ68drtUWh%252fA%253d%253d" msg="Requested range not satisfiable" logtype="web"',
'msg_orig' => '2018-10-16T18:13:03+02:00 fw.hostname.net tproxyd - - - id=firewall time="2018-10-16 18:13:03" fw="fw.hostname.net" tz=+0200 startime="2018-10-16 18:13:02" pri=5 proto=http confid=1 slotlevel=2 ruleid=9 rulename="16663e6700f_5" op=GET result=416 user="" domain="" src=192.168.0.148 srcport=59365 srcportname=ephemeral_fw_tcp dst=88.221.145.155 dstport=80 dstportname=http srcmac=54:27:1e:5c:22:bb dstname=2.tlu.dl.delivery.mp.microsoft.com modsrc=192.168.1.2 modsrcport=9619 origdst=88.221.145.155 origdstport=80 ipv=4 sent=484 rcvd=0 duration=0.00 dstcontinent="eu" dstcountry="it" action=block contentpolicy=1 urlruleid=2 cat_site="vpnssl_owa" arg="/filestreamingservice/files/5fa99684-8931-4eff-bc5d-27ff2a406a31%3FP1%3D1539706618%26P2%3D402%26P3%3D2%26P4%3DHCvXZchoZYgzbdK0XkO2CelafFHcA%252bUrQcgT5u%252b6WDwtpi5jZJu%252fUjCHpbffRGU5iG8kuHW1C5uQ68drtUWh%252fA%253d%253d" msg="Requested range not satisfiable" logtype="web"',
));
$result[] = array('ns-bsd||user||1||alert||09||2018-10-16 18:14:35||2018-10-16T18:14:35+02:00 na_carfi asqd - - - id=firewall time=\"2018-10-16 18:14:35\" fw=\"na_carfi\" tz=+0200 startime=\"2018-10-16 18:14:34\" pri=1 confid=00 srcif=\"Ethernet1\" srcifname=\"in\" ipproto=udp proto=udp src=172.16.0.27 srcport=17500 srcmac=00:0c:29:09:f4:44 dst=255.255.255.255 dstport=17500 dstname=broadcast ipv=4 action=block msg=\"IP address spoofing (type=1)\" class=protocol classification=0 alarmid=1 target=dst logtype=\"alarm\"||1',
array('facility' => 'user', 'priority' => '1', 'level' => '1',
'tag' => 'firewall', 'program' => 'ASQD',
'msg' => 'id=firewall time="2018-10-16 18:14:35" fw="na_carfi" tz=+0200 startime="2018-10-16 18:14:34" pri=1 confid=00 srcif="Ethernet1" srcifname="in" ipproto=udp proto=udp src=172.16.0.27 srcport=17500 srcmac=00:0c:29:09:f4:44 dst=255.255.255.255 dstport=17500 dstname=broadcast ipv=4 action=block msg="IP address spoofing (type=1)" class=protocol classification=0 alarmid=1 target=dst logtype="alarm"',
'msg_orig' => '2018-10-16T18:14:35+02:00 na_carfi asqd - - - id=firewall time="2018-10-16 18:14:35" fw="na_carfi" tz=+0200 startime="2018-10-16 18:14:34" pri=1 confid=00 srcif="Ethernet1" srcifname="in" ipproto=udp proto=udp src=172.16.0.27 srcport=17500 srcmac=00:0c:29:09:f4:44 dst=255.255.255.255 dstport=17500 dstname=broadcast ipv=4 action=block msg="IP address spoofing (type=1)" class=protocol classification=0 alarmid=1 target=dst logtype="alarm"',
));
// Test filter syslog messages
$result[] = array('linux||12||3||3||last||2018-02-16 16:15:49|| some someTESTxx||last',
FALSE);
$result[] = array('linux||12||3||3||last||2018-02-16 16:15:49|| some some TEST xx||last',
FALSE);
$result[] = array('linux||12||3||3||last||2018-02-16 16:15:49|| some derpmygod ||last',
FALSE);
$result[] = array('linux||12||3||3||last||2018-02-16 16:15:49|| some derp xx||last',
FALSE);
// Filters case sensitive
$result[] = array('linux||12||3||3||last||2018-02-16 16:15:49|| some some TeSTxx||last',
array('facility' => 'ntp', 'priority' => '3', 'level' => '3',
'tag' => 'last', 'program' => 'LAST',
'msg' => 'some some TeSTxx',
'msg_orig' => 'some some TeSTxx',
));
$result[] = array('mikrotik||user||5||notice||0d||2018-03-23 07:48:39||dhcp105 assigned 192.168.58.84 to 80:BE:05:7A:73:6E||dhcp,info',
array('facility' => 'user', 'priority' => '6', 'level' => '5',
'tag' => 'info', 'program' => 'DHCP',
'msg' => 'dhcp105 assigned 192.168.58.84 to 80:BE:05:7A:73:6E',
'msg_orig' => 'dhcp105 assigned 192.168.58.84 to 80:BE:05:7A:73:6E',
));
$result[] = array('mikrotik-swos||user||5||notice||0d||2018-03-23 08:55:41||CompDHCP assigned 10.0.0.222 to 4C:32:75:90:69:33||dhcp,info',
array('facility' => 'user', 'priority' => '6', 'level' => '5',
'tag' => 'info', 'program' => 'DHCP',
'msg' => 'CompDHCP assigned 10.0.0.222 to 4C:32:75:90:69:33',
'msg_orig' => 'CompDHCP assigned 10.0.0.222 to 4C:32:75:90:69:33',
));
// HP
$result[] = array('procurve||5||4||4||02672||2018-04-26 15:38:35|| FFI: port 11-Excessive link state transitions||02672',
array('facility' => 'syslog', 'priority' => '4', 'level' => '4',
'tag' => 'FFI', 'program' => 'FFI',
'msg' => 'port 11-Excessive link state transitions',
'msg_orig' => 'FFI: port 11-Excessive link state transitions',
));
// Sophos
$result[] = array('sophos||5||5||5||2018:||2018-05-04 14:44:36||05:04-12:44:36 utm syslog-ng[5202]: Syslog connection established; fd=\'34\', server=\'AF_INET(77.222.50.30:514)\', local=\'AF_INET(0.0.0.0:0)\'||2018',
array('facility' => 'syslog', 'priority' => '5', 'level' => '5',
'tag' => 'syslog-ng[5202]', 'program' => 'SYSLOG-NG',
'msg' => 'Syslog connection established; fd=\'34\', server=\'AF_INET(77.222.50.30:514)\', local=\'AF_INET(0.0.0.0:0)\'',
'msg_orig' => '05:04-12:44:36 utm syslog-ng[5202]: Syslog connection established; fd=\'34\', server=\'AF_INET(77.222.50.30:514)\', local=\'AF_INET(0.0.0.0:0)\'',
));
$result[] = array('sophos||22||5||5||2018:||2018-05-04 14:45:17||05:04-12:45:17 utm httpd: 213.230.218.10 - - [04/May/2018:12:45:17 +0100] "POST /webadmin.plx HTTP/1.1" 200 609||2018',
array('facility' => 'local6', 'priority' => '5', 'level' => '5',
'tag' => 'httpd', 'program' => 'HTTPD',
'msg' => '213.230.218.10 - - [04/May/2018:12:45:17 +0100] "POST /webadmin.plx HTTP/1.1" 200 609',
'msg_orig' => '05:04-12:45:17 utm httpd: 213.230.218.10 - - [04/May/2018:12:45:17 +0100] "POST /webadmin.plx HTTP/1.1" 200 609',
));
$result[] = array('sophos||3||6||6||2018:||2018-05-04 14:44:43||05:04-12:44:43 utm ulogd[5157]: id="2001" severity="info" sys="SecureNet" sub="packetfilter" name="Packet dropped" action="drop" fwrule="60002" initf="eth0" outitf="eth0" srcmac="d4:ca:6d:22:93:8c" dstmac="00:50:56:a1:7b:6c" srcip="5.49.1.8" dstip="1.20.20.9" proto="6" length="60" tos="0x00" prec="0x00" ttl="49" srcport="3666" dstport="23" tcpflags="SYN" ||2018',
array('facility' => 'daemon', 'priority' => '6', 'level' => '6',
'tag' => 'ulogd[5157]', 'program' => 'ULOGD',
'msg' => 'id="2001" severity="info" sys="SecureNet" sub="packetfilter" name="Packet dropped" action="drop" fwrule="60002" initf="eth0" outitf="eth0" srcmac="d4:ca:6d:22:93:8c" dstmac="00:50:56:a1:7b:6c" srcip="5.49.1.8" dstip="1.20.20.9" proto="6" length="60" tos="0x00" prec="0x00" ttl="49" srcport="3666" dstport="23" tcpflags="SYN"',
'msg_orig' => '05:04-12:44:43 utm ulogd[5157]: id="2001" severity="info" sys="SecureNet" sub="packetfilter" name="Packet dropped" action="drop" fwrule="60002" initf="eth0" outitf="eth0" srcmac="d4:ca:6d:22:93:8c" dstmac="00:50:56:a1:7b:6c" srcip="5.49.1.8" dstip="1.20.20.9" proto="6" length="60" tos="0x00" prec="0x00" ttl="49" srcport="3666" dstport="23" tcpflags="SYN"',
));
$result[] = array('sophos||9||6||6||2018:||2018-05-04 14:45:01||05:04-12:45:01 utm /usr/sbin/cron[11517]: (root) CMD ( /usr/local/bin/rpmdb_backup )||2018',
array('facility' => 'cron', 'priority' => '6', 'level' => '6',
'tag' => 'cron[11517]', 'program' => 'CRON',
'msg' => '(root) CMD ( /usr/local/bin/rpmdb_backup )',
'msg_orig' => '05:04-12:45:01 utm /usr/sbin/cron[11517]: (root) CMD ( /usr/local/bin/rpmdb_backup )',
));
$result[] = array('sophos||3||5||5||2018:||2018-05-04 14:44:37||05:04-12:44:37 utm openvpn[5068]: MANAGEMENT: CMD \'status -1\'||2018',
array('facility' => 'daemon', 'priority' => '5', 'level' => '5',
'tag' => 'openvpn[5068],MANAGEMENT', 'program' => 'OPENVPN',
'msg' => 'CMD \'status -1\'',
'msg_orig' => '05:04-12:44:37 utm openvpn[5068]: MANAGEMENT: CMD \'status -1\'',
));
// Brocade
$result[] = [
'nos||21||6||6||raslogd:||2021-03-23 16:41:27|| [log@1588 value="RASLOG"][timestamp@1588 value="2021-03-23T16:41:27.188825"][msgid@1588 value="L2SS-1032"][seqnum@1588 value="94245"][attr@1588 value=" SW/0 | Active | DCE | WWN 10:00:50:eb:1a:ce:e7:44"][severity@1588 value="INFO"][swname@1588 value="VDX_1R01S08"] BOMENS Checksum Mismatch reached maximum threshold(3) for Rbridge:21. Requesting MAC refresh from Rbridge:21.||raslogd',
[ 'facility' => 'local5', 'priority' => '6', 'level' => '6',
'tag' => 'L2SS-1032', 'program' => 'RASLOG',
'msg' => 'ENS Checksum Mismatch reached maximum threshold(3) for Rbridge:21. Requesting MAC refresh from Rbridge:21.',
'msg_orig' => '[log@1588 value="RASLOG"][timestamp@1588 value="2021-03-23T16:41:27.188825"][msgid@1588 value="L2SS-1032"][seqnum@1588 value="94245"][attr@1588 value=" SW/0 | Active | DCE | WWN 10:00:50:eb:1a:ce:e7:44"][severity@1588 value="INFO"][swname@1588 value="VDX_1R01S08"] BOMENS Checksum Mismatch reached maximum threshold(3) for Rbridge:21. Requesting MAC refresh from Rbridge:21.',
]
];
$result[] = [
'nos||21||6||6||raslogd:||2021-03-23 16:41:31|| [log@1588 value="RASLOG"][timestamp@1588 value="2021-03-23T16:41:31.621350"][msgid@1588 value="SEC-1203"][seqnum@1588 value="184473"][attr@1588 value=" SW/0 | Active | WWN 10:00:c4:f5:7c:65:44:f4"][severity@1588 value="INFO"][swname@1588 value="VDX_TESPOP1"][arg0@1588 value="10.101.10.8" desc="IP address"] BOMLogin information: Login successful via TELNET/SSH/RSH. IP Addr: 10.101.10.8.||raslogd',
[ 'facility' => 'local5', 'priority' => '6', 'level' => '6',
'tag' => 'SEC-1203', 'program' => 'RASLOG',
'msg' => 'Login information: Login successful via TELNET/SSH/RSH. IP Addr: 10.101.10.8.',
'msg_orig' => '[log@1588 value="RASLOG"][timestamp@1588 value="2021-03-23T16:41:31.621350"][msgid@1588 value="SEC-1203"][seqnum@1588 value="184473"][attr@1588 value=" SW/0 | Active | WWN 10:00:c4:f5:7c:65:44:f4"][severity@1588 value="INFO"][swname@1588 value="VDX_TESPOP1"][arg0@1588 value="10.101.10.8" desc="IP address"] BOMLogin information: Login successful via TELNET/SSH/RSH. IP Addr: 10.101.10.8.',
]
];
$result[] = [
'nos||21||6||6||raslogd:||2021-03-23 16:41:31|| [log@1588 value="AUDIT"][timestamp@1588 value="2021-03-23T16:41:31.623184"][tz@1588 value="CET"][msgid@1588 value="SEC-3020"][severity@1588 value="INFO"][class@1588 value="SECURITY"][user@1588 value="qwerty"][role@1588 value="admin"][ip@1588 value="10.101.10.8"][interface@1588 value="ssh"][application@1588 value="CLI"][swname@1588 value="VDX_TESPOP1"][arg0@1588 value="login" desc="Event Name"][arg1@1588 value="REMOTE, IP Addr: 10.101.10.8" desc="connection method and IP Address"] BOMEvent: login, Status: success, Info: Successful login attempt via REMOTE, IP Addr: 10.101.10.8.||raslogd',
[ 'facility' => 'local5', 'priority' => '6', 'level' => '6',
'tag' => 'SEC-3020,ssh,CLI', 'program' => 'AUDIT',
'msg' => 'Event: login, Status: success, Info: Successful login attempt via REMOTE, IP Addr: 10.101.10.8.',
'msg_orig' => '[log@1588 value="AUDIT"][timestamp@1588 value="2021-03-23T16:41:31.623184"][tz@1588 value="CET"][msgid@1588 value="SEC-3020"][severity@1588 value="INFO"][class@1588 value="SECURITY"][user@1588 value="qwerty"][role@1588 value="admin"][ip@1588 value="10.101.10.8"][interface@1588 value="ssh"][application@1588 value="CLI"][swname@1588 value="VDX_TESPOP1"][arg0@1588 value="login" desc="Event Name"][arg1@1588 value="REMOTE, IP Addr: 10.101.10.8" desc="connection method and IP Address"] BOMEvent: login, Status: success, Info: Successful login attempt via REMOTE, IP Addr: 10.101.10.8.',
]
];
// Dell
$result[] = [
'dnos6||23||6||6||CLI_WEB[emWeb]:||2021-05-13 14:20:35|| cmd_logger_api.c(260) 577 %% [WEB:admin:172.90.1.128] User has logged out||CLI_WEB',
[ 'facility' => 'local7', 'priority' => '6', 'level' => '6',
'tag' => 'emWeb,cmd_logger_api.c', 'program' => 'CLI_WEB',
'msg' => '[WEB:admin:172.90.1.128] User has logged out',
'msg_orig' => 'cmd_logger_api.c(260) 577 %% [WEB:admin:172.90.1.128] User has logged out',
]
];
$result[] = [
'dnos6||23||5||5||TRAPMGR[trapTask]:||2021-05-13 14:21:33|| traputil.c(721) 580 %% \'startup-config\' has changed.||TRAPMGR',
[ 'facility' => 'local7', 'priority' => '5', 'level' => '5',
'tag' => 'trapTask,traputil.c', 'program' => 'TRAPMGR',
'msg' => '\'startup-config\' has changed.',
'msg_orig' => 'traputil.c(721) 580 %% \'startup-config\' has changed.',
]
];
// Tests from issues
// OBS-335
$result[] = array('cisco-uc||9||6||6||349:||2013-05-30 16:40:29|| : crond[9538]: (root) CMD ( /etc/rc.d/init.d/fiostats show)||349',
array('facility' => 'cron', 'priority' => '6', 'level' => '6',
'tag' => 'crond[9538]', 'program' => 'CROND',
'msg' => '(root) CMD ( /etc/rc.d/init.d/fiostats show)',
'msg_orig' => ': crond[9538]: (root) CMD ( /etc/rc.d/init.d/fiostats show)',
));
$result[] = array('cisco-uc||1||5||5||349:||2013-05-30 16:40:29|| : logrotate: ALERT exited abnormally with [1]||349',
array('facility' => 'user', 'priority' => '5', 'level' => '5',
'tag' => 'logrotate', 'program' => 'LOGROTATE',
'msg' => 'ALERT exited abnormally with [1]',
'msg_orig' => ': logrotate: ALERT exited abnormally with [1]',
));
$result[] = array('cisco-uc||9||6||6||349:||2013-05-30 16:40:29|| : : 7273: May 30 15:33:20.636 UTC : %CCM_RTMT-RTMT-2-RTMT-ERROR-ALERT: RTMT Alert Name:DBChangeNotifyFailure Detail: DBChangeNotify queue delay over 2 minutes. Current DB ChangeNotify queue delay (135) is over 120-sec threshold. The alert is generated on Thu May 30 15:33:20 GMT+00:00 2013 on node CallManager. App ID:Cisco AMC Service Cluster ID: Node ID:CallManager||349',
array('facility' => 'cron', 'priority' => '6', 'level' => '6',
'tag' => 'RTMT,ERROR-ALERT', 'program' => 'RTMT',
'msg' => 'RTMT Alert Name:DBChangeNotifyFailure Detail: DBChangeNotify queue delay over 2 minutes. Current DB ChangeNotify queue delay (135) is over 120-sec threshold. The alert is generated on Thu May 30 15:33:20 GMT+00:00 2013 on node CallManager. App ID:Cisco AMC Service Cluster ID: Node ID:CallManager',
'msg_orig' => ': : 7273: May 30 15:33:20.636 UTC : %CCM_RTMT-RTMT-2-RTMT-ERROR-ALERT: RTMT Alert Name:DBChangeNotifyFailure Detail: DBChangeNotify queue delay over 2 minutes. Current DB ChangeNotify queue delay (135) is over 120-sec threshold. The alert is generated on Thu May 30 15:33:20 GMT+00:00 2013 on node CallManager. App ID:Cisco AMC Service Cluster ID: Node ID:CallManager',
));
// OBS-760
$result[] = array('linux||mail||info||info||16||2014-04-02 12:03:32||A87EC201127: to=<address@hotmail.com>, relay=10.1.1.185[10.1.1.185]:25, delay=1.3, delays=0.18/0.01/0.01/1.1, dsn=2.6.0, status=sent (250 2.6.0 <20140402160331.A87EC201127@app-web1.domain.edu> [InternalId=20728197] Queued mail for delivery)||postfix/smtp',
array('facility' => 'mail', 'priority' => '6', 'level' => '6',
'tag' => '16,A87EC201127,smtp', 'program' => 'POSTFIX',
'msg' => 'A87EC201127: to=<address@hotmail.com>, relay=10.1.1.185[10.1.1.185]:25, delay=1.3, delays=0.18/0.01/0.01/1.1, dsn=2.6.0, status=sent (250 2.6.0 <20140402160331.A87EC201127@app-web1.domain.edu> [InternalId=20728197] Queued mail for delivery)',
'msg_orig' => 'A87EC201127: to=<address@hotmail.com>, relay=10.1.1.185[10.1.1.185]:25, delay=1.3, delays=0.18/0.01/0.01/1.1, dsn=2.6.0, status=sent (250 2.6.0 <20140402160331.A87EC201127@app-web1.domain.edu> [InternalId=20728197] Queued mail for delivery)',
));
$result[] = array('linux||local0||notice||notice||85||2014-03-26 12:54:17||Wed Mar 26 12:54:17 2014 : Auth: Login incorrect (mschap: External script says Logon failure (0xc000006d)): [username] (from client 10.100.1.3 port 0 cli a4c3612a4077 via TLS tunnel)||Auth',
array('facility' => 'local0', 'priority' => '5', 'level' => '5',
'tag' => '85,mschap', 'program' => 'AUTH',
'msg' => 'Login incorrect (mschap: External script says Logon failure (0xc000006d)): [username] (from client 10.100.1.3 port 0 cli a4c3612a4077 via TLS tunnel)',
'msg_orig' => 'Wed Mar 26 12:54:17 2014 : Auth: Login incorrect (mschap: External script says Logon failure (0xc000006d)): [username] (from client 10.100.1.3 port 0 cli a4c3612a4077 via TLS tunnel)',
));
// OBS-3614
$result[] = [ 'netscaler||16||5||5||||2021-01-26 13:47:07|| 01/26/2021:12:47:07 GMT DCRX-ANS-N004 0-PPE-0 : default EVENT DEVICEDOWN 62431870 0 : Device "server_serviceGroup_NSSVC_TCP_172.16.200.150:636(SVG_TST_LDAPS_ADMB?DC-BRU-150?636)" - State DOWN||',
[ 'facility' => 'local0', 'priority' => '5', 'level' => '5',
'tag' => 'DEVICEDOWN', 'program' => 'EVENT',
'msg' => 'Device "server_serviceGroup_NSSVC_TCP_172.16.200.150:636(SVG_TST_LDAPS_ADMB?DC-BRU-150?636)" - State DOWN',
'msg_orig' => '01/26/2021:12:47:07 GMT DCRX-ANS-N004 0-PPE-0 : default EVENT DEVICEDOWN 62431870 0 : Device "server_serviceGroup_NSSVC_TCP_172.16.200.150:636(SVG_TST_LDAPS_ADMB?DC-BRU-150?636)" - State DOWN',
]
];
$result[] = [ 'netscaler||16||5||5||||2021-01-26 13:47:07|| 10/03/2013:16:49:07 GMT dk-lb001a PPE-4 : UI CMD_EXECUTED 10367926 : User so_readonly - Remote_ip 10.70.66.56 - Command "stat lb vserver" - Status "Success"||',
[ 'facility' => 'local0', 'priority' => '5', 'level' => '5',
'tag' => 'CMD_EXECUTED', 'program' => 'UI',
'msg' => 'User so_readonly - Remote_ip 10.70.66.56 - Command "stat lb vserver" - Status "Success"',
'msg_orig' => '10/03/2013:16:49:07 GMT dk-lb001a PPE-4 : UI CMD_EXECUTED 10367926 : User so_readonly - Remote_ip 10.70.66.56 - Command "stat lb vserver" - Status "Success"',
]
];
return $result;
}
}
// EOF

View File

@ -0,0 +1,214 @@
<?php
$base_dir = realpath(__DIR__ . '/..');
$config['install_dir'] = $base_dir;
// Base observium includes
include(__DIR__ . '/../includes/defaults.inc.php');
//include(dirname(__FILE__) . '/../config.php'); // Do not include user editable config here
include(__DIR__ . '/../includes/common.inc.php');
include(__DIR__ . '/../includes/definitions.inc.php');
//include(dirname(__FILE__) . '/data/test_definitions.inc.php'); // Fake definitions for testing
include(__DIR__ . '/../includes/functions.inc.php');
class IncludesTemplatesTest extends \PHPUnit\Framework\TestCase
{
/**
* @dataProvider providerSimpleTemplate
* @group simple_template
*/
public function testSimpleTemplate($template, $keys, $result)
{
$this->assertSame($result, simple_template($template, $keys));
}
public function providerSimpleTemplate()
{
$return = array(
// One line php-style comments
array(
'<h1>{{title}}</h1> // just something interesting... #or ^not...',
array('title' => 'A Comedy of Errors'),
'<h1>A Comedy of Errors</h1>'
),
// Multiline php-style comments
array(
'/**
* just something interesting... #or ^not...
*/
<h1>{{title}}</h1>
/**
* just something interesting... #or ^not...
*/',
array('title' => 'A Comedy of Errors'),
' <h1>A Comedy of Errors</h1>'.PHP_EOL
),
// Var not exist
array(
'<h1>{{title}}</h1>',
array('non_exist' => 'A Comedy of Errors'),
'<h1></h1>'
),
);
$templates_dir = dirname(__FILE__) . '/templates';
foreach (scandir($templates_dir) as $dir)
{
$json = $templates_dir.'/'.$dir.'/'.$dir.'.json';
if ($dir != '.' && $dir != '..' && is_dir($templates_dir.'/'.$dir) && is_file($json))
{
$template = $templates_dir.'/'.$dir.'/'.$dir.'.mustache';
$result = $templates_dir.'/'.$dir.'/'.$dir.'.txt';
$return[] = array(
file_get_contents($template),
json_decode(file_get_contents($json), TRUE),
file_get_contents($result)
);
}
}
return $return;
}
/**
* @dataProvider providerArrayToXML
* @group templates
*/
public function testArrayToXML($array, $result)
{
$xml = new SimpleXMLElement('<template/>');
array_to_xml($array, $xml);
$this->assertSame($result, $xml->asXML());
}
public function providerArrayToXML()
{
return array(
array(
// Array
array('entity' => 'sensor',
'name' => 'temp',
'message' => 'temp alarm',
'severity' => 'crit',
'suppress_recovery' => 0,
'delay' => 0,
'conditions_and' => 0,
'conditions' => array('sensor_value > 30',
'sensor_value < 1'),
'conditions_complex' => 'sensor_value > 30 OR sensor_value < 1',
'associations' => array(array('device' => array('hostname match timos*'),
'entity' => array('sensor_class is temperature')),
array('device' => array('hostname match cisco*'),
'entity' => array('sensor_class is temperature')))),
// XML
'<?xml version="1.0"?>
<template><entity>sensor</entity><name>temp</name><message>temp alarm</message><severity>crit</severity><suppress_recovery>0</suppress_recovery><delay>0</delay><conditions_and>0</conditions_and><conditions>sensor_value &gt; 30</conditions><conditions>sensor_value &lt; 1</conditions><conditions_complex>sensor_value &gt; 30 OR sensor_value &lt; 1</conditions_complex><associations><device>hostname match timos*</device><entity>sensor_class is temperature</entity></associations><associations><device>hostname match cisco*</device><entity>sensor_class is temperature</entity></associations></template>
'
),
);
}
/**
* @dataProvider providerGenerateTemplate
* @group templates
*/
public function testGenerateTemplate($type, $array, $result)
{
$template = generate_template($type, $array);
$template = preg_replace('/<template type="' . $type . '".+?>/', '<template>', $template);
$this->assertSame($result, $template);
}
public function providerGenerateTemplate()
{
$alert_array = array(
'alert_test_id' => '4',
'entity_type' => 'sensor',
'alert_name' => 'temp',
'alert_message' => 'temp alarm',
'conditions' => array(
array('value' => '30', 'condition' => '>', 'metric' => 'sensor_value'),
array('value' => '1', 'condition' => '<', 'metric' => 'sensor_value')),
'and' => '0',
'severity' => 'crit',
'delay' => '0',
'alerter' => 'default',
'enable' => '1',
'show_frontpage' => '1',
'suppress_recovery' => '0',
'ignore_until' => NULL,
'associations' => array(
array('entity_type' => 'sensor',
'entity_attribs' => array(
array('value' => 'temperature',
'condition' => 'is',
'attrib' => 'sensor_class')),
'device_attribs' => array(
array('value' => 'timos*',
'condition' => 'match',
'attrib' => 'hostname'))),
array('entity_type' => 'sensor',
'entity_attribs' => array(
array('value' => 'temperature',
'condition' => 'is',
'attrib' => 'sensor_class')),
'device_attribs' => array(
array('value' => 'cisco*',
'condition' => 'match',
'attrib' => 'hostname')))),
);
$alert_array1 = array(
'alert_test_id' => '7',
'entity_type' => 'storage',
'alert_name' => 'stor_perc_85',
'alert_message' => 'Storage exceeds 85% of disk capacity',
'conditions' => array(
array('value' => '85', 'condition' => 'ge', 'metric' => 'storage_perc')),
'and' => '1',
'severity' => 'crit',
'delay' => '0',
'alerter' => 'default',
'enable' => '1',
'show_frontpage' => '1',
'suppress_recovery' => '0',
'ignore_until' => NULL,
'associations' => array(
array('entity_type' => 'storage',
'entity_attribs' => array(
array('value' => 'hrStorageFixedDisk',
'condition' => 'equals',
'metric' => 'storage_perc',
'attrib' => 'storage_type')),
'device_attribs' => array(
array ('value' => NULL,
'condition' => NULL,
'metric' => 'storage_perc',
'attrib' => '*')))),
);
return array(
array(
'alert',
// Array
$alert_array,
// XML
'<?xml version="1.0"?>
<template><entity_type>sensor</entity_type><name>temp</name><message>temp alarm</message><severity>crit</severity><suppress_recovery>0</suppress_recovery><delay>0</delay><conditions_and>0</conditions_and><conditions>sensor_value &gt; 30</conditions><conditions>sensor_value &lt; 1</conditions><conditions_complex>sensor_value &gt; 30 OR sensor_value &lt; 1</conditions_complex><associations><device>hostname match timos*</device><entity>sensor_class is temperature</entity></associations><associations><device>hostname match cisco*</device><entity>sensor_class is temperature</entity></associations></template>
'
),
array(
'alert',
// Array
$alert_array1,
// XML
'<?xml version="1.0"?>
<template><entity_type>storage</entity_type><name>stor_perc_85</name><message>Storage exceeds 85% of disk capacity</message><severity>crit</severity><suppress_recovery>0</suppress_recovery><delay>0</delay><conditions_and>1</conditions_and><conditions>storage_perc ge 85</conditions><conditions_complex>storage_perc ge 85</conditions_complex><associations><device>*</device><entity>storage_type equals hrStorageFixedDisk</entity></associations></template>
'
),
);
}
}
// EOF

317
tests/SnmpDataTest.php Normal file
View File

@ -0,0 +1,317 @@
<?php
//define('OBS_DEBUG', 2);
define('OBS_QUIET', TRUE); // Disable any additional output from tests
ini_set('opcache.enable', 0);
include(__DIR__ . '/../includes/sql-config.inc.php');
//include(dirname(__FILE__) . '/../includes/defaults.inc.php');
//include(dirname(__FILE__) . '/../config.php');
//include(dirname(__FILE__) . '/../includes/definitions.inc.php');
//include(dirname(__FILE__) . '/../includes/functions.inc.php');
/**
* How install snmpsim:
* sudo pip install snmpsim
*
* How to record basic (system) data for oses:
* snmprec.py --agent-udpv4-endpoint=x.x.x.x --community=<community> --start-oid=1.3.6.1.2.1 --stop-oid=1.3.6.1.2.1.1 --output-file=osname-y.snmprec
*
* where: x.x.x.x - your device ip or hostname,
* osname - os name, same as in observium definitions
* y - any numeric string, just for multiple tests for same os name
*
* for other options and snmp params, see: snmprec.py --help
*/
// SNMPsim tests
$snmpsimd_ip = $config['tests']['snmpsim_ip'] ?: '127.0.0.1';
$snmpsimd_port = $config['tests']['snmpsim_port'] ?: 16111;
$snmpsimd_data = $config['tests']['snmpsim_dir'] . '/os';
if (is_dir($snmpsimd_data)) {
snmpsimd_init($snmpsimd_data);
sleep(2); // Sleep before tests, because snmpsimd can get stuck
}
/**
* do not use this, if you not know what is it :P
* but if use, uncomment config.php include!
*/
/*
foreach (dbFetchRows("SELECT * FROM `devices`") as $entry)
{
if (!$entry['status'] || $entry['disabled']) { continue; }
//if ($entry['status'] || $entry['disabled']) { continue; }
//if (!$entry['disabled']) { continue; }
if (strstr($entry['sysDescr'], "\n"))
{
// Multiline strings need convert to HEX
$data = '1.3.6.1.2.1.1.1.0|4x|' . str2hex($entry['sysDescr']) . PHP_EOL;
} else {
$data = '1.3.6.1.2.1.1.1.0|4|' . $entry['sysDescr'] . PHP_EOL;
}
$data .= '1.3.6.1.2.1.1.2.0|6|' . ltrim($entry['sysObjectID'], '.'); // . PHP_EOL;
//$data .= '1.3.6.1.6.3.10.2.1.1|4x|' . $entry['snmpEngineID'];
$i = 1;
while (is_file($snmpsimd_data . '/new/' . $entry['os'] . '-' . $i . '.snmprec'))
{
$i++;
}
file_put_contents($snmpsimd_data . '/new/' . $entry['os'] . '-' . $i . '.snmprec', $data);
}
exit;
*/
class SnmpDataTest extends \PHPUnit\Framework\TestCase
{
protected function setUp(): void
{
global $snmpsimd_ip, $snmpsimd_port, $snmpsimd_data;
if (!OBS_SNMPSIMD)
{
$this->markTestSkipped('SNMPsimd unavailable or daemon not started, test skipped.');
}
if (!defined('OBS_TEST_SNMP'))
{
// Just get first snmp request, for alive snmpsimd
$device = build_initial_device_array($snmpsimd_ip, 'ios-1', 'v2c', $snmpsimd_port, 'udp');
snmp_get_oid($device, '.1.3.6.1.2.1.1.2.0');
define('OBS_TEST_SNMP', snmp_status());
} else {
$device = build_initial_device_array($snmpsimd_ip, 'ios-1', 'v2c', $snmpsimd_port, 'udp');
snmp_get_oid($device, '.1.3.6.1.2.1.1.2.0');
}
}
/**
* @dataProvider providerGetDeviceOS
* @group os
*/
public function testGetDeviceOS($os, $community)
{
global $snmpsimd_ip, $snmpsimd_port;
$device = build_initial_device_array($snmpsimd_ip, $community, 'v2c', $snmpsimd_port, 'udp');
$device['snmp_timeout'] = 2;
$device['snmp_retries'] = 1;
//var_dump($device);
// Clear cache before get_device_os()
unset($GLOBALS['cache_snmp']);
$this->assertSame($os, get_device_os($device));
}
public function providerGetDeviceOS()
{
global $snmpsimd_data;
$results = array();
if ($handle = opendir($snmpsimd_data))
{
while (false !== ($file = readdir($handle)))
{
if (filetype($snmpsimd_data . '/' . $file) === 'file' && preg_match('/^(?<community>(?<os>[\S]+?)(?:\-\d+)?)\.snmprec$/', $file, $matches))
{
//if (!str_starts($matches['os'], 'zyxel')) { continue; }
$results[] = array($matches['os'], $matches['community']);
}
}
closedir($handle);
}
//var_dump($results);
return $results;
}
/**
* Redetect OS (simulate previously incorrect detected os, or changed)
*
* @dataProvider providerGetDeviceOS2
* @group os-changed
*/
public function testGetDeviceOS2($community, $old_os)
{
global $snmpsimd_ip, $snmpsimd_port;
$device = build_initial_device_array($snmpsimd_ip, $community, 'v2c', $snmpsimd_port, 'udp');
$device['snmp_timeout'] = 2;
$device['snmp_retries'] = 1;
if ($old_os)
{
$device['os'] = $old_os;
}
//var_dump($device);
if (preg_match('/^(?<community>(?<os>[\S]+?)(?:\-\d+)?)$/', $community, $matches))
{
$os = $matches['os'];
// Clear cache before get_device_os()
unset($GLOBALS['cache_snmp']);
$this->assertSame($os, get_device_os($device));
}
}
public function providerGetDeviceOS2()
{
return array(
// community/os, old os (incorrect)
array( 'iosxe-1', 'ios'),
array( 'iosxe-2', 'iosxr'),
array( 'iosxe-3', 'linux'),
// Linux based
array( 'engenius-4', 'linux'),
array( 'ddwrt-1', 'linux'),
array( 'ddwrt-2', 'linux'),
array( 'openwrt-1', 'linux'),
array( 'openwrt-2', 'linux'),
array( 'steelhead-1', 'linux'),
array( 'opengear-1', 'linux'),
array( 'epmp-2', 'linux'),
array( 'zxv10-2', 'linux'),
array( 'cumulus-os-1', 'linux'),
array( 'cisco-uc-1', 'linux'),
array( 'ciscosb-nss-1', 'linux'),
array( 'kemp-lb-1', 'linux'),
array( 'exinda-os-1', 'linux'),
array( 'ge-ups-1', 'linux'),
array( 'tplinkap-2', 'linux'),
array( 'tplink-1', 'linux'),
array( 'ciscosb-wl-1', 'linux'),
array( 'ciscosb-rv-1', 'linux'),
array( 'cisco-acano-1', 'linux'),
array( 'ibm-imm-1', 'linux'),
array( 'mcafee-meg-1', 'linux'),
array( 'barracuda-lb-1', 'linux'),
array( 'drac-2', 'linux'),
array( 'sofaware-2', 'linux'),
array( 'dss-1', 'linux'),
array( 'generex-ups-3', 'linux'),
array( 'eltex-voip-1', 'linux'),
array( 'eltex-voip-3', 'openwrt'),
array( 'eltex-gpon-1', 'linux'),
array( 'ge-ups-1', 'linux'),
array( 'qnap-1', 'linux'),
array( 'srm-1', 'linux'),
array( 'dsm-1', 'linux'),
array( 'gaia-1', 'linux'),
array( 'splat-1', 'linux'),
array( 'fireeye-1', 'linux'),
array( 'ddn-1', 'linux'),
array( 'zeustm-1', 'linux'),
array( 'steelhead-1', 'linux'),
array( 'jetnexus-lb-1', 'linux'),
array( 'airos-1', 'linux'),
array( 'airos-af-1', 'linux'),
array( 'unifi-1', 'linux'),
array( 'unifi-2', 'linux'),
array('netgear-readyos-1', 'linux'),
//array('pcoweb-chiller-1', 'linux'),
//array( 'pcoweb-crac-1', 'linux'),
array( 'edgemax-5', 'airos'),
// FreeBSD based
array( 'opnsense-1', 'freebsd'),
array( 'opnsense-2', 'freebsd'),
array( 'monowall-2', 'freebsd'),
array( 'compellent-1', 'freebsd'),
array( 'pfsense-1', 'freebsd'),
array( 'pfsense-2', 'freebsd'),
array( 'nas4free-1', 'freebsd'),
array( 'freenas-1', 'freebsd'),
// Solaris based
array( 'opensolaris-1', 'solaris'),
array( 'openindiana-1', 'solaris'),
// Extreme
array( 'xos-1', 'extremeware'),
array( 'extreme-wlc-1', 'extremeware'),
);
}
/**
* @dataProvider providerIsSNMPable
* @group snmpable
*/
public function testIsSNMPable($os, $test_os, $result)
{
global $snmpsimd_ip, $snmpsimd_port;
foreach (array('v2c', 'v3') as $snmp_version)
//foreach (array('v3') as $snmp_version)
{
switch ($snmp_version)
{
case 'v2c':
$community = $os . '-1';
$device = build_initial_device_array($snmpsimd_ip, $community, $snmp_version, $snmpsimd_port, 'udp');
break;
case 'v3':
$snmp_version = 'v3';
$snmp_v3 = array('authlevel' => 'authPriv',
'authname' => 'simulator',
'authpass' => 'auctoritas',
'authalgo' => 'MD5',
'cryptopass' => 'privatus',
'cryptoalgo' => 'DES');
$device = build_initial_device_array($snmpsimd_ip, NULL, $snmp_version, $snmpsimd_port, 'udp', $snmp_v3);
$device['snmp_context'] = $os . '-1';
break;
}
$device['snmp_timeout'] = 2;
$device['snmp_retries'] = 1;
//var_dump($device);
if ($test_os)
{
$device['os'] = $test_os;
}
if ($result)
{
// good response - int greater than 0
$this->assertGreaterThan(0, isSNMPable($device));
} else {
// bad response return 0
$device['snmp_timeout'] = 1;
$this->assertSame(0, isSNMPable($device));
}
}
}
public function providerIsSNMPable()
{
return array(
// Both sysObjectID.0 and sysUpTime.0 available
array( 'linux', NULL, TRUE), // os not known
array( 'linux', 'linux', TRUE), // known os
array( 'linux', '8734hr7hf3f38', TRUE), // simulate os name changed
// Only sysObjectID.0 available
array( 'ios', NULL, TRUE), // os not known
array( 'ios', 'ios', TRUE), // known os
array( 'ios', '8734hr7hf3f38', TRUE), // simulate os name changed
// Only sysUpTime.0 available
array( 'airport', NULL, TRUE), // os not known
array( 'airport', 'airport', TRUE), // known os
array( 'airport', '8734hr7hf3f38', TRUE), // simulate os name changed
// sysObjectID.0 and sysUpTime.0 not exist
array('hikvision-cam', NULL, TRUE), // os not known
array('hikvision-cam', 'hikvision-cam', TRUE), // known os
array('hikvision-cam', '8734hr7hf3f38', TRUE), // simulate os name changed
// Simulate not snmpable device
array('hikvision-XXX', NULL, FALSE), // os not known
array('hikvision-XXX', 'hikvision-cam', FALSE), // known os
array('hikvision-XXX', '8734hr7hf3f38', FALSE), // simulate os name changed
);
}
}
// EOF

461
tests/SnmpDataTest2.php Normal file
View File

@ -0,0 +1,461 @@
<?php
//define('OBS_DEBUG', 2);
//define('OBS_QUIET', TRUE); // Disable any additional output from tests
ini_set('opcache.enable', 0);
include(dirname(__FILE__) . '/../includes/sql-config.inc.php');
//include(dirname(__FILE__) . '/../includes/defaults.inc.php');
//include(dirname(__FILE__) . '/../config.php');
//include(dirname(__FILE__) . '/../includes/definitions.inc.php');
//include(dirname(__FILE__) . '/../includes/functions.inc.php');
/**
* How install snmpsim:
* sudo pip install snmpsim
*
* How to record basic (system) data for oses:
* snmprec.py --agent-udpv4-endpoint=x.x.x.x --community=<community> --start-oid=1.3.6.1.2.1 --stop-oid=1.3.6.1.2.1.2 --output-file=osname-y.snmprec
*
* where: x.x.x.x - your device ip or hostname,
* osname - os name, same as in observium definitions
* y - any numeric string, just for multiple tests for same os name
*
* for other options and snmp params, see: snmprec.py --help
*/
// SNMPsim tests
$snmpsimd_ip = isset($config['tests']['snmpsim_ip']) ? $config['tests']['snmpsim_ip'] : '127.0.0.1';
$snmpsimd_port = isset($config['tests']['snmpsim_port']) ? $config['tests']['snmpsim_port'] : 16111;
$snmpsimd_data = $config['tests']['snmpsim_dir'] . '/full';
if (is_dir($snmpsimd_data))
{
snmpsimd_init($snmpsimd_data);
sleep(2); // Sleep before tests, because snmpsimd can get stuck
}
class SnmpDataTest2 extends \PHPUnit\Framework\TestCase
{
protected function setUp(): void
{
global $snmpsimd_ip, $snmpsimd_port, $snmpsimd_data;
if (!OBS_SNMPSIMD)
{
$this->markTestSkipped('SNMPsimd unavailable or daemon not started, test skipped.');
}
// Just get first snmp request, for alive snmpsimd
$device = build_initial_device_array($snmpsimd_ip, 'ios-1', 'v2c', $snmpsimd_port, 'udp');
snmp_get_oid($device, '.1.3.6.1.2.1.1.2.0');
}
/**
* @dataProvider providerSnmp_Get
* @group snmpget
*/
public function testSnmp_Get($community, $options, $oid, $mib, $result)
{
global $snmpsimd_ip, $snmpsimd_port;
$device = build_initial_device_array($snmpsimd_ip, $community, 'v2c', $snmpsimd_port, 'udp');
$device['snmp_timeout'] = 2;
$device['snmp_retries'] = 1;
//var_dump($device);
$this->assertSame($result, snmp_get($device, $oid, $options, $mib));
}
public function providerSnmp_Get()
{
$community_ftos = 'ftos-9.10';
return array(
// each single option
// BGP4-MIB::bgpLocalAs.0 = Wrong Type (should be INTEGER): Gauge32: 20282
array( $community_ftos, '', 'bgpLocalAs.0', 'BGP4-MIB', 'BGP4-MIB::bgpLocalAs.0 = Wrong Type (should be INTEGER): Gauge32: 20282'),
array( $community_ftos, '-OU', 'bgpLocalAs.0', 'BGP4-MIB', 'BGP4-MIB::bgpLocalAs.0 = Wrong Type (should be INTEGER): Gauge32: 20282'),
array( $community_ftos, '-Os', 'bgpLocalAs.0', 'BGP4-MIB', 'bgpLocalAs.0 = Wrong Type (should be INTEGER): Gauge32: 20282'),
array( $community_ftos, '-On', 'bgpLocalAs.0', 'BGP4-MIB', '.1.3.6.1.2.1.15.2.0 = Wrong Type (should be INTEGER): Gauge32: 20282'),
array( $community_ftos, '-Oq', 'bgpLocalAs.0', 'BGP4-MIB', 'BGP4-MIB::bgpLocalAs.0 Wrong Type (should be INTEGER): 20282'),
array( $community_ftos, '-OQ', 'bgpLocalAs.0', 'BGP4-MIB', 'BGP4-MIB::bgpLocalAs.0 = 20282'),
array( $community_ftos, '-Ov', 'bgpLocalAs.0', 'BGP4-MIB', 'Gauge32: 20282'),
// options set
array( $community_ftos, '-Oqv', 'bgpLocalAs.0', 'BGP4-MIB', '20282'), // Oh, we clean this too
array( $community_ftos, '-OQv', 'bgpLocalAs.0', 'BGP4-MIB', '20282'),
// BGP4-MIB::bgpPeerState.64.72.74.193 = INTEGER: idle(1)
array( $community_ftos, '', 'bgpPeerState.64.72.74.193', 'BGP4-MIB', 'BGP4-MIB::bgpPeerState.64.72.74.193 = INTEGER: idle(1)'),
array( $community_ftos, '-Oe', 'bgpPeerState.64.72.74.193', 'BGP4-MIB', 'BGP4-MIB::bgpPeerState.64.72.74.193 = INTEGER: 1'),
array( $community_ftos, '-On', 'bgpPeerState.64.72.74.193', 'BGP4-MIB', '.1.3.6.1.2.1.15.3.1.2.64.72.74.193 = INTEGER: idle(1)'),
array( $community_ftos, '-OX', 'bgpPeerState.64.72.74.193', 'BGP4-MIB', 'BGP4-MIB::bgpPeerState[64.72.74.193] = INTEGER: idle(1)'),
// SNMPv2-MIB::sysUpTime.0 = Timeticks: (3972400096) 459 days, 18:26:40.96
array( $community_ftos, '', 'sysUpTime.0', 'SNMPv2-MIB', 'SNMPv2-MIB::sysUpTime.0 = Timeticks: (3972400096) 459 days, 18:26:40.96'),
array( $community_ftos, '-Ot', 'sysUpTime.0', 'SNMPv2-MIB', 'SNMPv2-MIB::sysUpTime.0 = 3972400096'),
array( $community_ftos, '-Ov', 'sysUpTime.0', 'SNMPv2-MIB', 'Timeticks: (3972400096) 459 days, 18:26:40.96'),
array( $community_ftos, '-OQv', 'sysUpTime.0', 'SNMPv2-MIB', '459:18:26:40.96'),
array( $community_ftos, '-OQvt', 'sysUpTime.0', 'SNMPv2-MIB', '3972400096'),
// SNMPv2-MIB::sysObjectID.0 = OID: SNMPv2-SMI::enterprises.6027.1.3.14
array( $community_ftos, '', 'sysObjectID.0', 'SNMPv2-MIB', 'SNMPv2-MIB::sysObjectID.0 = OID: SNMPv2-SMI::enterprises.6027.1.3.14'),
array( $community_ftos, '-On', 'sysObjectID.0', 'SNMPv2-MIB', '.1.3.6.1.2.1.1.2.0 = OID: .1.3.6.1.4.1.6027.1.3.14'),
array( $community_ftos, '-OQv', 'sysObjectID.0', 'SNMPv2-MIB', 'SNMPv2-SMI::enterprises.6027.1.3.14'),
array( $community_ftos, '-OQvn', 'sysObjectID.0', 'SNMPv2-MIB', '.1.3.6.1.4.1.6027.1.3.14'),
//array( '', '', '', '', ''),
);
}
/**
* @dataProvider providerSnmpGetOid
* @group snmpget
*/
public function testSnmpGetOid($community, $flags, $oid, $mib, $result)
{
global $snmpsimd_ip, $snmpsimd_port;
$device = build_initial_device_array($snmpsimd_ip, $community, 'v2c', $snmpsimd_port, 'udp');
$device['snmp_timeout'] = 2;
$device['snmp_retries'] = 1;
//var_dump($device);
$test = snmp_get_oid($device, $oid, $mib, NULL, $flags);
//var_dump($test);
$this->assertSame($result, $test);
}
/**
* @dataProvider providerSnmpGetOid
* @group snmpget
*/
public function testSnmpGetNextOid($community, $flags, $oid, $mib, $result)
{
global $snmpsimd_ip, $snmpsimd_port;
$device = build_initial_device_array($snmpsimd_ip, $community, 'v2c', $snmpsimd_port, 'udp');
$device['snmp_timeout'] = 2;
$device['snmp_retries'] = 1;
//var_dump($device);
list($oid, $index) = explode('.', $oid, 2); // Split oid and index parts
if ($index === '0') // Fot test purpose use only Oids with first index is 0
{
$test = snmp_getnext_oid($device, $oid, $mib, NULL, $flags);
//var_dump($test);
if (strpos($result, '::') !== FALSE) {
// snmpgetnext have different output from snmpget
list(, $result) = explode('::', $result, 2);
}
$this->assertSame($result, $test);
}
}
public function providerSnmpGetOid()
{
$community_ftos = 'ftos-9.10';
$community_ubuntu = 'ubuntu-16.04';
// Note, here \r\n as line ends!
$sysdescr_ftos = "Dell Networking OS\r\n";
$sysdescr_ftos .= "Operating System Version: 2.0\r\n";
$sysdescr_ftos .= "Application Software Version: 9.9(0.0P9)\r\n";
$sysdescr_ftos .= "Series: S4810\r\n";
$sysdescr_ftos .= "Copyright (c) 1999-2015 by Dell Inc. All Rights Reserved.\r\n";
$sysdescr_ftos .= "Build Time: Thu Feb 4 06:57:34 2016";
$sysdescr_ftos_hex = "\"44 65 6C 6C 20 4E 65 74 77 6F 72 6B 69 6E 67 20 ";
$sysdescr_ftos_hex .= "4F 53 0D 0A 4F 70 65 72 61 74 69 6E 67 20 53 79 ";
$sysdescr_ftos_hex .= "73 74 65 6D 20 56 65 72 73 69 6F 6E 3A 20 32 2E ";
$sysdescr_ftos_hex .= "30 0D 0A 41 70 70 6C 69 63 61 74 69 6F 6E 20 53 ";
$sysdescr_ftos_hex .= "6F 66 74 77 61 72 65 20 56 65 72 73 69 6F 6E 3A ";
$sysdescr_ftos_hex .= "20 39 2E 39 28 30 2E 30 50 39 29 0D 0A 53 65 72 ";
$sysdescr_ftos_hex .= "69 65 73 3A 20 53 34 38 31 30 0D 0A 43 6F 70 79 ";
$sysdescr_ftos_hex .= "72 69 67 68 74 20 28 63 29 20 31 39 39 39 2D 32 ";
$sysdescr_ftos_hex .= "30 31 35 20 62 79 20 44 65 6C 6C 20 49 6E 63 2E ";
$sysdescr_ftos_hex .= "20 41 6C 6C 20 52 69 67 68 74 73 20 52 65 73 65 ";
$sysdescr_ftos_hex .= "72 76 65 64 2E 0D 0A 42 75 69 6C 64 20 54 69 6D ";
$sysdescr_ftos_hex .= "65 3A 20 54 68 75 20 46 65 62 20 20 34 20 30 36 ";
$sysdescr_ftos_hex .= "3A 35 37 3A 33 34 20 32 30 31 36 \"";
$distro_ubuntu_hex = "4C 69 6E 75 78 7C 34 2E 34 2E 30 2D 37 37 2D 67 ";
$distro_ubuntu_hex .= "65 6E 65 72 69 63 7C 61 6D 64 36 34 7C 55 62 75 ";
$distro_ubuntu_hex .= "6E 74 75 7C 31 36 2E 30 34 7C 6B 76 6D ";
return array(
// BGP4-MIB::bgpLocalAs.0 = Wrong Type (should be INTEGER): Gauge32: 20282
array( $community_ftos, 0, 'bgpLocalAs.0', 'BGP4-MIB', '20282'),
array( $community_ftos, OBS_QUOTES_TRIM, 'bgpLocalAs.0', 'BGP4-MIB', '20282'), // default
// BGP4-MIB::bgpPeerState.64.72.74.193 = INTEGER: idle(1)
array( $community_ftos, 0, 'bgpPeerState.64.72.74.193', 'BGP4-MIB', 'idle'),
array( $community_ftos, OBS_SNMP_ENUM, 'bgpPeerState.64.72.74.193', 'BGP4-MIB', '1'),
array( $community_ftos, OBS_SNMP_NUMERIC, 'bgpPeerState.64.72.74.193', 'BGP4-MIB', 'idle'),
array( $community_ftos, OBS_SNMP_HEX, 'bgpPeerState.64.72.74.193', 'BGP4-MIB', 'idle'),
// SNMP-FRAMEWORK-MIB::snmpEngineID.0 = Hex-STRING: 00 00 17 8B 02 00 00 01 E8 8A E1 12
array( $community_ftos, OBS_QUOTES_TRIM, 'snmpEngineID.0', 'SNMP-FRAMEWORK-MIB', '00 00 17 8B 02 00 00 01 E8 8A E1 12 '), // DO NOT CLEAN SPACEs HERE!
// SNMPv2-MIB::sysUpTime.0 = Timeticks: (3972400096) 459 days, 18:26:40.96
array( $community_ftos, OBS_QUOTES_TRIM, 'sysUpTime.0', 'SNMPv2-MIB', '459:18:26:40.96'),
//array( $community_ftos, OBS_SNMP_NUMERIC, 'sysUpTime.0', 'SNMPv2-MIB', '3972400096'),
array( $community_ftos, OBS_SNMP_NUMERIC, 'sysUpTime.0', 'SNMPv2-MIB', '459:18:26:40.96'),
// sysDescr (see above)
array( $community_ftos, OBS_QUOTES_TRIM, 'sysDescr.0', 'SNMPv2-MIB', $sysdescr_ftos),
array( $community_ftos, OBS_SNMP_HEX, 'sysDescr.0', 'SNMPv2-MIB', $sysdescr_ftos_hex),
array( $community_ftos, OBS_QUOTES_TRIM | OBS_SNMP_HEX, 'sysDescr.0', 'SNMPv2-MIB', trim($sysdescr_ftos_hex, '"')),
// SNMPv2-MIB::sysObjectID.0 = OID: SNMPv2-SMI::enterprises.6027.1.3.14
array( $community_ftos, OBS_QUOTES_TRIM, 'sysObjectID.0', 'SNMPv2-MIB', 'SNMPv2-SMI::enterprises.6027.1.3.14'),
array( $community_ftos, OBS_SNMP_NUMERIC, 'sysObjectID.0', 'SNMPv2-MIB', '.1.3.6.1.4.1.6027.1.3.14'),
//NET-SNMP-EXTEND-MIB::nsExtendOutLine."distro".1 = STRING: Linux|4.4.0-77-generic|amd64|Ubuntu|16.04|kvm
array($community_ubuntu, OBS_QUOTES_TRIM, 'nsExtendOutLine."distro".1', 'NET-SNMP-EXTEND-MIB', 'Linux|4.4.0-77-generic|amd64|Ubuntu|16.04|kvm'),
array($community_ubuntu, OBS_SNMP_ALL_HEX, 'nsExtendOutLine."distro".1', 'NET-SNMP-EXTEND-MIB', $distro_ubuntu_hex),
);
}
/**
* @dataProvider providerSnmp_UTF8
* @group snmpfix
*/
public function testSnmp_UTF8($community, $oid, $mib, $result)
{
global $snmpsimd_ip, $snmpsimd_port;
$device = build_initial_device_array($snmpsimd_ip, 'utf8-test', 'v2c', $snmpsimd_port, 'udp');
$device['snmp_timeout'] = 2;
$device['snmp_retries'] = 1;
//var_dump($device);
$test = snmp_get_oid($device, 'sysLocation.0', 'SNMPv2-MIB');
if ($test === 'Rue de la M..tallurgie, 4530 Villers-le-Bouillet, Belgi..')
{
$this->markTestSkipped('On this system used NET-SNMP with UTF8 issue. See: https://sourceforge.net/p/net-snmp/bugs/2815/');
}
$device['snmp_community'] = $community;
$test = snmp_get_oid($device, $oid, $mib);
//var_dump($test);
$this->assertSame($result, snmp_fix_string($test));
}
public function providerSnmp_UTF8()
{
$sysDescr = 'D-Link £¨India£© Limited Internetwork Operating System Software
1705 Series Software, Version 1.0.7F (BASE), RELEASE SOFTWARE
Copyright (c) 2007 by D-Link £¨India£© Limited
Compiled: 2008-01-31 14:25:20 by system, Image text-base: 0x10000
ROM: System Bootstrap, Version 0.8.2
Serial num:000H682000022, ID num:009675
System image file is "Router.bin"
DI-1705 (RISC)
32768K bytes of memory,3584K bytes of flash';
$sysLocation = 'Rue de la Métallurgie, 4530 Villers-le-Bouillet, België';
$sysContact = '"Майк Ступалов" <mike@observium.ru>';
return array(
array('utf8-test', 'sysDescr.0', 'SNMPv2-MIB', $sysDescr),
array('utf8-test', 'sysLocation.0', 'SNMPv2-MIB', $sysLocation),
array('utf8-test', 'sysContact.0', 'SNMPv2-MIB', $sysContact),
array('utf8-test2', 'ifAlias.556', 'IF-MIB', 'Cust: Priva De-Lier AZURE SID00829 {XC.1001.2015036}â'),
array('utf8-test3', 'ifAlias.521', 'IF-MIB', 'Tránsito Cogent (AS174): IPv4 1-182344586, IPv6 1-182344646;'),
);
}
/**
* @dataProvider providerSnmpGetMultiOid
* @group snmpget
*/
public function testSnmpGetMultiOid($community, $flags, $oid, $mib, $result)
{
global $snmpsimd_ip, $snmpsimd_port;
$device = build_initial_device_array($snmpsimd_ip, $community, 'v2c', $snmpsimd_port, 'udp');
$device['snmp_timeout'] = 2;
$device['snmp_retries'] = 1;
//var_dump($device);
$test = snmp_get_multi_oid($device, $oid, array(), $mib, NULL, $flags);
//var_dump($test);
$this->assertSame($result, $test);
}
public function providerSnmpGetMultiOid()
{
$community_ftos = 'ftos-9.10';
$community_ubuntu = 'ubuntu-16.04';
return array(
array( $community_ftos, OBS_QUOTES_TRIM, 'sysUpTime.0 sysObjectID.0', 'SNMPv2-MIB',
array(0 => array('sysUpTime' => '459:18:26:40.96', 'sysObjectID' => 'enterprises.6027.1.3.14'))
),
array( $community_ftos, OBS_QUOTES_TRIM, array('sysUpTime.0', 'sysObjectID.0'), 'SNMPv2-MIB',
array(0 => array('sysUpTime' => '459:18:26:40.96', 'sysObjectID' => 'enterprises.6027.1.3.14'))
),
array( $community_ftos, OBS_SNMP_ALL_NUMERIC, 'sysUpTime.0 sysObjectID.0', 'SNMPv2-MIB',
array('.1.3.6.1.2.1.1.3.0' => '459:18:26:40.96', '.1.3.6.1.2.1.1.2.0' => '.1.3.6.1.4.1.6027.1.3.14')
),
array( $community_ftos, OBS_SNMP_ALL_NUMERIC_INDEX, 'sysUpTime.0 sysObjectID.0', 'SNMPv2-MIB',
array(0 => array('sysUpTime' => '459:18:26:40.96', 'sysObjectID' => 'enterprises.6027.1.3.14'))
),
array( $community_ftos, OBS_QUOTES_TRIM, 'bgpLocalAs.0 bgpPeerState.64.72.74.193', 'BGP4-MIB',
array(0 => array('bgpLocalAs' => '20282'), '64.72.74.193' => array('bgpPeerState' => 'idle'))
),
array( $community_ftos, OBS_SNMP_ALL_ENUM, 'bgpLocalAs.0 bgpPeerState.64.72.74.193', 'BGP4-MIB',
array(0 => array('bgpLocalAs' => '20282'), '64.72.74.193' => array('bgpPeerState' => '1'))
),
//NET-SNMP-EXTEND-MIB::nsExtendOutLine."distro".1 = STRING: Linux|4.4.0-77-generic|amd64|Ubuntu|16.04|kvm
array( $community_ubuntu, OBS_QUOTES_TRIM, 'nsExtendOutLine."distro".1 nsExtendOutput1Line."distro"', 'NET-SNMP-EXTEND-MIB',
array('distro.1' => array('nsExtendOutLine' => 'Linux|4.4.0-77-generic|amd64|Ubuntu|16.04|kvm'),
'distro' => array('nsExtendOutput1Line' => 'Linux|4.4.0-77-generic|amd64|Ubuntu|16.04|kvm'))
),
);
}
/**
* @dataProvider providerSnmpWalkBareOid
* @group snmpwalk_new
*/
public function testSnmpWalkBareOid($community, $flags, $oids, $mib, $result_file)
{
global $snmpsimd_ip, $snmpsimd_port;
$device = build_initial_device_array($snmpsimd_ip, $community, 'v2c', $snmpsimd_port, 'udp');
$device['snmp_timeout'] = 2;
$device['snmp_retries'] = 1;
//var_dump($device);
$test = array();
foreach ((array)$oids as $oid)
{
$test = snmpwalk_cache_bare_oid($device, $oid, $test, $mib, NULL, $flags);
}
//echo PHP_EOL . json_encode($test, JSON_PRETTY_PRINT) . PHP_EOL;
//var_dump($test);
//$result = array();
// Fetch array from JSON file
$result = json_decode(file_get_contents(dirname(__FILE__) . '/data/snmp/' . $result_file), TRUE);
$this->assertSame($result, $test);
}
public function providerSnmpWalkBareOid()
{
$community = 'delta-rt-ups';
return array(
array( $community, OBS_QUOTES_TRIM, array('dupsIdentManufacturer', 'dupsIdentModel', 'wrongOid'), 'DeltaUPS-MIB',
'snmp_walk_bare_oid-1.json' // Link to result json
),
);
}
/**
* @dataProvider providerSnmpWalkMultiPartOid
* @group snmpwalk_new
*/
public function testSnmpWalkMultiPartOid($community, $flags, $oids, $mib, $result_file)
{
global $snmpsimd_ip, $snmpsimd_port;
$device = build_initial_device_array($snmpsimd_ip, $community, 'v2c', $snmpsimd_port, 'udp');
$device['snmp_timeout'] = 2;
$device['snmp_retries'] = 1;
//var_dump($device);
$test = array();
foreach ((array)$oids as $oid)
{
$test = snmpwalk_multipart_oid($device, $oid, $test, $mib, NULL, $flags);
}
//echo PHP_EOL . json_encode($test, JSON_PRETTY_PRINT) . PHP_EOL;
//var_dump($test);
//$result = array();
// Fetch array from JSON file
$result = json_decode(file_get_contents(dirname(__FILE__) . '/data/snmp/' . $result_file), TRUE);
$this->assertSame($result, $test);
}
public function providerSnmpWalkMultiPartOid()
{
$community_ftos = 'ftos-9.10';
$community_ubuntu = 'ubuntu-16.04';
$community_lldp = 'lldp1';
$community_prnt = 'prnt';
$community_delta = 'delta-rt-ups';
return array(
array( $community_ftos, OBS_QUOTES_TRIM, array('bgpPeerState', 'bgpPeerAdminStatus', 'wrongOid'), 'BGP4-MIB',
'snmp_walk_multipart_oid-1.json' // Link to result json
),
array( $community_ftos, OBS_SNMP_ALL_NUMERIC, array('bgpPeerState', 'bgpPeerAdminStatus', 'wrongOid'), 'BGP4-MIB',
'snmp_walk_multipart_oid-2.json' // Link to result json
),
array( $community_ubuntu, OBS_QUOTES_TRIM, array('nsExtendNumEntries', 'nsExtendOutputFull', 'nsExtendOutLine'), 'NET-SNMP-EXTEND-MIB',
'snmp_walk_multipart_oid-3.json' // Link to result json
),
array( $community_delta, OBS_SNMP_ALL | OBS_SNMP_NOINDEX, array('dupsIdentManufacturer', 'dupsIdentModel'), 'DeltaUPS-MIB',
'snmp_walk_multipart_oid-4.json' // Link to result json
),
array( $community_lldp, OBS_SNMP_ALL_MULTILINE, array('lldpRemChassisIdSubtype', 'lldpRemChassisId', 'lldpRemPortIdSubtype', 'lldpRemPortId', 'lldpRemPortDesc', 'lldpRemSysName', 'lldpRemSysDesc'), 'LLDP-MIB',
'snmp_walk_multipart_lldp-1.json' // Link to result json
),
array( $community_lldp, OBS_SNMP_ALL, array('lldpRemChassisIdSubtype', 'lldpRemChassisId', 'lldpRemPortIdSubtype', 'lldpRemPortId', 'lldpRemPortDesc', 'lldpRemSysName'), 'LLDP-MIB',
'snmp_walk_multipart_lldp-2.json' // Link to result json
),
array( $community_prnt, OBS_SNMP_ALL, array('prtMarkerSuppliesDescription', 'prtMarkerSuppliesType', 'prtMarkerSuppliesLevel'), 'Printer-MIB',
'snmp_walk_multipart_prnt-1.json' // Link to result json
),
array( $community_prnt, OBS_SNMP_ALL_MULTILINE, array('prtMarkerSuppliesDescription', 'prtMarkerSuppliesType', 'prtMarkerSuppliesLevel'), 'Printer-MIB',
'snmp_walk_multipart_prnt-2.json' // Link to result json
),
array( $community_prnt, OBS_SNMP_ALL_ASCII, array('prtMarkerSuppliesDescription', 'prtMarkerSuppliesType', 'prtMarkerSuppliesLevel'), 'Printer-MIB',
'snmp_walk_multipart_prnt-3.json' // Link to result json
),
);
}
/**
* @dataProvider providerSnmpWalkThreepartOid
* @group snmpwalk
*/
public function testSnmpWalkThreepartOid($community, $flags, $oid, $mib, $result_file)
{
global $snmpsimd_ip, $snmpsimd_port;
$device = build_initial_device_array($snmpsimd_ip, $community, 'v2c', $snmpsimd_port, 'udp');
$device['snmp_timeout'] = 2;
$device['snmp_retries'] = 1;
//var_dump($device);
$test = snmpwalk_cache_threepart_oid($device, $oid, array(), $mib, NULL, $flags);
//echo PHP_EOL . json_encode($test, JSON_PRETTY_PRINT) . PHP_EOL;
//var_dump($test);
// Fetch array from JSON file
$result = json_decode(file_get_contents(dirname(__FILE__) . '/data/snmp/' . $result_file), TRUE);
$this->assertSame($result, $test);
}
public function providerSnmpWalkThreepartOid()
{
$community_lldp1 = 'lldp1';
$community_lldp2 = 'lldp2';
return array(
array( $community_lldp1, OBS_SNMP_ALL, 'lldpRemSysDesc', 'LLDP-MIB',
'snmp_walk_lldp-1.json' // Link to result json
),
array( $community_lldp1, OBS_SNMP_ALL | OBS_SNMP_CONCAT, 'lldpRemSysDesc', 'LLDP-MIB',
'snmp_walk_lldp-2.json' // Link to result json
),
array( $community_lldp2, OBS_SNMP_ALL, 'lldpRemSysDesc', 'LLDP-MIB',
'snmp_walk_lldp-3.json' // Link to result json
),
array( $community_lldp2, OBS_SNMP_ALL | OBS_SNMP_CONCAT, 'lldpRemSysDesc', 'LLDP-MIB',
'snmp_walk_lldp-3.json' // Link to result json
),
);
}
}
// EOF

View File

@ -0,0 +1,48 @@
<?php
class CsvFileIterator implements Iterator
{
protected $file;
protected $key = 0;
protected $current;
public function __construct($file)
{
$this->file = fopen($file, 'r');
}
public function __destruct()
{
fclose($this->file);
}
public function rewind()
{
rewind($this->file);
$this->current = fgetcsv($this->file);
$this->key = 0;
}
public function valid()
{
return !feof($this->file);
}
public function key()
{
return $this->key;
}
public function current()
{
return $this->current;
}
public function next()
{
$this->current = fgetcsv($this->file);
$this->key++;
}
}
// EOF

View File

@ -0,0 +1,202 @@
entPhysicalDescr.1 = Cisco Systems Cisco 7600 4-slot Chassis System
entPhysicalDescr.2 = Cisco Systems Cisco 7600 4-slot Physical Slot
entPhysicalDescr.3 = Cisco Systems Cisco 7600 4-slot Physical Slot
entPhysicalDescr.4 = Cisco Systems Cisco 7600 4-slot Physical Slot
entPhysicalDescr.5 = Cisco Systems Cisco 7600 4-slot Physical Slot
entPhysicalDescr.6 = Cisco Systems Cisco 7600 4-slot backplane
entPhysicalDescr.7 = fan-tray 1 fan-fail Sensor
entPhysicalDescr.8 = Container of Fan FRU
entPhysicalDescr.9 = High Speed Fan Module for CISCO7604 1
entPhysicalDescr.10 = Container of Container of Power Supply
entPhysicalDescr.11 = Container of Power Supply
entPhysicalDescr.12 = 2700W AC power supply for CISCO7604 1
entPhysicalDescr.13 = power-supply 1 fan-fail Sensor
entPhysicalDescr.14 = power-supply 1 power-output-fail Sensor
entPhysicalDescr.15 = power-supply 1 power-input Sensor
entPhysicalDescr.20 = power-supply 1 incompatible with fan Sensor
entPhysicalDescr.21 = Container of Power Supply
entPhysicalDescr.22 = 2700W AC power supply for CISCO7604 2
entPhysicalDescr.23 = power-supply 2 fan-fail Sensor
entPhysicalDescr.24 = power-supply 2 power-output-fail Sensor
entPhysicalDescr.25 = power-supply 2 power-input Sensor
entPhysicalDescr.30 = power-supply 2 incompatible with fan Sensor
entPhysicalDescr.31 = Sensor for counting number of OK Clocks
entPhysicalDescr.32 = Container of VTT
entPhysicalDescr.33 = Container of Clock
entPhysicalDescr.34 = OSR-7600 Clock FRU 1
entPhysicalDescr.35 = OSR-7600 Clock FRU 1 OK Sensor
entPhysicalDescr.36 = OSR-7600 Clock FRU 1 In Using Sensor
entPhysicalDescr.37 = Container of Clock
entPhysicalDescr.38 = OSR-7600 Clock FRU 2
entPhysicalDescr.39 = OSR-7600 Clock FRU 2 OK Sensor
entPhysicalDescr.40 = OSR-7600 Clock FRU 2 In Using Sensor
entPhysicalDescr.1000 = WS-SUP720-3BXL 2 ports Supervisor Engine 720 Rev. 5.6
entPhysicalDescr.1001 = CPU of Switching Processor
entPhysicalDescr.1002 = Supervisor module 1 power-output-fail Sensor
entPhysicalDescr.1003 = Supervisor module 1 insufficient cooling Sensor
entPhysicalDescr.1004 = Supervisor module 1 fan-upgrade required Sensor
entPhysicalDescr.1005 = Supervisor module 1 outlet temperature Sensor
entPhysicalDescr.1006 = Supervisor module 1 inlet temperature Sensor
entPhysicalDescr.1007 = Supervisor module 1 device-1 temperature Sensor
entPhysicalDescr.1008 = Supervisor module 1 device-2 temperature Sensor
entPhysicalDescr.1009 = Supervisor module 1 asic 1 temperature Sensor
entPhysicalDescr.1010 = Supervisor module 1 asic 2 temperature Sensor
entPhysicalDescr.1011 = Supervisor module 1 asic 3 temperature Sensor
entPhysicalDescr.1012 = Supervisor module 1 asic 4 temperature Sensor
entPhysicalDescr.1013 = Supervisor module 1 asic 5 temperature Sensor
entPhysicalDescr.1014 = Supervisor module 1 asic 6 temperature Sensor
entPhysicalDescr.1015 = MSFC Container
entPhysicalDescr.1016 = WS-SUP720 MSFC3 Daughterboard Rev. 3.1
entPhysicalDescr.1017 = CPU of Routing Processor
entPhysicalDescr.1018 = module 1 RP outlet temperature Sensor
entPhysicalDescr.1019 = module 1 RP inlet temperature Sensor
entPhysicalDescr.1020 = Switching Engine Container
entPhysicalDescr.1021 = WS-F6K-PFC3BXL Policy Feature Card 3 Rev. 1.8
entPhysicalDescr.1022 = module 1 EARL outlet temperature Sensor
entPhysicalDescr.1023 = module 1 EARL inlet temperature Sensor
entPhysicalDescr.1024 = Transceiver Port Gi1/1
entPhysicalDescr.1025 = Transceiver Port Container Gi1/1
entPhysicalDescr.1037 = Transceiver Port Gi1/2
entPhysicalDescr.1038 = Transceiver Port Container Gi1/2
entPhysicalDescr.1050 = 10/100/1000BaseT Gi1/2
entPhysicalDescr.2000 = WS-X6704-10GE CEF720 4 port 10-Gigabit Ethernet Rev. 2.7
entPhysicalDescr.2001 = module 2 power-output-fail Sensor
entPhysicalDescr.2002 = module 2 insufficient cooling Sensor
entPhysicalDescr.2003 = module 2 outlet temperature Sensor
entPhysicalDescr.2004 = module 2 inlet temperature Sensor
entPhysicalDescr.2005 = Switching Engine Container
entPhysicalDescr.2006 = WS-F6700-CFC Centralized Forwarding Card Rev. 4.1
entPhysicalDescr.2007 = CPU of Centralized Forwarding Card
entPhysicalDescr.2008 = Transceiver Port Te2/1
entPhysicalDescr.2009 = 10-Gigabit Transceiver Port Container Te2/1
entPhysicalDescr.2010 = Transceiver 10Gbase-ER Te2/1
entPhysicalDescr.2011 = TenGigabitEthernet2/1 Module Temperature Sensor
entPhysicalDescr.2012 = TenGigabitEthernet2/1 Supply Voltage Sensor
entPhysicalDescr.2013 = TenGigabitEthernet2/1 Bias Current Sensor
entPhysicalDescr.2014 = TenGigabitEthernet2/1 Transmit Power Sensor
entPhysicalDescr.2015 = TenGigabitEthernet2/1 Receive Power Sensor
entPhysicalDescr.2021 = Transceiver Port Te2/2
entPhysicalDescr.2022 = 10-Gigabit Transceiver Port Container Te2/2
entPhysicalDescr.2023 = Transceiver 10Gbase-ER Te2/2
entPhysicalDescr.2024 = TenGigabitEthernet2/2 Module Temperature Sensor
entPhysicalDescr.2025 = TenGigabitEthernet2/2 Supply Voltage Sensor
entPhysicalDescr.2026 = TenGigabitEthernet2/2 Bias Current Sensor
entPhysicalDescr.2027 = TenGigabitEthernet2/2 Transmit Power Sensor
entPhysicalDescr.2028 = TenGigabitEthernet2/2 Receive Power Sensor
entPhysicalDescr.2034 = Transceiver Port Te2/3
entPhysicalDescr.2035 = 10-Gigabit Transceiver Port Container Te2/3
entPhysicalDescr.2036 = Transceiver 10Gbase-ER Te2/3
entPhysicalDescr.2037 = TenGigabitEthernet2/3 Module Temperature Sensor
entPhysicalDescr.2038 = TenGigabitEthernet2/3 Supply Voltage Sensor
entPhysicalDescr.2039 = TenGigabitEthernet2/3 Bias Current Sensor
entPhysicalDescr.2040 = TenGigabitEthernet2/3 Transmit Power Sensor
entPhysicalDescr.2041 = TenGigabitEthernet2/3 Receive Power Sensor
entPhysicalDescr.2047 = Transceiver Port Te2/4
entPhysicalDescr.2048 = 10-Gigabit Transceiver Port Container Te2/4
entPhysicalDescr.3000 = WS-X6748-SFP CEF720 48 port 1000mb SFP Rev. 1.10
entPhysicalDescr.3001 = module 4 power-output-fail Sensor
entPhysicalDescr.3002 = module 4 insufficient cooling Sensor
entPhysicalDescr.3003 = module 4 outlet temperature Sensor
entPhysicalDescr.3004 = module 4 inlet temperature Sensor
entPhysicalDescr.3005 = module 4 device-1 temperature Sensor
entPhysicalDescr.3006 = module 4 device-2 temperature Sensor
entPhysicalDescr.3007 = Switching Engine Container
entPhysicalDescr.3008 = WS-F6700-CFC Centralized Forwarding Card Rev. 4.0
entPhysicalDescr.3009 = CPU of Centralized Forwarding Card
entPhysicalDescr.3010 = Transceiver Port Gi4/1
entPhysicalDescr.3011 = Transceiver Port Container Gi4/1
entPhysicalDescr.3023 = Transceiver Port Gi4/2
entPhysicalDescr.3024 = Transceiver Port Container Gi4/2
entPhysicalDescr.3036 = Transceiver Port Gi4/3
entPhysicalDescr.3037 = Transceiver Port Container Gi4/3
entPhysicalDescr.3049 = Transceiver Port Gi4/4
entPhysicalDescr.3050 = Transceiver Port Container Gi4/4
entPhysicalDescr.3051 = Transceiver 1000BaseT Gi4/4
entPhysicalDescr.3062 = Transceiver Port Gi4/5
entPhysicalDescr.3063 = Transceiver Port Container Gi4/5
entPhysicalDescr.3075 = Transceiver Port Gi4/6
entPhysicalDescr.3076 = Transceiver Port Container Gi4/6
entPhysicalDescr.3088 = Transceiver Port Gi4/7
entPhysicalDescr.3089 = Transceiver Port Container Gi4/7
entPhysicalDescr.3101 = Transceiver Port Gi4/8
entPhysicalDescr.3102 = Transceiver Port Container Gi4/8
entPhysicalDescr.3114 = Transceiver Port Gi4/9
entPhysicalDescr.3115 = Transceiver Port Container Gi4/9
entPhysicalDescr.3127 = Transceiver Port Gi4/10
entPhysicalDescr.3128 = Transceiver Port Container Gi4/10
entPhysicalDescr.3140 = Transceiver Port Gi4/11
entPhysicalDescr.3141 = Transceiver Port Container Gi4/11
entPhysicalDescr.3153 = Transceiver Port Gi4/12
entPhysicalDescr.3154 = Transceiver Port Container Gi4/12
entPhysicalDescr.3166 = Transceiver Port Gi4/13
entPhysicalDescr.3167 = Transceiver Port Container Gi4/13
entPhysicalDescr.3179 = Transceiver Port Gi4/14
entPhysicalDescr.3180 = Transceiver Port Container Gi4/14
entPhysicalDescr.3192 = Transceiver Port Gi4/15
entPhysicalDescr.3193 = Transceiver Port Container Gi4/15
entPhysicalDescr.3205 = Transceiver Port Gi4/16
entPhysicalDescr.3206 = Transceiver Port Container Gi4/16
entPhysicalDescr.3218 = Transceiver Port Gi4/17
entPhysicalDescr.3219 = Transceiver Port Container Gi4/17
entPhysicalDescr.3231 = Transceiver Port Gi4/18
entPhysicalDescr.3232 = Transceiver Port Container Gi4/18
entPhysicalDescr.3244 = Transceiver Port Gi4/19
entPhysicalDescr.3245 = Transceiver Port Container Gi4/19
entPhysicalDescr.3257 = Transceiver Port Gi4/20
entPhysicalDescr.3258 = Transceiver Port Container Gi4/20
entPhysicalDescr.3270 = Transceiver Port Gi4/21
entPhysicalDescr.3271 = Transceiver Port Container Gi4/21
entPhysicalDescr.3283 = Transceiver Port Gi4/22
entPhysicalDescr.3284 = Transceiver Port Container Gi4/22
entPhysicalDescr.3296 = Transceiver Port Gi4/23
entPhysicalDescr.3297 = Transceiver Port Container Gi4/23
entPhysicalDescr.3309 = Transceiver Port Gi4/24
entPhysicalDescr.3310 = Transceiver Port Container Gi4/24
entPhysicalDescr.3322 = Transceiver Port Gi4/25
entPhysicalDescr.3323 = Transceiver Port Container Gi4/25
entPhysicalDescr.3335 = Transceiver Port Gi4/26
entPhysicalDescr.3336 = Transceiver Port Container Gi4/26
entPhysicalDescr.3348 = Transceiver Port Gi4/27
entPhysicalDescr.3349 = Transceiver Port Container Gi4/27
entPhysicalDescr.3361 = Transceiver Port Gi4/28
entPhysicalDescr.3362 = Transceiver Port Container Gi4/28
entPhysicalDescr.3374 = Transceiver Port Gi4/29
entPhysicalDescr.3375 = Transceiver Port Container Gi4/29
entPhysicalDescr.3387 = Transceiver Port Gi4/30
entPhysicalDescr.3388 = Transceiver Port Container Gi4/30
entPhysicalDescr.3400 = Transceiver Port Gi4/31
entPhysicalDescr.3401 = Transceiver Port Container Gi4/31
entPhysicalDescr.3413 = Transceiver Port Gi4/32
entPhysicalDescr.3414 = Transceiver Port Container Gi4/32
entPhysicalDescr.3426 = Transceiver Port Gi4/33
entPhysicalDescr.3427 = Transceiver Port Container Gi4/33
entPhysicalDescr.3439 = Transceiver Port Gi4/34
entPhysicalDescr.3440 = Transceiver Port Container Gi4/34
entPhysicalDescr.3452 = Transceiver Port Gi4/35
entPhysicalDescr.3453 = Transceiver Port Container Gi4/35
entPhysicalDescr.3465 = Transceiver Port Gi4/36
entPhysicalDescr.3466 = Transceiver Port Container Gi4/36
entPhysicalDescr.3478 = Transceiver Port Gi4/37
entPhysicalDescr.3479 = Transceiver Port Container Gi4/37
entPhysicalDescr.3491 = Transceiver Port Gi4/38
entPhysicalDescr.3492 = Transceiver Port Container Gi4/38
entPhysicalDescr.3504 = Transceiver Port Gi4/39
entPhysicalDescr.3505 = Transceiver Port Container Gi4/39
entPhysicalDescr.3517 = Transceiver Port Gi4/40
entPhysicalDescr.3518 = Transceiver Port Container Gi4/40
entPhysicalDescr.3530 = Transceiver Port Gi4/41
entPhysicalDescr.3531 = Transceiver Port Container Gi4/41
entPhysicalDescr.3543 = Transceiver Port Gi4/42
entPhysicalDescr.3544 = Transceiver Port Container Gi4/42
entPhysicalDescr.3556 = Transceiver Port Gi4/43
entPhysicalDescr.3557 = Transceiver Port Container Gi4/43
entPhysicalDescr.3569 = Transceiver Port Gi4/44
entPhysicalDescr.3570 = Transceiver Port Container Gi4/44
entPhysicalDescr.3582 = Transceiver Port Gi4/45
entPhysicalDescr.3583 = Transceiver Port Container Gi4/45
entPhysicalDescr.3595 = Transceiver Port Gi4/46
entPhysicalDescr.3596 = Transceiver Port Container Gi4/46
entPhysicalDescr.3608 = Transceiver Port Gi4/47
entPhysicalDescr.3609 = Transceiver Port Container Gi4/47
entPhysicalDescr.3621 = Transceiver Port Gi4/48
entPhysicalDescr.3622 = Transceiver Port Container Gi4/48

View File

@ -0,0 +1,202 @@
entPhysicalName.1 = CISCO7604
entPhysicalName.2 = Physical Slot 1
entPhysicalName.3 = Physical Slot 2
entPhysicalName.4 = Physical Slot 3
entPhysicalName.5 = Physical Slot 4
entPhysicalName.6 = Backplane
entPhysicalName.7 = fan-tray 1 fan-fail Sensor
entPhysicalName.8 = Container of Fan FRU 1
entPhysicalName.9 = FAN-MOD-4HS 1
entPhysicalName.10 = Container of Container of Power Supply
entPhysicalName.11 = Container of Power Supply 1
entPhysicalName.12 = PS 1 PWR-2700-AC/4
entPhysicalName.13 = power-supply 1 fan-fail Sensor
entPhysicalName.14 = power-supply 1 power-output-fail Sensor
entPhysicalName.15 = power-supply 1 power-input Sensor
entPhysicalName.20 = power-supply 1 incompatible with fan Sensor
entPhysicalName.21 = Container of Power Supply 2
entPhysicalName.22 = PS 2 PWR-2700-AC/4
entPhysicalName.23 = power-supply 2 fan-fail Sensor
entPhysicalName.24 = power-supply 2 power-output-fail Sensor
entPhysicalName.25 = power-supply 2 power-input Sensor
entPhysicalName.30 = power-supply 2 incompatible with fan Sensor
entPhysicalName.31 = Sensor for counting number of OK Clocks
entPhysicalName.32 = Container of VTT 0
entPhysicalName.33 = Container of Clock 1
entPhysicalName.34 = CLK-7600 1
entPhysicalName.35 = Clock 1 OK Sensor
entPhysicalName.36 = Clock 1 In Using Sensor
entPhysicalName.37 = Container of Clock 2
entPhysicalName.38 = CLK-7600 2
entPhysicalName.39 = Clock 2 OK Sensor
entPhysicalName.40 = Clock 2 In Using Sensor
entPhysicalName.1000 = module 1
entPhysicalName.1001 = CPU of Switching Processor 1
entPhysicalName.1002 = power output-fail 1
entPhysicalName.1003 = switch insufficient-cooling 1
entPhysicalName.1004 = switch fanUpgrade-required 1
entPhysicalName.1005 = temperature outlet 1
entPhysicalName.1006 = temperature inlet 1
entPhysicalName.1007 = temperature device-1 1
entPhysicalName.1008 = temperature device-2 1
entPhysicalName.1009 = module 1 asic 1 temperature Sensor
entPhysicalName.1010 = module 1 asic 2 temperature Sensor
entPhysicalName.1011 = module 1 asic 3 temperature Sensor
entPhysicalName.1012 = module 1 asic 4 temperature Sensor
entPhysicalName.1013 = module 1 asic 5 temperature Sensor
entPhysicalName.1014 = module 1 asic 6 temperature Sensor
entPhysicalName.1015 = MSFC Container 1
entPhysicalName.1016 = msfc sub-module of 1
entPhysicalName.1017 = CPU of Routing Processor 1
entPhysicalName.1018 = module 1 RP outlet temperature Sensor
entPhysicalName.1019 = module 1 RP inlet temperature Sensor
entPhysicalName.1020 = Switching Engine Container 1
entPhysicalName.1021 = switching engine sub-module of 1
entPhysicalName.1022 = module 1 EARL outlet temperature Sensor
entPhysicalName.1023 = module 1 EARL inlet temperature Sensor
entPhysicalName.1024 = Gi1/1
entPhysicalName.1025 = Transceiver Port Container Gi1/1
entPhysicalName.1037 = Gi1/2
entPhysicalName.1038 = Transceiver Port Container Gi1/2
entPhysicalName.1050 = 10/100/1000BaseT Gi1/2
entPhysicalName.2000 = module 2
entPhysicalName.2001 = power output-fail 2
entPhysicalName.2002 = switch insufficient-cooling 2
entPhysicalName.2003 = temperature outlet 2
entPhysicalName.2004 = temperature inlet 2
entPhysicalName.2005 = Switching Engine Container 2
entPhysicalName.2006 = switching engine sub-module of 2
entPhysicalName.2007 = CPU of Sub-Module 2 CFC Card
entPhysicalName.2008 = Te2/1
entPhysicalName.2009 = 10-Gigabit Transceiver Port Container Te2/1
entPhysicalName.2010 = Transceiver Te2/1
entPhysicalName.2011 = Te2/1 Module Temperature Sensor
entPhysicalName.2012 = Te2/1 Supply Voltage Sensor
entPhysicalName.2013 = Te2/1 Bias Current Sensor
entPhysicalName.2014 = Te2/1 Transmit Power Sensor
entPhysicalName.2015 = Te2/1 Receive Power Sensor
entPhysicalName.2021 = Te2/2
entPhysicalName.2022 = 10-Gigabit Transceiver Port Container Te2/2
entPhysicalName.2023 = Transceiver Te2/2
entPhysicalName.2024 = Te2/2 Module Temperature Sensor
entPhysicalName.2025 = Te2/2 Supply Voltage Sensor
entPhysicalName.2026 = Te2/2 Bias Current Sensor
entPhysicalName.2027 = Te2/2 Transmit Power Sensor
entPhysicalName.2028 = Te2/2 Receive Power Sensor
entPhysicalName.2034 = Te2/3
entPhysicalName.2035 = 10-Gigabit Transceiver Port Container Te2/3
entPhysicalName.2036 = Transceiver Te2/3
entPhysicalName.2037 = Te2/3 Module Temperature Sensor
entPhysicalName.2038 = Te2/3 Supply Voltage Sensor
entPhysicalName.2039 = Te2/3 Bias Current Sensor
entPhysicalName.2040 = Te2/3 Transmit Power Sensor
entPhysicalName.2041 = Te2/3 Receive Power Sensor
entPhysicalName.2047 = Te2/4
entPhysicalName.2048 = 10-Gigabit Transceiver Port Container Te2/4
entPhysicalName.3000 = module 4
entPhysicalName.3001 = power output-fail 4
entPhysicalName.3002 = switch insufficient-cooling 4
entPhysicalName.3003 = temperature outlet 4
entPhysicalName.3004 = temperature inlet 4
entPhysicalName.3005 = temperature device-1 4
entPhysicalName.3006 = temperature device-2 4
entPhysicalName.3007 = Switching Engine Container 4
entPhysicalName.3008 = switching engine sub-module of 4
entPhysicalName.3009 = CPU of Sub-Module 4 CFC Card
entPhysicalName.3010 = Gi4/1
entPhysicalName.3011 = Transceiver Port Container Gi4/1
entPhysicalName.3023 = Gi4/2
entPhysicalName.3024 = Transceiver Port Container Gi4/2
entPhysicalName.3036 = Gi4/3
entPhysicalName.3037 = Transceiver Port Container Gi4/3
entPhysicalName.3049 = Gi4/4
entPhysicalName.3050 = Transceiver Port Container Gi4/4
entPhysicalName.3051 = Transceiver Gi4/4
entPhysicalName.3062 = Gi4/5
entPhysicalName.3063 = Transceiver Port Container Gi4/5
entPhysicalName.3075 = Gi4/6
entPhysicalName.3076 = Transceiver Port Container Gi4/6
entPhysicalName.3088 = Gi4/7
entPhysicalName.3089 = Transceiver Port Container Gi4/7
entPhysicalName.3101 = Gi4/8
entPhysicalName.3102 = Transceiver Port Container Gi4/8
entPhysicalName.3114 = Gi4/9
entPhysicalName.3115 = Transceiver Port Container Gi4/9
entPhysicalName.3127 = Gi4/10
entPhysicalName.3128 = Transceiver Port Container Gi4/10
entPhysicalName.3140 = Gi4/11
entPhysicalName.3141 = Transceiver Port Container Gi4/11
entPhysicalName.3153 = Gi4/12
entPhysicalName.3154 = Transceiver Port Container Gi4/12
entPhysicalName.3166 = Gi4/13
entPhysicalName.3167 = Transceiver Port Container Gi4/13
entPhysicalName.3179 = Gi4/14
entPhysicalName.3180 = Transceiver Port Container Gi4/14
entPhysicalName.3192 = Gi4/15
entPhysicalName.3193 = Transceiver Port Container Gi4/15
entPhysicalName.3205 = Gi4/16
entPhysicalName.3206 = Transceiver Port Container Gi4/16
entPhysicalName.3218 = Gi4/17
entPhysicalName.3219 = Transceiver Port Container Gi4/17
entPhysicalName.3231 = Gi4/18
entPhysicalName.3232 = Transceiver Port Container Gi4/18
entPhysicalName.3244 = Gi4/19
entPhysicalName.3245 = Transceiver Port Container Gi4/19
entPhysicalName.3257 = Gi4/20
entPhysicalName.3258 = Transceiver Port Container Gi4/20
entPhysicalName.3270 = Gi4/21
entPhysicalName.3271 = Transceiver Port Container Gi4/21
entPhysicalName.3283 = Gi4/22
entPhysicalName.3284 = Transceiver Port Container Gi4/22
entPhysicalName.3296 = Gi4/23
entPhysicalName.3297 = Transceiver Port Container Gi4/23
entPhysicalName.3309 = Gi4/24
entPhysicalName.3310 = Transceiver Port Container Gi4/24
entPhysicalName.3322 = Gi4/25
entPhysicalName.3323 = Transceiver Port Container Gi4/25
entPhysicalName.3335 = Gi4/26
entPhysicalName.3336 = Transceiver Port Container Gi4/26
entPhysicalName.3348 = Gi4/27
entPhysicalName.3349 = Transceiver Port Container Gi4/27
entPhysicalName.3361 = Gi4/28
entPhysicalName.3362 = Transceiver Port Container Gi4/28
entPhysicalName.3374 = Gi4/29
entPhysicalName.3375 = Transceiver Port Container Gi4/29
entPhysicalName.3387 = Gi4/30
entPhysicalName.3388 = Transceiver Port Container Gi4/30
entPhysicalName.3400 = Gi4/31
entPhysicalName.3401 = Transceiver Port Container Gi4/31
entPhysicalName.3413 = Gi4/32
entPhysicalName.3414 = Transceiver Port Container Gi4/32
entPhysicalName.3426 = Gi4/33
entPhysicalName.3427 = Transceiver Port Container Gi4/33
entPhysicalName.3439 = Gi4/34
entPhysicalName.3440 = Transceiver Port Container Gi4/34
entPhysicalName.3452 = Gi4/35
entPhysicalName.3453 = Transceiver Port Container Gi4/35
entPhysicalName.3465 = Gi4/36
entPhysicalName.3466 = Transceiver Port Container Gi4/36
entPhysicalName.3478 = Gi4/37
entPhysicalName.3479 = Transceiver Port Container Gi4/37
entPhysicalName.3491 = Gi4/38
entPhysicalName.3492 = Transceiver Port Container Gi4/38
entPhysicalName.3504 = Gi4/39
entPhysicalName.3505 = Transceiver Port Container Gi4/39
entPhysicalName.3517 = Gi4/40
entPhysicalName.3518 = Transceiver Port Container Gi4/40
entPhysicalName.3530 = Gi4/41
entPhysicalName.3531 = Transceiver Port Container Gi4/41
entPhysicalName.3543 = Gi4/42
entPhysicalName.3544 = Transceiver Port Container Gi4/42
entPhysicalName.3556 = Gi4/43
entPhysicalName.3557 = Transceiver Port Container Gi4/43
entPhysicalName.3569 = Gi4/44
entPhysicalName.3570 = Transceiver Port Container Gi4/44
entPhysicalName.3582 = Gi4/45
entPhysicalName.3583 = Transceiver Port Container Gi4/45
entPhysicalName.3595 = Gi4/46
entPhysicalName.3596 = Transceiver Port Container Gi4/46
entPhysicalName.3608 = Gi4/47
entPhysicalName.3609 = Transceiver Port Container Gi4/47
entPhysicalName.3621 = Gi4/48
entPhysicalName.3622 = Transceiver Port Container Gi4/48

View File

@ -0,0 +1,407 @@
entPhysicalDescr.1 = Cisco Systems, Inc. WS-C4510R+E 10 slot switch
entPhysicalDescr.2 = WS-C4510R+E 10 slot switch chassis slot
entPhysicalDescr.3 = WS-C4510R+E 10 slot switch chassis slot
entPhysicalDescr.4 = WS-C4510R+E 10 slot switch chassis slot
entPhysicalDescr.5 = WS-C4510R+E 10 slot switch chassis slot
entPhysicalDescr.6 = WS-C4510R+E 10 slot switch chassis slot
entPhysicalDescr.7 = WS-C4510R+E 10 slot switch chassis slot
entPhysicalDescr.8 = WS-C4510R+E 10 slot switch chassis slot
entPhysicalDescr.9 = WS-C4510R+E 10 slot switch chassis slot
entPhysicalDescr.10 = WS-C4510R+E 10 slot switch chassis slot
entPhysicalDescr.11 = WS-C4510R+E 10 slot switch chassis slot
entPhysicalDescr.12 = WS-C4510R+E 10 slot switch backplane
entPhysicalDescr.13 = Container of Fan Tray
entPhysicalDescr.14 = FanTray
entPhysicalDescr.15 = Container of Container of Power Supply
entPhysicalDescr.16 = Container of Power Supply
entPhysicalDescr.17 = Power Supply ( AC 2800W )
entPhysicalDescr.18 = Power Supply Fan Sensor
entPhysicalDescr.19 = Container of Power Supply
entPhysicalDescr.20 = Power Supply ( AC 2800W )
entPhysicalDescr.21 = Power Supply Fan Sensor
entPhysicalDescr.22 = Clock Module
entPhysicalDescr.23 = Mux Buffers for Redundancy Logic
entPhysicalDescr.24 = Mux Buffers for Redundancy Logic
entPhysicalDescr.25 = Mux Buffers for Redundancy Logic
entPhysicalDescr.26 = Mux Buffers for Redundancy Logic
entPhysicalDescr.27 = Mux Buffers for Redundancy Logic
entPhysicalDescr.28 = Mux Buffers for Redundancy Logic
entPhysicalDescr.29 = Mux Buffers for Redundancy Logic
entPhysicalDescr.30 = Mux Buffers for Redundancy Logic
entPhysicalDescr.1000 = 10/100/1000BaseT (RJ45)+V E Series with 48 10/100/1000 baseT Premium PoE ports (Cisco/IEEE)
entPhysicalDescr.1001 = Gigabit Ethernet Port
entPhysicalDescr.1002 = Gigabit Ethernet Port
entPhysicalDescr.1003 = Gigabit Ethernet Port
entPhysicalDescr.1004 = Gigabit Ethernet Port
entPhysicalDescr.1005 = Gigabit Ethernet Port
entPhysicalDescr.1006 = Gigabit Ethernet Port
entPhysicalDescr.1007 = Gigabit Ethernet Port
entPhysicalDescr.1008 = Gigabit Ethernet Port
entPhysicalDescr.1009 = Gigabit Ethernet Port
entPhysicalDescr.1010 = Gigabit Ethernet Port
entPhysicalDescr.1011 = Gigabit Ethernet Port
entPhysicalDescr.1012 = Gigabit Ethernet Port
entPhysicalDescr.1013 = Gigabit Ethernet Port
entPhysicalDescr.1014 = Gigabit Ethernet Port
entPhysicalDescr.1015 = Gigabit Ethernet Port
entPhysicalDescr.1016 = Gigabit Ethernet Port
entPhysicalDescr.1017 = Gigabit Ethernet Port
entPhysicalDescr.1018 = Gigabit Ethernet Port
entPhysicalDescr.1019 = Gigabit Ethernet Port
entPhysicalDescr.1020 = Gigabit Ethernet Port
entPhysicalDescr.1021 = Gigabit Ethernet Port
entPhysicalDescr.1022 = Gigabit Ethernet Port
entPhysicalDescr.1023 = Gigabit Ethernet Port
entPhysicalDescr.1024 = Gigabit Ethernet Port
entPhysicalDescr.1025 = Gigabit Ethernet Port
entPhysicalDescr.1026 = Gigabit Ethernet Port
entPhysicalDescr.1027 = Gigabit Ethernet Port
entPhysicalDescr.1028 = Gigabit Ethernet Port
entPhysicalDescr.1029 = Gigabit Ethernet Port
entPhysicalDescr.1030 = Gigabit Ethernet Port
entPhysicalDescr.1031 = Gigabit Ethernet Port
entPhysicalDescr.1032 = Gigabit Ethernet Port
entPhysicalDescr.1033 = Gigabit Ethernet Port
entPhysicalDescr.1034 = Gigabit Ethernet Port
entPhysicalDescr.1035 = Gigabit Ethernet Port
entPhysicalDescr.1036 = Gigabit Ethernet Port
entPhysicalDescr.1037 = Gigabit Ethernet Port
entPhysicalDescr.1038 = Gigabit Ethernet Port
entPhysicalDescr.1039 = Gigabit Ethernet Port
entPhysicalDescr.1040 = Gigabit Ethernet Port
entPhysicalDescr.1041 = Gigabit Ethernet Port
entPhysicalDescr.1042 = Gigabit Ethernet Port
entPhysicalDescr.1043 = Gigabit Ethernet Port
entPhysicalDescr.1044 = Gigabit Ethernet Port
entPhysicalDescr.1045 = Gigabit Ethernet Port
entPhysicalDescr.1046 = Gigabit Ethernet Port
entPhysicalDescr.1047 = Gigabit Ethernet Port
entPhysicalDescr.1048 = Gigabit Ethernet Port
entPhysicalDescr.2000 = 10/100/1000BaseT (RJ45)+V E Series with 48 10/100/1000 baseT Premium PoE ports (Cisco/IEEE)
entPhysicalDescr.2001 = Gigabit Ethernet Port
entPhysicalDescr.2002 = Gigabit Ethernet Port
entPhysicalDescr.2003 = Gigabit Ethernet Port
entPhysicalDescr.2004 = Gigabit Ethernet Port
entPhysicalDescr.2005 = Gigabit Ethernet Port
entPhysicalDescr.2006 = Gigabit Ethernet Port
entPhysicalDescr.2007 = Gigabit Ethernet Port
entPhysicalDescr.2008 = Gigabit Ethernet Port
entPhysicalDescr.2009 = Gigabit Ethernet Port
entPhysicalDescr.2010 = Gigabit Ethernet Port
entPhysicalDescr.2011 = Gigabit Ethernet Port
entPhysicalDescr.2012 = Gigabit Ethernet Port
entPhysicalDescr.2013 = Gigabit Ethernet Port
entPhysicalDescr.2014 = Gigabit Ethernet Port
entPhysicalDescr.2015 = Gigabit Ethernet Port
entPhysicalDescr.2016 = Gigabit Ethernet Port
entPhysicalDescr.2017 = Gigabit Ethernet Port
entPhysicalDescr.2018 = Gigabit Ethernet Port
entPhysicalDescr.2019 = Gigabit Ethernet Port
entPhysicalDescr.2020 = Gigabit Ethernet Port
entPhysicalDescr.2021 = Gigabit Ethernet Port
entPhysicalDescr.2022 = Gigabit Ethernet Port
entPhysicalDescr.2023 = Gigabit Ethernet Port
entPhysicalDescr.2024 = Gigabit Ethernet Port
entPhysicalDescr.2025 = Gigabit Ethernet Port
entPhysicalDescr.2026 = Gigabit Ethernet Port
entPhysicalDescr.2027 = Gigabit Ethernet Port
entPhysicalDescr.2028 = Gigabit Ethernet Port
entPhysicalDescr.2029 = Gigabit Ethernet Port
entPhysicalDescr.2030 = Gigabit Ethernet Port
entPhysicalDescr.2031 = Gigabit Ethernet Port
entPhysicalDescr.2032 = Gigabit Ethernet Port
entPhysicalDescr.2033 = Gigabit Ethernet Port
entPhysicalDescr.2034 = Gigabit Ethernet Port
entPhysicalDescr.2035 = Gigabit Ethernet Port
entPhysicalDescr.2036 = Gigabit Ethernet Port
entPhysicalDescr.2037 = Gigabit Ethernet Port
entPhysicalDescr.2038 = Gigabit Ethernet Port
entPhysicalDescr.2039 = Gigabit Ethernet Port
entPhysicalDescr.2040 = Gigabit Ethernet Port
entPhysicalDescr.2041 = Gigabit Ethernet Port
entPhysicalDescr.2042 = Gigabit Ethernet Port
entPhysicalDescr.2043 = Gigabit Ethernet Port
entPhysicalDescr.2044 = Gigabit Ethernet Port
entPhysicalDescr.2045 = Gigabit Ethernet Port
entPhysicalDescr.2046 = Gigabit Ethernet Port
entPhysicalDescr.2047 = Gigabit Ethernet Port
entPhysicalDescr.2048 = Gigabit Ethernet Port
entPhysicalDescr.3000 = 10/100/1000BaseT (RJ45)+V E Series with 48 10/100/1000 baseT Premium PoE ports (Cisco/IEEE)
entPhysicalDescr.3001 = Gigabit Ethernet Port
entPhysicalDescr.3002 = Gigabit Ethernet Port
entPhysicalDescr.3003 = Gigabit Ethernet Port
entPhysicalDescr.3004 = Gigabit Ethernet Port
entPhysicalDescr.3005 = Gigabit Ethernet Port
entPhysicalDescr.3006 = Gigabit Ethernet Port
entPhysicalDescr.3007 = Gigabit Ethernet Port
entPhysicalDescr.3008 = Gigabit Ethernet Port
entPhysicalDescr.3009 = Gigabit Ethernet Port
entPhysicalDescr.3010 = Gigabit Ethernet Port
entPhysicalDescr.3011 = Gigabit Ethernet Port
entPhysicalDescr.3012 = Gigabit Ethernet Port
entPhysicalDescr.3013 = Gigabit Ethernet Port
entPhysicalDescr.3014 = Gigabit Ethernet Port
entPhysicalDescr.3015 = Gigabit Ethernet Port
entPhysicalDescr.3016 = Gigabit Ethernet Port
entPhysicalDescr.3017 = Gigabit Ethernet Port
entPhysicalDescr.3018 = Gigabit Ethernet Port
entPhysicalDescr.3019 = Gigabit Ethernet Port
entPhysicalDescr.3020 = Gigabit Ethernet Port
entPhysicalDescr.3021 = Gigabit Ethernet Port
entPhysicalDescr.3022 = Gigabit Ethernet Port
entPhysicalDescr.3023 = Gigabit Ethernet Port
entPhysicalDescr.3024 = Gigabit Ethernet Port
entPhysicalDescr.3025 = Gigabit Ethernet Port
entPhysicalDescr.3026 = Gigabit Ethernet Port
entPhysicalDescr.3027 = Gigabit Ethernet Port
entPhysicalDescr.3028 = Gigabit Ethernet Port
entPhysicalDescr.3029 = Gigabit Ethernet Port
entPhysicalDescr.3030 = Gigabit Ethernet Port
entPhysicalDescr.3031 = Gigabit Ethernet Port
entPhysicalDescr.3032 = Gigabit Ethernet Port
entPhysicalDescr.3033 = Gigabit Ethernet Port
entPhysicalDescr.3034 = Gigabit Ethernet Port
entPhysicalDescr.3035 = Gigabit Ethernet Port
entPhysicalDescr.3036 = Gigabit Ethernet Port
entPhysicalDescr.3037 = Gigabit Ethernet Port
entPhysicalDescr.3038 = Gigabit Ethernet Port
entPhysicalDescr.3039 = Gigabit Ethernet Port
entPhysicalDescr.3040 = Gigabit Ethernet Port
entPhysicalDescr.3041 = Gigabit Ethernet Port
entPhysicalDescr.3042 = Gigabit Ethernet Port
entPhysicalDescr.3043 = Gigabit Ethernet Port
entPhysicalDescr.3044 = Gigabit Ethernet Port
entPhysicalDescr.3045 = Gigabit Ethernet Port
entPhysicalDescr.3046 = Gigabit Ethernet Port
entPhysicalDescr.3047 = Gigabit Ethernet Port
entPhysicalDescr.3048 = Gigabit Ethernet Port
entPhysicalDescr.4000 = 10/100/1000BaseT (RJ45)+V E Series with 48 10/100/1000 baseT Premium PoE ports (Cisco/IEEE)
entPhysicalDescr.4001 = Gigabit Ethernet Port
entPhysicalDescr.4002 = Gigabit Ethernet Port
entPhysicalDescr.4003 = Gigabit Ethernet Port
entPhysicalDescr.4004 = Gigabit Ethernet Port
entPhysicalDescr.4005 = Gigabit Ethernet Port
entPhysicalDescr.4006 = Gigabit Ethernet Port
entPhysicalDescr.4007 = Gigabit Ethernet Port
entPhysicalDescr.4008 = Gigabit Ethernet Port
entPhysicalDescr.4009 = Gigabit Ethernet Port
entPhysicalDescr.4010 = Gigabit Ethernet Port
entPhysicalDescr.4011 = Gigabit Ethernet Port
entPhysicalDescr.4012 = Gigabit Ethernet Port
entPhysicalDescr.4013 = Gigabit Ethernet Port
entPhysicalDescr.4014 = Gigabit Ethernet Port
entPhysicalDescr.4015 = Gigabit Ethernet Port
entPhysicalDescr.4016 = Gigabit Ethernet Port
entPhysicalDescr.4017 = Gigabit Ethernet Port
entPhysicalDescr.4018 = Gigabit Ethernet Port
entPhysicalDescr.4019 = Gigabit Ethernet Port
entPhysicalDescr.4020 = Gigabit Ethernet Port
entPhysicalDescr.4021 = Gigabit Ethernet Port
entPhysicalDescr.4022 = Gigabit Ethernet Port
entPhysicalDescr.4023 = Gigabit Ethernet Port
entPhysicalDescr.4024 = Gigabit Ethernet Port
entPhysicalDescr.4025 = Gigabit Ethernet Port
entPhysicalDescr.4026 = Gigabit Ethernet Port
entPhysicalDescr.4027 = Gigabit Ethernet Port
entPhysicalDescr.4028 = Gigabit Ethernet Port
entPhysicalDescr.4029 = Gigabit Ethernet Port
entPhysicalDescr.4030 = Gigabit Ethernet Port
entPhysicalDescr.4031 = Gigabit Ethernet Port
entPhysicalDescr.4032 = Gigabit Ethernet Port
entPhysicalDescr.4033 = Gigabit Ethernet Port
entPhysicalDescr.4034 = Gigabit Ethernet Port
entPhysicalDescr.4035 = Gigabit Ethernet Port
entPhysicalDescr.4036 = Gigabit Ethernet Port
entPhysicalDescr.4037 = Gigabit Ethernet Port
entPhysicalDescr.4038 = Gigabit Ethernet Port
entPhysicalDescr.4039 = Gigabit Ethernet Port
entPhysicalDescr.4040 = Gigabit Ethernet Port
entPhysicalDescr.4041 = Gigabit Ethernet Port
entPhysicalDescr.4042 = Gigabit Ethernet Port
entPhysicalDescr.4043 = Gigabit Ethernet Port
entPhysicalDescr.4044 = Gigabit Ethernet Port
entPhysicalDescr.4045 = Gigabit Ethernet Port
entPhysicalDescr.4046 = Gigabit Ethernet Port
entPhysicalDescr.4047 = Gigabit Ethernet Port
entPhysicalDescr.4048 = Gigabit Ethernet Port
entPhysicalDescr.5000 = Sup 7-E 10GE (SFP+), 1000BaseX (SFP) with 4 SFP+ Ports
entPhysicalDescr.5001 = Port Container
entPhysicalDescr.5002 = Port Container
entPhysicalDescr.5003 = Port Container
entPhysicalDescr.5004 = Port Container
entPhysicalDescr.5005 = SFP-10Gbase-LR
entPhysicalDescr.5006 = SFP-10Gbase-SR
entPhysicalDescr.5021 = TenGigabitEthernet5/1 Module Temperature Sensor
entPhysicalDescr.5022 = TenGigabitEthernet5/2 Module Temperature Sensor
entPhysicalDescr.5025 = TenGigabitEthernet5/1 Supply Voltage Sensor
entPhysicalDescr.5026 = TenGigabitEthernet5/2 Supply Voltage Sensor
entPhysicalDescr.5029 = TenGigabitEthernet5/1 Bias Current Sensor
entPhysicalDescr.5030 = TenGigabitEthernet5/2 Bias Current Sensor
entPhysicalDescr.5033 = TenGigabitEthernet5/1 Transmit Power Sensor
entPhysicalDescr.5034 = TenGigabitEthernet5/2 Transmit Power Sensor
entPhysicalDescr.5037 = TenGigabitEthernet5/1 Receive Power Sensor
entPhysicalDescr.5038 = TenGigabitEthernet5/2 Receive Power Sensor
entPhysicalDescr.6000 = Sup 7-E 10GE (SFP+), 1000BaseX (SFP) with 4 SFP+ Ports
entPhysicalDescr.6001 = Port Container
entPhysicalDescr.6002 = Port Container
entPhysicalDescr.6003 = Port Container
entPhysicalDescr.6004 = Port Container
entPhysicalDescr.6005 = SFP-10Gbase-LR
entPhysicalDescr.6006 = SFP-10Gbase-SR
entPhysicalDescr.6021 = TenGigabitEthernet6/1 Module Temperature Sensor
entPhysicalDescr.6022 = TenGigabitEthernet6/2 Module Temperature Sensor
entPhysicalDescr.6025 = TenGigabitEthernet6/1 Supply Voltage Sensor
entPhysicalDescr.6026 = TenGigabitEthernet6/2 Supply Voltage Sensor
entPhysicalDescr.6029 = TenGigabitEthernet6/1 Bias Current Sensor
entPhysicalDescr.6030 = TenGigabitEthernet6/2 Bias Current Sensor
entPhysicalDescr.6033 = TenGigabitEthernet6/1 Transmit Power Sensor
entPhysicalDescr.6034 = TenGigabitEthernet6/2 Transmit Power Sensor
entPhysicalDescr.6037 = TenGigabitEthernet6/1 Receive Power Sensor
entPhysicalDescr.6038 = TenGigabitEthernet6/2 Receive Power Sensor
entPhysicalDescr.7000 = 10/100/1000BaseT (RJ45)+V E Series with 48 10/100/1000 baseT Premium PoE ports (Cisco/IEEE)
entPhysicalDescr.7001 = Gigabit Ethernet Port
entPhysicalDescr.7002 = Gigabit Ethernet Port
entPhysicalDescr.7003 = Gigabit Ethernet Port
entPhysicalDescr.7004 = Gigabit Ethernet Port
entPhysicalDescr.7005 = Gigabit Ethernet Port
entPhysicalDescr.7006 = Gigabit Ethernet Port
entPhysicalDescr.7007 = Gigabit Ethernet Port
entPhysicalDescr.7008 = Gigabit Ethernet Port
entPhysicalDescr.7009 = Gigabit Ethernet Port
entPhysicalDescr.7010 = Gigabit Ethernet Port
entPhysicalDescr.7011 = Gigabit Ethernet Port
entPhysicalDescr.7012 = Gigabit Ethernet Port
entPhysicalDescr.7013 = Gigabit Ethernet Port
entPhysicalDescr.7014 = Gigabit Ethernet Port
entPhysicalDescr.7015 = Gigabit Ethernet Port
entPhysicalDescr.7016 = Gigabit Ethernet Port
entPhysicalDescr.7017 = Gigabit Ethernet Port
entPhysicalDescr.7018 = Gigabit Ethernet Port
entPhysicalDescr.7019 = Gigabit Ethernet Port
entPhysicalDescr.7020 = Gigabit Ethernet Port
entPhysicalDescr.7021 = Gigabit Ethernet Port
entPhysicalDescr.7022 = Gigabit Ethernet Port
entPhysicalDescr.7023 = Gigabit Ethernet Port
entPhysicalDescr.7024 = Gigabit Ethernet Port
entPhysicalDescr.7025 = Gigabit Ethernet Port
entPhysicalDescr.7026 = Gigabit Ethernet Port
entPhysicalDescr.7027 = Gigabit Ethernet Port
entPhysicalDescr.7028 = Gigabit Ethernet Port
entPhysicalDescr.7029 = Gigabit Ethernet Port
entPhysicalDescr.7030 = Gigabit Ethernet Port
entPhysicalDescr.7031 = Gigabit Ethernet Port
entPhysicalDescr.7032 = Gigabit Ethernet Port
entPhysicalDescr.7033 = Gigabit Ethernet Port
entPhysicalDescr.7034 = Gigabit Ethernet Port
entPhysicalDescr.7035 = Gigabit Ethernet Port
entPhysicalDescr.7036 = Gigabit Ethernet Port
entPhysicalDescr.7037 = Gigabit Ethernet Port
entPhysicalDescr.7038 = Gigabit Ethernet Port
entPhysicalDescr.7039 = Gigabit Ethernet Port
entPhysicalDescr.7040 = Gigabit Ethernet Port
entPhysicalDescr.7041 = Gigabit Ethernet Port
entPhysicalDescr.7042 = Gigabit Ethernet Port
entPhysicalDescr.7043 = Gigabit Ethernet Port
entPhysicalDescr.7044 = Gigabit Ethernet Port
entPhysicalDescr.7045 = Gigabit Ethernet Port
entPhysicalDescr.7046 = Gigabit Ethernet Port
entPhysicalDescr.7047 = Gigabit Ethernet Port
entPhysicalDescr.7048 = Gigabit Ethernet Port
entPhysicalDescr.8000 = 10/100/1000BaseT (RJ45)+V E Series with 48 10/100/1000 baseT Premium PoE ports (Cisco/IEEE)
entPhysicalDescr.8001 = Gigabit Ethernet Port
entPhysicalDescr.8002 = Gigabit Ethernet Port
entPhysicalDescr.8003 = Gigabit Ethernet Port
entPhysicalDescr.8004 = Gigabit Ethernet Port
entPhysicalDescr.8005 = Gigabit Ethernet Port
entPhysicalDescr.8006 = Gigabit Ethernet Port
entPhysicalDescr.8007 = Gigabit Ethernet Port
entPhysicalDescr.8008 = Gigabit Ethernet Port
entPhysicalDescr.8009 = Gigabit Ethernet Port
entPhysicalDescr.8010 = Gigabit Ethernet Port
entPhysicalDescr.8011 = Gigabit Ethernet Port
entPhysicalDescr.8012 = Gigabit Ethernet Port
entPhysicalDescr.8013 = Gigabit Ethernet Port
entPhysicalDescr.8014 = Gigabit Ethernet Port
entPhysicalDescr.8015 = Gigabit Ethernet Port
entPhysicalDescr.8016 = Gigabit Ethernet Port
entPhysicalDescr.8017 = Gigabit Ethernet Port
entPhysicalDescr.8018 = Gigabit Ethernet Port
entPhysicalDescr.8019 = Gigabit Ethernet Port
entPhysicalDescr.8020 = Gigabit Ethernet Port
entPhysicalDescr.8021 = Gigabit Ethernet Port
entPhysicalDescr.8022 = Gigabit Ethernet Port
entPhysicalDescr.8023 = Gigabit Ethernet Port
entPhysicalDescr.8024 = Gigabit Ethernet Port
entPhysicalDescr.8025 = Gigabit Ethernet Port
entPhysicalDescr.8026 = Gigabit Ethernet Port
entPhysicalDescr.8027 = Gigabit Ethernet Port
entPhysicalDescr.8028 = Gigabit Ethernet Port
entPhysicalDescr.8029 = Gigabit Ethernet Port
entPhysicalDescr.8030 = Gigabit Ethernet Port
entPhysicalDescr.8031 = Gigabit Ethernet Port
entPhysicalDescr.8032 = Gigabit Ethernet Port
entPhysicalDescr.8033 = Gigabit Ethernet Port
entPhysicalDescr.8034 = Gigabit Ethernet Port
entPhysicalDescr.8035 = Gigabit Ethernet Port
entPhysicalDescr.8036 = Gigabit Ethernet Port
entPhysicalDescr.8037 = Gigabit Ethernet Port
entPhysicalDescr.8038 = Gigabit Ethernet Port
entPhysicalDescr.8039 = Gigabit Ethernet Port
entPhysicalDescr.8040 = Gigabit Ethernet Port
entPhysicalDescr.8041 = Gigabit Ethernet Port
entPhysicalDescr.8042 = Gigabit Ethernet Port
entPhysicalDescr.8043 = Gigabit Ethernet Port
entPhysicalDescr.8044 = Gigabit Ethernet Port
entPhysicalDescr.8045 = Gigabit Ethernet Port
entPhysicalDescr.8046 = Gigabit Ethernet Port
entPhysicalDescr.8047 = Gigabit Ethernet Port
entPhysicalDescr.8048 = Gigabit Ethernet Port
entPhysicalDescr.9000 = 10/100/1000BaseT (RJ45)+V E Series with 48 10/100/1000 baseT Premium PoE ports (Cisco/IEEE)
entPhysicalDescr.9001 = Gigabit Ethernet Port
entPhysicalDescr.9002 = Gigabit Ethernet Port
entPhysicalDescr.9003 = Gigabit Ethernet Port
entPhysicalDescr.9004 = Gigabit Ethernet Port
entPhysicalDescr.9005 = Gigabit Ethernet Port
entPhysicalDescr.9006 = Gigabit Ethernet Port
entPhysicalDescr.9007 = Gigabit Ethernet Port
entPhysicalDescr.9008 = Gigabit Ethernet Port
entPhysicalDescr.9009 = Gigabit Ethernet Port
entPhysicalDescr.9010 = Gigabit Ethernet Port
entPhysicalDescr.9011 = Gigabit Ethernet Port
entPhysicalDescr.9012 = Gigabit Ethernet Port
entPhysicalDescr.9013 = Gigabit Ethernet Port
entPhysicalDescr.9014 = Gigabit Ethernet Port
entPhysicalDescr.9015 = Gigabit Ethernet Port
entPhysicalDescr.9016 = Gigabit Ethernet Port
entPhysicalDescr.9017 = Gigabit Ethernet Port
entPhysicalDescr.9018 = Gigabit Ethernet Port
entPhysicalDescr.9019 = Gigabit Ethernet Port
entPhysicalDescr.9020 = Gigabit Ethernet Port
entPhysicalDescr.9021 = Gigabit Ethernet Port
entPhysicalDescr.9022 = Gigabit Ethernet Port
entPhysicalDescr.9023 = Gigabit Ethernet Port
entPhysicalDescr.9024 = Gigabit Ethernet Port
entPhysicalDescr.9025 = Gigabit Ethernet Port
entPhysicalDescr.9026 = Gigabit Ethernet Port
entPhysicalDescr.9027 = Gigabit Ethernet Port
entPhysicalDescr.9028 = Gigabit Ethernet Port
entPhysicalDescr.9029 = Gigabit Ethernet Port
entPhysicalDescr.9030 = Gigabit Ethernet Port
entPhysicalDescr.9031 = Gigabit Ethernet Port
entPhysicalDescr.9032 = Gigabit Ethernet Port
entPhysicalDescr.9033 = Gigabit Ethernet Port
entPhysicalDescr.9034 = Gigabit Ethernet Port
entPhysicalDescr.9035 = Gigabit Ethernet Port
entPhysicalDescr.9036 = Gigabit Ethernet Port
entPhysicalDescr.9037 = Gigabit Ethernet Port
entPhysicalDescr.9038 = Gigabit Ethernet Port
entPhysicalDescr.9039 = Gigabit Ethernet Port
entPhysicalDescr.9040 = Gigabit Ethernet Port
entPhysicalDescr.9041 = Gigabit Ethernet Port
entPhysicalDescr.9042 = Gigabit Ethernet Port
entPhysicalDescr.9043 = Gigabit Ethernet Port
entPhysicalDescr.9044 = Gigabit Ethernet Port
entPhysicalDescr.9045 = Gigabit Ethernet Port
entPhysicalDescr.9046 = Gigabit Ethernet Port
entPhysicalDescr.9047 = Gigabit Ethernet Port
entPhysicalDescr.9048 = Gigabit Ethernet Port

View File

@ -0,0 +1,407 @@
entPhysicalName.1 = Switch System
entPhysicalName.2 = Slot 1
entPhysicalName.3 = Slot 2
entPhysicalName.4 = Slot 3
entPhysicalName.5 = Slot 4
entPhysicalName.6 = Slot 5
entPhysicalName.7 = Slot 6
entPhysicalName.8 = Slot 7
entPhysicalName.9 = Slot 8
entPhysicalName.10 = Slot 9
entPhysicalName.11 = Slot 10
entPhysicalName.12 = Backplane
entPhysicalName.13 = Fan Tray Bay
entPhysicalName.14 = Fan
entPhysicalName.15 = Container of Power Supply Bay
entPhysicalName.16 = Power Supply Bay 1
entPhysicalName.17 = Power Supply 1
entPhysicalName.18 = Power Supply 1 Fan
entPhysicalName.19 = Power Supply Bay 2
entPhysicalName.20 = Power Supply 2
entPhysicalName.21 = Power Supply 2 Fan
entPhysicalName.22 = Clock Module
entPhysicalName.23 = Mux Buffer 1
entPhysicalName.24 = Mux Buffer 2
entPhysicalName.25 = Mux Buffer 3
entPhysicalName.26 = Mux Buffer 4
entPhysicalName.27 = Mux Buffer 7
entPhysicalName.28 = Mux Buffer 8
entPhysicalName.29 = Mux Buffer 9
entPhysicalName.30 = Mux Buffer 10
entPhysicalName.1000 = Linecard(slot 1)
entPhysicalName.1001 = GigabitEthernet1/1
entPhysicalName.1002 = GigabitEthernet1/2
entPhysicalName.1003 = GigabitEthernet1/3
entPhysicalName.1004 = GigabitEthernet1/4
entPhysicalName.1005 = GigabitEthernet1/5
entPhysicalName.1006 = GigabitEthernet1/6
entPhysicalName.1007 = GigabitEthernet1/7
entPhysicalName.1008 = GigabitEthernet1/8
entPhysicalName.1009 = GigabitEthernet1/9
entPhysicalName.1010 = GigabitEthernet1/10
entPhysicalName.1011 = GigabitEthernet1/11
entPhysicalName.1012 = GigabitEthernet1/12
entPhysicalName.1013 = GigabitEthernet1/13
entPhysicalName.1014 = GigabitEthernet1/14
entPhysicalName.1015 = GigabitEthernet1/15
entPhysicalName.1016 = GigabitEthernet1/16
entPhysicalName.1017 = GigabitEthernet1/17
entPhysicalName.1018 = GigabitEthernet1/18
entPhysicalName.1019 = GigabitEthernet1/19
entPhysicalName.1020 = GigabitEthernet1/20
entPhysicalName.1021 = GigabitEthernet1/21
entPhysicalName.1022 = GigabitEthernet1/22
entPhysicalName.1023 = GigabitEthernet1/23
entPhysicalName.1024 = GigabitEthernet1/24
entPhysicalName.1025 = GigabitEthernet1/25
entPhysicalName.1026 = GigabitEthernet1/26
entPhysicalName.1027 = GigabitEthernet1/27
entPhysicalName.1028 = GigabitEthernet1/28
entPhysicalName.1029 = GigabitEthernet1/29
entPhysicalName.1030 = GigabitEthernet1/30
entPhysicalName.1031 = GigabitEthernet1/31
entPhysicalName.1032 = GigabitEthernet1/32
entPhysicalName.1033 = GigabitEthernet1/33
entPhysicalName.1034 = GigabitEthernet1/34
entPhysicalName.1035 = GigabitEthernet1/35
entPhysicalName.1036 = GigabitEthernet1/36
entPhysicalName.1037 = GigabitEthernet1/37
entPhysicalName.1038 = GigabitEthernet1/38
entPhysicalName.1039 = GigabitEthernet1/39
entPhysicalName.1040 = GigabitEthernet1/40
entPhysicalName.1041 = GigabitEthernet1/41
entPhysicalName.1042 = GigabitEthernet1/42
entPhysicalName.1043 = GigabitEthernet1/43
entPhysicalName.1044 = GigabitEthernet1/44
entPhysicalName.1045 = GigabitEthernet1/45
entPhysicalName.1046 = GigabitEthernet1/46
entPhysicalName.1047 = GigabitEthernet1/47
entPhysicalName.1048 = GigabitEthernet1/48
entPhysicalName.2000 = Linecard(slot 2)
entPhysicalName.2001 = GigabitEthernet2/1
entPhysicalName.2002 = GigabitEthernet2/2
entPhysicalName.2003 = GigabitEthernet2/3
entPhysicalName.2004 = GigabitEthernet2/4
entPhysicalName.2005 = GigabitEthernet2/5
entPhysicalName.2006 = GigabitEthernet2/6
entPhysicalName.2007 = GigabitEthernet2/7
entPhysicalName.2008 = GigabitEthernet2/8
entPhysicalName.2009 = GigabitEthernet2/9
entPhysicalName.2010 = GigabitEthernet2/10
entPhysicalName.2011 = GigabitEthernet2/11
entPhysicalName.2012 = GigabitEthernet2/12
entPhysicalName.2013 = GigabitEthernet2/13
entPhysicalName.2014 = GigabitEthernet2/14
entPhysicalName.2015 = GigabitEthernet2/15
entPhysicalName.2016 = GigabitEthernet2/16
entPhysicalName.2017 = GigabitEthernet2/17
entPhysicalName.2018 = GigabitEthernet2/18
entPhysicalName.2019 = GigabitEthernet2/19
entPhysicalName.2020 = GigabitEthernet2/20
entPhysicalName.2021 = GigabitEthernet2/21
entPhysicalName.2022 = GigabitEthernet2/22
entPhysicalName.2023 = GigabitEthernet2/23
entPhysicalName.2024 = GigabitEthernet2/24
entPhysicalName.2025 = GigabitEthernet2/25
entPhysicalName.2026 = GigabitEthernet2/26
entPhysicalName.2027 = GigabitEthernet2/27
entPhysicalName.2028 = GigabitEthernet2/28
entPhysicalName.2029 = GigabitEthernet2/29
entPhysicalName.2030 = GigabitEthernet2/30
entPhysicalName.2031 = GigabitEthernet2/31
entPhysicalName.2032 = GigabitEthernet2/32
entPhysicalName.2033 = GigabitEthernet2/33
entPhysicalName.2034 = GigabitEthernet2/34
entPhysicalName.2035 = GigabitEthernet2/35
entPhysicalName.2036 = GigabitEthernet2/36
entPhysicalName.2037 = GigabitEthernet2/37
entPhysicalName.2038 = GigabitEthernet2/38
entPhysicalName.2039 = GigabitEthernet2/39
entPhysicalName.2040 = GigabitEthernet2/40
entPhysicalName.2041 = GigabitEthernet2/41
entPhysicalName.2042 = GigabitEthernet2/42
entPhysicalName.2043 = GigabitEthernet2/43
entPhysicalName.2044 = GigabitEthernet2/44
entPhysicalName.2045 = GigabitEthernet2/45
entPhysicalName.2046 = GigabitEthernet2/46
entPhysicalName.2047 = GigabitEthernet2/47
entPhysicalName.2048 = GigabitEthernet2/48
entPhysicalName.3000 = Linecard(slot 3)
entPhysicalName.3001 = GigabitEthernet3/1
entPhysicalName.3002 = GigabitEthernet3/2
entPhysicalName.3003 = GigabitEthernet3/3
entPhysicalName.3004 = GigabitEthernet3/4
entPhysicalName.3005 = GigabitEthernet3/5
entPhysicalName.3006 = GigabitEthernet3/6
entPhysicalName.3007 = GigabitEthernet3/7
entPhysicalName.3008 = GigabitEthernet3/8
entPhysicalName.3009 = GigabitEthernet3/9
entPhysicalName.3010 = GigabitEthernet3/10
entPhysicalName.3011 = GigabitEthernet3/11
entPhysicalName.3012 = GigabitEthernet3/12
entPhysicalName.3013 = GigabitEthernet3/13
entPhysicalName.3014 = GigabitEthernet3/14
entPhysicalName.3015 = GigabitEthernet3/15
entPhysicalName.3016 = GigabitEthernet3/16
entPhysicalName.3017 = GigabitEthernet3/17
entPhysicalName.3018 = GigabitEthernet3/18
entPhysicalName.3019 = GigabitEthernet3/19
entPhysicalName.3020 = GigabitEthernet3/20
entPhysicalName.3021 = GigabitEthernet3/21
entPhysicalName.3022 = GigabitEthernet3/22
entPhysicalName.3023 = GigabitEthernet3/23
entPhysicalName.3024 = GigabitEthernet3/24
entPhysicalName.3025 = GigabitEthernet3/25
entPhysicalName.3026 = GigabitEthernet3/26
entPhysicalName.3027 = GigabitEthernet3/27
entPhysicalName.3028 = GigabitEthernet3/28
entPhysicalName.3029 = GigabitEthernet3/29
entPhysicalName.3030 = GigabitEthernet3/30
entPhysicalName.3031 = GigabitEthernet3/31
entPhysicalName.3032 = GigabitEthernet3/32
entPhysicalName.3033 = GigabitEthernet3/33
entPhysicalName.3034 = GigabitEthernet3/34
entPhysicalName.3035 = GigabitEthernet3/35
entPhysicalName.3036 = GigabitEthernet3/36
entPhysicalName.3037 = GigabitEthernet3/37
entPhysicalName.3038 = GigabitEthernet3/38
entPhysicalName.3039 = GigabitEthernet3/39
entPhysicalName.3040 = GigabitEthernet3/40
entPhysicalName.3041 = GigabitEthernet3/41
entPhysicalName.3042 = GigabitEthernet3/42
entPhysicalName.3043 = GigabitEthernet3/43
entPhysicalName.3044 = GigabitEthernet3/44
entPhysicalName.3045 = GigabitEthernet3/45
entPhysicalName.3046 = GigabitEthernet3/46
entPhysicalName.3047 = GigabitEthernet3/47
entPhysicalName.3048 = GigabitEthernet3/48
entPhysicalName.4000 = Linecard(slot 4)
entPhysicalName.4001 = GigabitEthernet4/1
entPhysicalName.4002 = GigabitEthernet4/2
entPhysicalName.4003 = GigabitEthernet4/3
entPhysicalName.4004 = GigabitEthernet4/4
entPhysicalName.4005 = GigabitEthernet4/5
entPhysicalName.4006 = GigabitEthernet4/6
entPhysicalName.4007 = GigabitEthernet4/7
entPhysicalName.4008 = GigabitEthernet4/8
entPhysicalName.4009 = GigabitEthernet4/9
entPhysicalName.4010 = GigabitEthernet4/10
entPhysicalName.4011 = GigabitEthernet4/11
entPhysicalName.4012 = GigabitEthernet4/12
entPhysicalName.4013 = GigabitEthernet4/13
entPhysicalName.4014 = GigabitEthernet4/14
entPhysicalName.4015 = GigabitEthernet4/15
entPhysicalName.4016 = GigabitEthernet4/16
entPhysicalName.4017 = GigabitEthernet4/17
entPhysicalName.4018 = GigabitEthernet4/18
entPhysicalName.4019 = GigabitEthernet4/19
entPhysicalName.4020 = GigabitEthernet4/20
entPhysicalName.4021 = GigabitEthernet4/21
entPhysicalName.4022 = GigabitEthernet4/22
entPhysicalName.4023 = GigabitEthernet4/23
entPhysicalName.4024 = GigabitEthernet4/24
entPhysicalName.4025 = GigabitEthernet4/25
entPhysicalName.4026 = GigabitEthernet4/26
entPhysicalName.4027 = GigabitEthernet4/27
entPhysicalName.4028 = GigabitEthernet4/28
entPhysicalName.4029 = GigabitEthernet4/29
entPhysicalName.4030 = GigabitEthernet4/30
entPhysicalName.4031 = GigabitEthernet4/31
entPhysicalName.4032 = GigabitEthernet4/32
entPhysicalName.4033 = GigabitEthernet4/33
entPhysicalName.4034 = GigabitEthernet4/34
entPhysicalName.4035 = GigabitEthernet4/35
entPhysicalName.4036 = GigabitEthernet4/36
entPhysicalName.4037 = GigabitEthernet4/37
entPhysicalName.4038 = GigabitEthernet4/38
entPhysicalName.4039 = GigabitEthernet4/39
entPhysicalName.4040 = GigabitEthernet4/40
entPhysicalName.4041 = GigabitEthernet4/41
entPhysicalName.4042 = GigabitEthernet4/42
entPhysicalName.4043 = GigabitEthernet4/43
entPhysicalName.4044 = GigabitEthernet4/44
entPhysicalName.4045 = GigabitEthernet4/45
entPhysicalName.4046 = GigabitEthernet4/46
entPhysicalName.4047 = GigabitEthernet4/47
entPhysicalName.4048 = GigabitEthernet4/48
entPhysicalName.5000 = Supervisor(slot 5)
entPhysicalName.5001 = Port Container 5/1
entPhysicalName.5002 = Port Container 5/2
entPhysicalName.5003 = Port Container 5/3
entPhysicalName.5004 = Port Container 5/4
entPhysicalName.5005 = TenGigabitEthernet5/1
entPhysicalName.5006 = TenGigabitEthernet5/2
entPhysicalName.5021 = Te5/1 Module Temperature Sensor
entPhysicalName.5022 = Te5/2 Module Temperature Sensor
entPhysicalName.5025 = Te5/1 Supply Voltage Sensor
entPhysicalName.5026 = Te5/2 Supply Voltage Sensor
entPhysicalName.5029 = Te5/1 Bias Current Sensor
entPhysicalName.5030 = Te5/2 Bias Current Sensor
entPhysicalName.5033 = Te5/1 Transmit Power Sensor
entPhysicalName.5034 = Te5/2 Transmit Power Sensor
entPhysicalName.5037 = Te5/1 Receive Power Sensor
entPhysicalName.5038 = Te5/2 Receive Power Sensor
entPhysicalName.6000 = Supervisor(slot 6)
entPhysicalName.6001 = Port Container 6/1
entPhysicalName.6002 = Port Container 6/2
entPhysicalName.6003 = Port Container 6/3
entPhysicalName.6004 = Port Container 6/4
entPhysicalName.6005 = TenGigabitEthernet6/1
entPhysicalName.6006 = TenGigabitEthernet6/2
entPhysicalName.6021 = Te6/1 Module Temperature Sensor
entPhysicalName.6022 = Te6/2 Module Temperature Sensor
entPhysicalName.6025 = Te6/1 Supply Voltage Sensor
entPhysicalName.6026 = Te6/2 Supply Voltage Sensor
entPhysicalName.6029 = Te6/1 Bias Current Sensor
entPhysicalName.6030 = Te6/2 Bias Current Sensor
entPhysicalName.6033 = Te6/1 Transmit Power Sensor
entPhysicalName.6034 = Te6/2 Transmit Power Sensor
entPhysicalName.6037 = Te6/1 Receive Power Sensor
entPhysicalName.6038 = Te6/2 Receive Power Sensor
entPhysicalName.7000 = Linecard(slot 7)
entPhysicalName.7001 = GigabitEthernet7/1
entPhysicalName.7002 = GigabitEthernet7/2
entPhysicalName.7003 = GigabitEthernet7/3
entPhysicalName.7004 = GigabitEthernet7/4
entPhysicalName.7005 = GigabitEthernet7/5
entPhysicalName.7006 = GigabitEthernet7/6
entPhysicalName.7007 = GigabitEthernet7/7
entPhysicalName.7008 = GigabitEthernet7/8
entPhysicalName.7009 = GigabitEthernet7/9
entPhysicalName.7010 = GigabitEthernet7/10
entPhysicalName.7011 = GigabitEthernet7/11
entPhysicalName.7012 = GigabitEthernet7/12
entPhysicalName.7013 = GigabitEthernet7/13
entPhysicalName.7014 = GigabitEthernet7/14
entPhysicalName.7015 = GigabitEthernet7/15
entPhysicalName.7016 = GigabitEthernet7/16
entPhysicalName.7017 = GigabitEthernet7/17
entPhysicalName.7018 = GigabitEthernet7/18
entPhysicalName.7019 = GigabitEthernet7/19
entPhysicalName.7020 = GigabitEthernet7/20
entPhysicalName.7021 = GigabitEthernet7/21
entPhysicalName.7022 = GigabitEthernet7/22
entPhysicalName.7023 = GigabitEthernet7/23
entPhysicalName.7024 = GigabitEthernet7/24
entPhysicalName.7025 = GigabitEthernet7/25
entPhysicalName.7026 = GigabitEthernet7/26
entPhysicalName.7027 = GigabitEthernet7/27
entPhysicalName.7028 = GigabitEthernet7/28
entPhysicalName.7029 = GigabitEthernet7/29
entPhysicalName.7030 = GigabitEthernet7/30
entPhysicalName.7031 = GigabitEthernet7/31
entPhysicalName.7032 = GigabitEthernet7/32
entPhysicalName.7033 = GigabitEthernet7/33
entPhysicalName.7034 = GigabitEthernet7/34
entPhysicalName.7035 = GigabitEthernet7/35
entPhysicalName.7036 = GigabitEthernet7/36
entPhysicalName.7037 = GigabitEthernet7/37
entPhysicalName.7038 = GigabitEthernet7/38
entPhysicalName.7039 = GigabitEthernet7/39
entPhysicalName.7040 = GigabitEthernet7/40
entPhysicalName.7041 = GigabitEthernet7/41
entPhysicalName.7042 = GigabitEthernet7/42
entPhysicalName.7043 = GigabitEthernet7/43
entPhysicalName.7044 = GigabitEthernet7/44
entPhysicalName.7045 = GigabitEthernet7/45
entPhysicalName.7046 = GigabitEthernet7/46
entPhysicalName.7047 = GigabitEthernet7/47
entPhysicalName.7048 = GigabitEthernet7/48
entPhysicalName.8000 = Linecard(slot 8)
entPhysicalName.8001 = GigabitEthernet8/1
entPhysicalName.8002 = GigabitEthernet8/2
entPhysicalName.8003 = GigabitEthernet8/3
entPhysicalName.8004 = GigabitEthernet8/4
entPhysicalName.8005 = GigabitEthernet8/5
entPhysicalName.8006 = GigabitEthernet8/6
entPhysicalName.8007 = GigabitEthernet8/7
entPhysicalName.8008 = GigabitEthernet8/8
entPhysicalName.8009 = GigabitEthernet8/9
entPhysicalName.8010 = GigabitEthernet8/10
entPhysicalName.8011 = GigabitEthernet8/11
entPhysicalName.8012 = GigabitEthernet8/12
entPhysicalName.8013 = GigabitEthernet8/13
entPhysicalName.8014 = GigabitEthernet8/14
entPhysicalName.8015 = GigabitEthernet8/15
entPhysicalName.8016 = GigabitEthernet8/16
entPhysicalName.8017 = GigabitEthernet8/17
entPhysicalName.8018 = GigabitEthernet8/18
entPhysicalName.8019 = GigabitEthernet8/19
entPhysicalName.8020 = GigabitEthernet8/20
entPhysicalName.8021 = GigabitEthernet8/21
entPhysicalName.8022 = GigabitEthernet8/22
entPhysicalName.8023 = GigabitEthernet8/23
entPhysicalName.8024 = GigabitEthernet8/24
entPhysicalName.8025 = GigabitEthernet8/25
entPhysicalName.8026 = GigabitEthernet8/26
entPhysicalName.8027 = GigabitEthernet8/27
entPhysicalName.8028 = GigabitEthernet8/28
entPhysicalName.8029 = GigabitEthernet8/29
entPhysicalName.8030 = GigabitEthernet8/30
entPhysicalName.8031 = GigabitEthernet8/31
entPhysicalName.8032 = GigabitEthernet8/32
entPhysicalName.8033 = GigabitEthernet8/33
entPhysicalName.8034 = GigabitEthernet8/34
entPhysicalName.8035 = GigabitEthernet8/35
entPhysicalName.8036 = GigabitEthernet8/36
entPhysicalName.8037 = GigabitEthernet8/37
entPhysicalName.8038 = GigabitEthernet8/38
entPhysicalName.8039 = GigabitEthernet8/39
entPhysicalName.8040 = GigabitEthernet8/40
entPhysicalName.8041 = GigabitEthernet8/41
entPhysicalName.8042 = GigabitEthernet8/42
entPhysicalName.8043 = GigabitEthernet8/43
entPhysicalName.8044 = GigabitEthernet8/44
entPhysicalName.8045 = GigabitEthernet8/45
entPhysicalName.8046 = GigabitEthernet8/46
entPhysicalName.8047 = GigabitEthernet8/47
entPhysicalName.8048 = GigabitEthernet8/48
entPhysicalName.9000 = Linecard(slot 9)
entPhysicalName.9001 = GigabitEthernet9/1
entPhysicalName.9002 = GigabitEthernet9/2
entPhysicalName.9003 = GigabitEthernet9/3
entPhysicalName.9004 = GigabitEthernet9/4
entPhysicalName.9005 = GigabitEthernet9/5
entPhysicalName.9006 = GigabitEthernet9/6
entPhysicalName.9007 = GigabitEthernet9/7
entPhysicalName.9008 = GigabitEthernet9/8
entPhysicalName.9009 = GigabitEthernet9/9
entPhysicalName.9010 = GigabitEthernet9/10
entPhysicalName.9011 = GigabitEthernet9/11
entPhysicalName.9012 = GigabitEthernet9/12
entPhysicalName.9013 = GigabitEthernet9/13
entPhysicalName.9014 = GigabitEthernet9/14
entPhysicalName.9015 = GigabitEthernet9/15
entPhysicalName.9016 = GigabitEthernet9/16
entPhysicalName.9017 = GigabitEthernet9/17
entPhysicalName.9018 = GigabitEthernet9/18
entPhysicalName.9019 = GigabitEthernet9/19
entPhysicalName.9020 = GigabitEthernet9/20
entPhysicalName.9021 = GigabitEthernet9/21
entPhysicalName.9022 = GigabitEthernet9/22
entPhysicalName.9023 = GigabitEthernet9/23
entPhysicalName.9024 = GigabitEthernet9/24
entPhysicalName.9025 = GigabitEthernet9/25
entPhysicalName.9026 = GigabitEthernet9/26
entPhysicalName.9027 = GigabitEthernet9/27
entPhysicalName.9028 = GigabitEthernet9/28
entPhysicalName.9029 = GigabitEthernet9/29
entPhysicalName.9030 = GigabitEthernet9/30
entPhysicalName.9031 = GigabitEthernet9/31
entPhysicalName.9032 = GigabitEthernet9/32
entPhysicalName.9033 = GigabitEthernet9/33
entPhysicalName.9034 = GigabitEthernet9/34
entPhysicalName.9035 = GigabitEthernet9/35
entPhysicalName.9036 = GigabitEthernet9/36
entPhysicalName.9037 = GigabitEthernet9/37
entPhysicalName.9038 = GigabitEthernet9/38
entPhysicalName.9039 = GigabitEthernet9/39
entPhysicalName.9040 = GigabitEthernet9/40
entPhysicalName.9041 = GigabitEthernet9/41
entPhysicalName.9042 = GigabitEthernet9/42
entPhysicalName.9043 = GigabitEthernet9/43
entPhysicalName.9044 = GigabitEthernet9/44
entPhysicalName.9045 = GigabitEthernet9/45
entPhysicalName.9046 = GigabitEthernet9/46
entPhysicalName.9047 = GigabitEthernet9/47
entPhysicalName.9048 = GigabitEthernet9/48

View File

@ -0,0 +1,334 @@
entPhysicalDescr.14289 = SFP container
entPhysicalDescr.320862 = Voltage Sensor - 1.8VA
entPhysicalDescr.322450 = Voltage Sensor - 1.2VA
entPhysicalDescr.727162 = Transceiver Rx Power Sensor
entPhysicalDescr.1226497 = Transceiver Rx Power Sensor
entPhysicalDescr.1864335 = Voltage Sensor - 3.3V_DB
entPhysicalDescr.1865923 = Voltage Sensor - 1.8V_DB
entPhysicalDescr.2359704 = CPU
entPhysicalDescr.3723372 = Transceiver Rx Power Sensor
entPhysicalDescr.4069865 = GigabitEthernet Port
entPhysicalDescr.4220122 = GigabitEthernet Port
entPhysicalDescr.4221806 = GigabitEthernet Port
entPhysicalDescr.4223394 = GigabitEthernet Port
entPhysicalDescr.4306232 = Transceiver Transmit Bias Current Sensor
entPhysicalDescr.4410815 = GigabitEthernet Port
entPhysicalDescr.4412403 = GigabitEthernet Port
entPhysicalDescr.4436046 = Transceiver Temperature Sensor
entPhysicalDescr.4437634 = Transceiver Voltage Sensor - 3.3V
entPhysicalDescr.4553394 = Unknown pluggable optics
entPhysicalDescr.4639747 = SFP container
entPhysicalDescr.4761191 = Voltage Sensor - 1.5V_DB
entPhysicalDescr.4762811 = Voltage Sensor - 1.2V_DB
entPhysicalDescr.4893333 = SFP container
entPhysicalDescr.5451646 = Transceiver Tx Power Sensor
entPhysicalDescr.5574832 = Voltage Sensor - ZARLINK_1.8V
entPhysicalDescr.5773465 = Voltage Sensor - 1.0V_TCAM2
entPhysicalDescr.5775149 = Voltage Sensor - 1.2VB
entPhysicalDescr.5778357 = Voltage Sensor - 1.1VC
entPhysicalDescr.5922230 = Voltage Sensor - 1.0V_TCAM0
entPhysicalDescr.5925406 = Voltage Sensor - 1.5VA
entPhysicalDescr.5926994 = Voltage Sensor - 1.1V(1.05V_CPU)
entPhysicalDescr.7645119 = Inlet Temperature SensorInlet0
entPhysicalDescr.7646707 = Voltage Sensor - VP3P3_CAN
entPhysicalDescr.7648263 = Voltage Sensor - 1.2V_LDO_BRG1
entPhysicalDescr.7931360 = Transceiver Rx Power Sensor
entPhysicalDescr.8053671 = Transceiver Transmit Bias Current Sensor
entPhysicalDescr.8695772 = Line Card host
entPhysicalDescr.8784399 = SFP container
entPhysicalDescr.8895994 = Transceiver Transmit Bias Current Sensor
entPhysicalDescr.9765314 = SFP container
entPhysicalDescr.10030546 = SFP container
entPhysicalDescr.10154515 = CPU
entPhysicalDescr.10735504 = Voltage Sensor - 2.5V
entPhysicalDescr.10737188 = Voltage Sensor - IBV
entPhysicalDescr.10738808 = Hot Temperature SensorHotspot0
entPhysicalDescr.10845139 = Transceiver Temperature Sensor
entPhysicalDescr.10889081 = Voltage Sensor - 1.5VA
entPhysicalDescr.10890637 = Voltage Sensor - 1.1V(1.05V_CPU)
entPhysicalDescr.10892225 = Voltage Sensor - 1.0V_TCAM0
entPhysicalDescr.11037718 = Voltage Sensor - 1.0V_TCAM2
entPhysicalDescr.11039402 = Voltage Sensor - 1.2VB
entPhysicalDescr.11042610 = Voltage Sensor - 1.1VC
entPhysicalDescr.11196778 = Transceiver Tx Power Sensor
entPhysicalDescr.11239623 = Voltage Sensor - ZARLINK_1.8V
entPhysicalDescr.11329318 = SFP container
entPhysicalDescr.11467076 = SFP container
entPhysicalDescr.12536348 = Transceiver Tx Power Sensor
entPhysicalDescr.12674056 = SFP container
entPhysicalDescr.12905956 = Voltage Sensor - 0.75VTT
entPhysicalDescr.12907576 = Voltage Sensor - 5.0V
entPhysicalDescr.13222512 = SFP container
entPhysicalDescr.13584276 = Voltage Sensor - 0.9VB
entPhysicalDescr.13585960 = Voltage Sensor - IBV
entPhysicalDescr.14020599 = Transceiver Voltage Sensor - 3.3V
entPhysicalDescr.14022155 = Transceiver Temperature Sensor
entPhysicalDescr.14031228 = SFP container
entPhysicalDescr.14155026 = Unknown or Unsupported SFP Module
entPhysicalDescr.14578394 = Ten GigabitEthernet Port
entPhysicalDescr.14924172 = GigabitEthernet Port
entPhysicalDescr.14925760 = GigabitEthernet Port
entPhysicalDescr.15076145 = GigabitEthernet Port
entPhysicalDescr.15077701 = GigabitEthernet Port
entPhysicalDescr.15117093 = SFP container
entPhysicalDescr.15303847 = Transceiver Voltage Sensor - 3.3V
entPhysicalDescr.15305467 = Transceiver Temperature Sensor
entPhysicalDescr.15400432 = RSP Management Ethernet Port
entPhysicalDescr.15516807 = Transceiver Rx Power Sensor
entPhysicalDescr.15775372 = Unknown pluggable optics
entPhysicalDescr.15986678 = Voltage Sensor - 1.2VD
entPhysicalDescr.15988234 = Voltage Sensor - 1.8VB
entPhysicalDescr.16086672 = Transceiver Rx Power Sensor
entPhysicalDescr.16231033 = Transceiver Transmit Bias Current Sensor
entPhysicalDescr.16660891 = GE T
entPhysicalDescr.16775563 = Transceiver Rx Power Sensor
entPhysicalDescr.17096855 = Voltage Sensor - 1.5V
entPhysicalDescr.17098539 = Voltage Sensor - 1.2VB
entPhysicalDescr.17493029 = Unknown pluggable optics
entPhysicalDescr.17503155 = Transceiver Tx Power Sensor
entPhysicalDescr.18004206 = Transceiver Transmit Bias Current Sensor
entPhysicalDescr.18631618 = XFP container
entPhysicalDescr.18641948 = Voltage Sensor - 1.5V_DB
entPhysicalDescr.18643536 = Voltage Sensor - 1.2V_DB
entPhysicalDescr.19137381 = Compact Flash Card Container
entPhysicalDescr.19222353 = SFP container
entPhysicalDescr.20500985 = Transceiver Tx Power Sensor
entPhysicalDescr.20824324 = Multirate 10GBASE-ZR and OC-192/STM-64 IR-2 XFP, SMF
entPhysicalDescr.20847478 = Ten GigabitEthernet Port
entPhysicalDescr.20997799 = GigabitEthernet Port
entPhysicalDescr.20999419 = GigabitEthernet Port
entPhysicalDescr.21082225 = Transceiver Voltage Sensor - 3.3V
entPhysicalDescr.21083781 = Transceiver Temperature Sensor
entPhysicalDescr.21188364 = GigabitEthernet Port
entPhysicalDescr.21189952 = GigabitEthernet Port
entPhysicalDescr.21191572 = GigabitEthernet Port
entPhysicalDescr.21212039 = Transceiver Transmit Bias Current Sensor
entPhysicalDescr.21426999 = SFP container
entPhysicalDescr.21538804 = Voltage Sensor - 3.3V_DB
entPhysicalDescr.21540360 = Voltage Sensor - 1.8V_DB
entPhysicalDescr.22037673 = Multirate 10GBASE-LR and OC-192/STM-64 SR-1 XFP, SMF
entPhysicalDescr.22227639 = Transceiver Rx Power Sensor
entPhysicalDescr.22551142 = Voltage Sensor - 0.75VD_and_0.75VE
entPhysicalDescr.22552762 = Voltage Sensor - 1.0V_TCAM1
entPhysicalDescr.22555906 = Voltage Sensor - 1.8VD
entPhysicalDescr.22701399 = Voltage Sensor - 1.8VB
entPhysicalDescr.22703083 = Voltage Sensor - 0.75VA
entPhysicalDescr.22998075 = Unknown pluggable optics
entPhysicalDescr.24422668 = Hot Temperature SensorHotspot0
entPhysicalDescr.24424256 = Voltage Sensor - 3.3V
entPhysicalDescr.24425876 = Voltage Sensor - 1.8VC
entPhysicalDescr.24555730 = ASR-9006 DC Chassis
entPhysicalDescr.24708941 = Transceiver Tx Power Sensor
entPhysicalDescr.24755628 = SFP container
entPhysicalDescr.24831284 = Transceiver Rx Power Sensor
entPhysicalDescr.25670399 = Transceiver Voltage Sensor - 3.3V
entPhysicalDescr.25671987 = Transceiver Temperature Sensor
entPhysicalDescr.26418644 = SFP container
entPhysicalDescr.26635792 = SFP container
entPhysicalDescr.26932192 = RSP Card host
entPhysicalDescr.26947585 = Cisco ASR9K Line Card Module Container
entPhysicalDescr.27514801 = Voltage Sensor - 5.0V
entPhysicalDescr.27516357 = Voltage Sensor - 0.75VTT
entPhysicalDescr.27622816 = Transceiver Tx Power Sensor
entPhysicalDescr.27666630 = Voltage Sensor - 1.5VB
entPhysicalDescr.27668250 = Voltage Sensor - 2.5V
entPhysicalDescr.27669934 = Voltage Sensor - 1.1VB
entPhysicalDescr.27813807 = Voltage Sensor - 1.0V_TCAM3
entPhysicalDescr.27815395 = Voltage Sensor - 1.0V_Bridge_LDO
entPhysicalDescr.27972771 = Transceiver Rx Power Sensor
entPhysicalDescr.27992463 = SFP container
entPhysicalDescr.28017236 = Voltage Sensor - ZARLINK_3.3V
entPhysicalDescr.28091685 = Cisco ASR9K Route/Switch Processor Module Container
entPhysicalDescr.28927172 = 2-Port 10GE, 20-Port GE Low Queue LC Requires XFPs and SFPs
entPhysicalDescr.29314025 = Transceiver Rx Power Sensor
entPhysicalDescr.29680361 = Voltage Sensor - 2.5V
entPhysicalDescr.29683569 = Hot Temperature SensorHotspot0
entPhysicalDescr.29685125 = Voltage Sensor - IBV
entPhysicalDescr.29692767 = Unknown or Unsupported SFP Module
entPhysicalDescr.30293303 = SFP container
entPhysicalDescr.30360365 = Voltage Sensor - 1.8VC
entPhysicalDescr.30361953 = Voltage Sensor - 3.3V
entPhysicalDescr.30363573 = Hot Temperature SensorHotspot0
entPhysicalDescr.30799768 = Transceiver Tx Power Sensor
entPhysicalDescr.31356071 = Ten GigabitEthernet Port
entPhysicalDescr.31701785 = GigabitEthernet Port
entPhysicalDescr.31703469 = GigabitEthernet Port
entPhysicalDescr.31706677 = GigabitEthernet Port
entPhysicalDescr.31853726 = GigabitEthernet Port
entPhysicalDescr.31855314 = GigabitEthernet Port
entPhysicalDescr.32083016 = Transceiver Tx Power Sensor
entPhysicalDescr.32294420 = Transceiver Transmit Bias Current Sensor
entPhysicalDescr.32762639 = Voltage Sensor - 1.9V
entPhysicalDescr.32764227 = Voltage Sensor - 1.05V
entPhysicalDescr.32845674 = SFP container
entPhysicalDescr.32864381 = Transceiver Tx Power Sensor
entPhysicalDescr.33008582 = Transceiver Rx Power Sensor
entPhysicalDescr.33553176 = Transceiver Transmit Bias Current Sensor
entPhysicalDescr.33874532 = Voltage Sensor - 1.9V
entPhysicalDescr.33876152 = Voltage Sensor - 1.05V
entPhysicalDescr.34279116 = Transceiver Voltage Sensor - 3.3V
entPhysicalDescr.34280704 = Transceiver Temperature Sensor
entPhysicalDescr.34780199 = Transceiver Temperature Sensor
entPhysicalDescr.34908909 = SFP container
entPhysicalDescr.34936936 = SFP container
entPhysicalDescr.35271015 = Line Card host
entPhysicalDescr.35315789 = SFP container
entPhysicalDescr.35419625 = Voltage Sensor - 1.2VB_DB
entPhysicalDescr.35421245 = Voltage Sensor - 2.5V_DB
entPhysicalDescr.36086291 = Unknown or Unsupported SFP Module
entPhysicalDescr.36731525 = ASR9K Fabric, Controller, 4G memory
entPhysicalDescr.37278534 = Transceiver Temperature Sensor
entPhysicalDescr.37280154 = Transceiver Voltage Sensor - 3.3V
entPhysicalDescr.37628331 = Ten GigabitEthernet Port
entPhysicalDescr.37775412 = GigabitEthernet Port
entPhysicalDescr.37776968 = GigabitEthernet Port
entPhysicalDescr.37861394 = Transceiver Tx Power Sensor
entPhysicalDescr.37965977 = GigabitEthernet Port
entPhysicalDescr.37967661 = GigabitEthernet Port
entPhysicalDescr.37989652 = Transceiver Rx Power Sensor
entPhysicalDescr.38317973 = Voltage Sensor - 5.0V_XFP_DB
entPhysicalDescr.38645760 = ASR9K Fabric, Controller, 4G memory
entPhysicalDescr.39005188 = Transceiver Transmit Bias Current Sensor
entPhysicalDescr.39327167 = Voltage Sensor - 1.5VC
entPhysicalDescr.39328755 = Voltage Sensor - 1.0VB
entPhysicalDescr.39479076 = Voltage Sensor - 1.8VA
entPhysicalDescr.39480696 = Voltage Sensor - 0.75VB_0.75VC
entPhysicalDescr.40425977 = SFP container
entPhysicalDescr.41200281 = Voltage Sensor - IBV
entPhysicalDescr.41201965 = Voltage Sensor - 0.9VB
entPhysicalDescr.41484934 = Transceiver Voltage Sensor - 3.3V
entPhysicalDescr.41486554 = Transceiver Temperature Sensor
entPhysicalDescr.41608833 = Transceiver Tx Power Sensor
entPhysicalDescr.42449536 = Transceiver Tx Power Sensor
entPhysicalDescr.42811629 = CompactFlash
entPhysicalDescr.43725294 = Cisco ASR9K Line Card Module Container
entPhysicalDescr.43775213 = XFP container
entPhysicalDescr.44116026 = SFP container
entPhysicalDescr.44228906 = GE T
entPhysicalDescr.44292382 = Voltage Sensor - VP3P3_CAN
entPhysicalDescr.44293970 = Voltage Sensor - 0.9VTT_A
entPhysicalDescr.44400397 = Transceiver Rx Power Sensor
entPhysicalDescr.44442655 = Voltage Sensor - 1.8VA
entPhysicalDescr.44444243 = Voltage Sensor - 0.75VB_0.75VC
entPhysicalDescr.44591420 = Voltage Sensor - 1.5VC
entPhysicalDescr.44593008 = Voltage Sensor - 1.0VB
entPhysicalDescr.44750384 = Transceiver Transmit Bias Current Sensor
entPhysicalDescr.44869298 = Cisco ASR9K Route/Switch Processor Module Container
entPhysicalDescr.44987045 = RSP Management Ethernet Port
entPhysicalDescr.46091638 = Transceiver Transmit Bias Current Sensor
entPhysicalDescr.46457974 = Voltage Sensor - 3.3V
entPhysicalDescr.46461150 = Inlet Temperature SensorInlet0
entPhysicalDescr.46462738 = Voltage Sensor - 0.9VTT_B
entPhysicalDescr.46839718 = Unknown or Unsupported SFP Module
entPhysicalDescr.47137978 = Voltage Sensor - 1.2V_LDO_BRG1
entPhysicalDescr.47139534 = Voltage Sensor - VP3P3_CAN
entPhysicalDescr.47141122 = Inlet Temperature SensorInlet0
entPhysicalDescr.47251659 = SFP container
entPhysicalDescr.47577445 = Transceiver Rx Power Sensor
entPhysicalDescr.48133684 = GigabitEthernet Port
entPhysicalDescr.48325120 = Unknown pluggable optics
entPhysicalDescr.48479462 = GigabitEthernet Port
entPhysicalDescr.48481082 = GigabitEthernet Port
entPhysicalDescr.48626511 = GigabitEthernet Port
entPhysicalDescr.48629719 = GigabitEthernet Port
entPhysicalDescr.48631403 = GigabitEthernet Port
entPhysicalDescr.48860629 = Transceiver Rx Power Sensor
entPhysicalDescr.49072097 = Transceiver Temperature Sensor
entPhysicalDescr.49073717 = Transceiver Voltage Sensor - 3.3V
entPhysicalDescr.49096062 = XFP container
entPhysicalDescr.49249616 = Unknown pluggable optics
entPhysicalDescr.49540252 = Voltage Sensor - 1.5V
entPhysicalDescr.49541840 = Voltage Sensor - 1.2VB
entPhysicalDescr.49640374 = Transceiver Voltage Sensor - 3.3V
entPhysicalDescr.49641930 = Transceiver Temperature Sensor
entPhysicalDescr.49784607 = Transceiver Tx Power Sensor
entPhysicalDescr.50329169 = Transceiver Voltage Sensor - 3.3V
entPhysicalDescr.50330853 = Transceiver Temperature Sensor
entPhysicalDescr.50652145 = Voltage Sensor - 1.2VD
entPhysicalDescr.50653701 = Voltage Sensor - 1.8VB
entPhysicalDescr.50856007 = SFP container
entPhysicalDescr.50869705 = SFP container
entPhysicalDescr.51058413 = Transceiver Transmit Bias Current Sensor
entPhysicalDescr.51180438 = Unknown or Unsupported SFP Module
entPhysicalDescr.51557812 = Transceiver Tx Power Sensor
entPhysicalDescr.52048628 = CPU
entPhysicalDescr.52198794 = Voltage Sensor - 5.0V_XFP_DB
entPhysicalDescr.52690955 = RSP Card host
entPhysicalDescr.53519347 = SFP container
entPhysicalDescr.54054559 = Transceiver Transmit Bias Current Sensor
entPhysicalDescr.54145000 = SFP container
entPhysicalDescr.54405944 = 2 Port TenGE 20 Port 1GE Daughter board
entPhysicalDescr.54523853 = SFP container
entPhysicalDescr.54551373 = GigabitEthernet Port
entPhysicalDescr.54552961 = GigabitEthernet Port
entPhysicalDescr.54554581 = GigabitEthernet Port
entPhysicalDescr.54637483 = Transceiver Rx Power Sensor
entPhysicalDescr.54743654 = GigabitEthernet Port
entPhysicalDescr.54745274 = GigabitEthernet Port
entPhysicalDescr.54767329 = Transceiver Tx Power Sensor
entPhysicalDescr.55094062 = Voltage Sensor - 1.2VB_DB
entPhysicalDescr.55095650 = Voltage Sensor - 2.5V_DB
entPhysicalDescr.55782801 = Transceiver Temperature Sensor
entPhysicalDescr.55784485 = Transceiver Voltage Sensor - 3.3V
entPhysicalDescr.55826880 = CompactFlash
entPhysicalDescr.55906083 = Voltage Sensor - ZARLINK_3.3V
entPhysicalDescr.56104716 = Voltage Sensor - 1.0V_TCAM3
entPhysicalDescr.56106304 = Voltage Sensor - 1.0V_Bridge_LDO
entPhysicalDescr.56253481 = Voltage Sensor - 1.1VB
entPhysicalDescr.56256689 = Voltage Sensor - 1.5VB
entPhysicalDescr.56258245 = Voltage Sensor - 2.5V
entPhysicalDescr.56441000 = Multirate 10GBASE-ZR and OC-192/STM-64 IR-2 XFP, SMF
entPhysicalDescr.56641985 = XFP container
entPhysicalDescr.57886073 = 2-Port 10GE, 20-Port GE Low Queue LC Requires XFPs and SFPs
entPhysicalDescr.57977958 = Voltage Sensor - 5.0V
entPhysicalDescr.57979578 = Voltage Sensor - 1.2V_LDO_BRG0
entPhysicalDescr.58262547 = Transceiver Transmit Bias Current Sensor
entPhysicalDescr.58386542 = Transceiver Temperature Sensor
entPhysicalDescr.58388130 = Transceiver Voltage Sensor - 3.3V
entPhysicalDescr.59027023 = CPU
entPhysicalDescr.59227245 = Transceiver Rx Power Sensor
entPhysicalDescr.59230118 = SFP container
entPhysicalDescr.59373463 = SFP container
entPhysicalDescr.59623968 = SFP container
entPhysicalDescr.59817663 = SFP container
entPhysicalDescr.60487386 = Compact Flash Card Container
entPhysicalDescr.61066755 = Voltage Sensor - 3.3V
entPhysicalDescr.61068375 = Voltage Sensor - 0.9VTT_B
entPhysicalDescr.61070059 = Inlet Temperature SensorInlet0
entPhysicalDescr.61178010 = Transceiver Transmit Bias Current Sensor
entPhysicalDescr.61220332 = Voltage Sensor - 1.8VB
entPhysicalDescr.61221920 = Voltage Sensor - 0.75VA
entPhysicalDescr.61368969 = Voltage Sensor - 0.75VD_and_0.75VE
entPhysicalDescr.61370589 = Voltage Sensor - 1.0V_TCAM1
entPhysicalDescr.61373861 = Voltage Sensor - 1.8VD
entPhysicalDescr.61526345 = Transceiver Voltage Sensor - 3.3V
entPhysicalDescr.61527965 = Transceiver Temperature Sensor
entPhysicalDescr.61764658 = RSP Management Ethernet Port
entPhysicalDescr.61932028 = SFP container
entPhysicalDescr.62867599 = Transceiver Temperature Sensor
entPhysicalDescr.62869187 = Transceiver Voltage Sensor - 3.3V
entPhysicalDescr.63237143 = Voltage Sensor - 0.9VTT_A
entPhysicalDescr.63238827 = Voltage Sensor - VP3P3_CAN
entPhysicalDescr.63324090 = SFP container
entPhysicalDescr.63915527 = Voltage Sensor - 1.2V_LDO_BRG0
entPhysicalDescr.63917147 = Voltage Sensor - 5.0V
entPhysicalDescr.64355058 = Transceiver Transmit Bias Current Sensor
entPhysicalDescr.64909645 = 2 Port TenGE 20 Port 1GE Daughter board
entPhysicalDescr.65255487 = GigabitEthernet Port
entPhysicalDescr.65257075 = GigabitEthernet Port
entPhysicalDescr.65270958 = SFP container
entPhysicalDescr.65404124 = GigabitEthernet Port
entPhysicalDescr.65407396 = GigabitEthernet Port
entPhysicalDescr.65407752 = Unknown pluggable optics
entPhysicalDescr.65409016 = GigabitEthernet Port
entPhysicalDescr.65576751 = Unknown pluggable optics
entPhysicalDescr.65638306 = Transceiver Transmit Bias Current Sensor
entPhysicalDescr.65731683 = RSP Management Ethernet Port
entPhysicalDescr.65733054 = SFP container
entPhysicalDescr.65849678 = Transceiver Tx Power Sensor
entPhysicalDescr.66317929 = Voltage Sensor - 1.8VA
entPhysicalDescr.66319549 = Voltage Sensor - 1.2VA
entPhysicalDescr.66417923 = Transceiver Transmit Bias Current Sensor
entPhysicalDescr.66459723 = SFP container
entPhysicalDescr.66562284 = Transceiver Temperature Sensor
entPhysicalDescr.67108466 = Transceiver Tx Power Sensor

View File

@ -0,0 +1,334 @@
entPhysicalName.14289 = slot mau GigabitEthernet0/0/CPU0/13
entPhysicalName.320862 = voltage 0/RSP0/CPU0
entPhysicalName.322450 = voltage 0/RSP0/CPU0
entPhysicalName.727162 = power Rx 0/1/CPU0/2
entPhysicalName.1226497 = power Rx 0/0/CPU0/1
entPhysicalName.1864335 = voltage 0/0/CPU0
entPhysicalName.1865923 = voltage 0/0/CPU0
entPhysicalName.2359704 = cpu 0/RSP0/CPU0
entPhysicalName.3723372 = power Rx 0/0/CPU0/18
entPhysicalName.4069865 = GigabitEthernet0/0/0/0
entPhysicalName.4220122 = GigabitEthernet0/0/0/10
entPhysicalName.4221806 = GigabitEthernet0/0/0/6
entPhysicalName.4223394 = GigabitEthernet0/0/0/2
entPhysicalName.4306232 = current 0/1/CPU0/0
entPhysicalName.4410815 = GigabitEthernet0/0/0/12
entPhysicalName.4412403 = GigabitEthernet0/0/0/16
entPhysicalName.4436046 = temperature 0/1/CPU0/19
entPhysicalName.4437634 = voltage 0/1/CPU0/19
entPhysicalName.4553394 = module mau GigabitEthernet0/1/CPU0/0
entPhysicalName.4639747 = slot mau GigabitEthernet0/1/CPU0/5
entPhysicalName.4761191 = voltage 0/1/CPU0
entPhysicalName.4762811 = voltage 0/1/CPU0
entPhysicalName.4893333 = slot mau GigabitEthernet0/0/CPU0/2
entPhysicalName.5451646 = power Tx 0/0/CPU0/4
entPhysicalName.5574832 = voltage 0/0/CPU0
entPhysicalName.5773465 = voltage 0/0/CPU0
entPhysicalName.5775149 = voltage 0/0/CPU0
entPhysicalName.5778357 = voltage 0/0/CPU0
entPhysicalName.5922230 = voltage 0/0/CPU0
entPhysicalName.5925406 = voltage 0/0/CPU0
entPhysicalName.5926994 = voltage 0/0/CPU0
entPhysicalName.7645119 = temperature 0/1/CPU0
entPhysicalName.7646707 = voltage 0/1/CPU0
entPhysicalName.7648263 = voltage 0/1/CPU0
entPhysicalName.7931360 = power Rx 0/0/CPU0/14
entPhysicalName.8053671 = current 0/0/CPU0/1
entPhysicalName.8695772 = module 0/1/CPU0
entPhysicalName.8784399 = slot mau GigabitEthernet0/0/CPU0/11
entPhysicalName.8895994 = current 0/0/CPU0/17
entPhysicalName.9765314 = slot mau GigabitEthernet0/0/CPU0/7
entPhysicalName.10030546 = slot mau GigabitEthernet0/1/CPU0/2
entPhysicalName.10154515 = cpu 0/RSP1/CPU0
entPhysicalName.10735504 = voltage 0/RSP1/CPU0
entPhysicalName.10737188 = voltage 0/RSP1/CPU0
entPhysicalName.10738808 = temperature 0/RSP1/CPU0
entPhysicalName.10845139 = temperature 0/1/CPU0/0
entPhysicalName.10889081 = voltage 0/1/CPU0
entPhysicalName.10890637 = voltage 0/1/CPU0
entPhysicalName.10892225 = voltage 0/1/CPU0
entPhysicalName.11037718 = voltage 0/1/CPU0
entPhysicalName.11039402 = voltage 0/1/CPU0
entPhysicalName.11042610 = voltage 0/1/CPU0
entPhysicalName.11196778 = power Tx 0/1/CPU0/18
entPhysicalName.11239623 = voltage 0/1/CPU0
entPhysicalName.11329318 = slot mau GigabitEthernet0/1/CPU0/13
entPhysicalName.11467076 = slot mau GigabitEthernet0/0/CPU0/5
entPhysicalName.12536348 = power Tx 0/1/CPU0/3
entPhysicalName.12674056 = slot mau GigabitEthernet0/0/CPU0/9
entPhysicalName.12905956 = voltage 0/RSP0/CPU0
entPhysicalName.12907576 = voltage 0/RSP0/CPU0
entPhysicalName.13222512 = slot mau GigabitEthernet0/1/CPU0/19
entPhysicalName.13584276 = voltage 0/0/CPU0
entPhysicalName.13585960 = voltage 0/0/CPU0
entPhysicalName.14020599 = voltage 0/1/CPU0/7
entPhysicalName.14022155 = temperature 0/1/CPU0/7
entPhysicalName.14031228 = slot mau GigabitEthernet0/1/CPU0/15
entPhysicalName.14155026 = module mau GigabitEthernet0/0/CPU0/19
entPhysicalName.14578394 = TenGigE0/1/0/0
entPhysicalName.14924172 = GigabitEthernet0/1/0/18
entPhysicalName.14925760 = GigabitEthernet0/1/0/14
entPhysicalName.15076145 = GigabitEthernet0/1/0/4
entPhysicalName.15077701 = GigabitEthernet0/1/0/8
entPhysicalName.15117093 = slot mau GigabitEthernet0/1/CPU0/7
entPhysicalName.15303847 = voltage 0/0/CPU0/2
entPhysicalName.15305467 = temperature 0/0/CPU0/2
entPhysicalName.15400432 = MgmtEth0/RSP1/CPU0/1
entPhysicalName.15516807 = power Rx 0/1/CPU0/5
entPhysicalName.15775372 = module mau GigabitEthernet0/1/CPU0/3
entPhysicalName.15986678 = voltage 0/RSP1/CPU0
entPhysicalName.15988234 = voltage 0/RSP1/CPU0
entPhysicalName.16086672 = power Rx 0/0/CPU0/0
entPhysicalName.16231033 = current 0/0/CPU0/0
entPhysicalName.16660891 = module mau GigabitEthernet0/1/CPU0/19
entPhysicalName.16775563 = power Rx 0/0/CPU0/19
entPhysicalName.17096855 = voltage 0/RSP0/CPU0
entPhysicalName.17098539 = voltage 0/RSP0/CPU0
entPhysicalName.17493029 = module mau GigabitEthernet0/1/CPU0/2
entPhysicalName.17503155 = power Tx 0/1/CPU0/2
entPhysicalName.18004206 = current 0/0/CPU0/1
entPhysicalName.18631618 = slot mau TenGigE0/1/CPU0/1
entPhysicalName.18641948 = voltage 0/0/CPU0
entPhysicalName.18643536 = voltage 0/0/CPU0
entPhysicalName.19137381 = slot compact-flash 0/RSP0/CPU0
entPhysicalName.19222353 = slot mau GigabitEthernet0/1/CPU0/16
entPhysicalName.20500985 = power Tx 0/0/CPU0/18
entPhysicalName.20824324 = module mau TenGigE0/0/CPU0/1
entPhysicalName.20847478 = TenGigE0/0/0/1
entPhysicalName.20997799 = GigabitEthernet0/0/0/7
entPhysicalName.20999419 = GigabitEthernet0/0/0/3
entPhysicalName.21082225 = voltage 0/1/CPU0/0
entPhysicalName.21083781 = temperature 0/1/CPU0/0
entPhysicalName.21188364 = GigabitEthernet0/0/0/11
entPhysicalName.21189952 = GigabitEthernet0/0/0/15
entPhysicalName.21191572 = GigabitEthernet0/0/0/19
entPhysicalName.21212039 = current 0/1/CPU0/19
entPhysicalName.21426999 = slot mau GigabitEthernet0/0/CPU0/8
entPhysicalName.21538804 = voltage 0/1/CPU0
entPhysicalName.21540360 = voltage 0/1/CPU0
entPhysicalName.22037673 = module mau TenGigE0/0/CPU0/0
entPhysicalName.22227639 = power Rx 0/0/CPU0/4
entPhysicalName.22551142 = voltage 0/0/CPU0
entPhysicalName.22552762 = voltage 0/0/CPU0
entPhysicalName.22555906 = voltage 0/0/CPU0
entPhysicalName.22701399 = voltage 0/0/CPU0
entPhysicalName.22703083 = voltage 0/0/CPU0
entPhysicalName.22998075 = module mau GigabitEthernet0/0/CPU0/1
entPhysicalName.24422668 = temperature 0/1/CPU0
entPhysicalName.24424256 = voltage 0/1/CPU0
entPhysicalName.24425876 = voltage 0/1/CPU0
entPhysicalName.24555730 = chassis ASR-9006-DC
entPhysicalName.24708941 = power Tx 0/0/CPU0/14
entPhysicalName.24755628 = slot mau GigabitEthernet0/0/CPU0/0
entPhysicalName.24831284 = power Rx 0/0/CPU0/1
entPhysicalName.25670399 = voltage 0/0/CPU0/17
entPhysicalName.25671987 = temperature 0/0/CPU0/17
entPhysicalName.26418644 = slot mau GigabitEthernet0/1/CPU0/4
entPhysicalName.26635792 = slot mau GigabitEthernet0/0/CPU0/1
entPhysicalName.26932192 = module 0/RSP1/CPU0
entPhysicalName.26947585 = slot 0/0
entPhysicalName.27514801 = voltage 0/RSP1/CPU0
entPhysicalName.27516357 = voltage 0/RSP1/CPU0
entPhysicalName.27622816 = power Tx 0/1/CPU0/0
entPhysicalName.27666630 = voltage 0/1/CPU0
entPhysicalName.27668250 = voltage 0/1/CPU0
entPhysicalName.27669934 = voltage 0/1/CPU0
entPhysicalName.27813807 = voltage 0/1/CPU0
entPhysicalName.27815395 = voltage 0/1/CPU0
entPhysicalName.27972771 = power Rx 0/1/CPU0/18
entPhysicalName.27992463 = slot mau GigabitEthernet0/1/CPU0/18
entPhysicalName.28017236 = voltage 0/1/CPU0
entPhysicalName.28091685 = slot 0/RSP0
entPhysicalName.28927172 = module 0/0/CPU0
entPhysicalName.29314025 = power Rx 0/1/CPU0/3
entPhysicalName.29680361 = voltage 0/RSP0/CPU0
entPhysicalName.29683569 = temperature 0/RSP0/CPU0
entPhysicalName.29685125 = voltage 0/RSP0/CPU0
entPhysicalName.29692767 = module mau GigabitEthernet0/0/CPU0/14
entPhysicalName.30293303 = slot mau GigabitEthernet0/1/CPU0/0
entPhysicalName.30360365 = voltage 0/0/CPU0
entPhysicalName.30361953 = voltage 0/0/CPU0
entPhysicalName.30363573 = temperature 0/0/CPU0
entPhysicalName.30799768 = power Tx 0/1/CPU0/7
entPhysicalName.31356071 = TenGigE0/1/0/1
entPhysicalName.31701785 = GigabitEthernet0/1/0/15
entPhysicalName.31703469 = GigabitEthernet0/1/0/11
entPhysicalName.31706677 = GigabitEthernet0/1/0/19
entPhysicalName.31853726 = GigabitEthernet0/1/0/3
entPhysicalName.31855314 = GigabitEthernet0/1/0/7
entPhysicalName.32083016 = power Tx 0/0/CPU0/2
entPhysicalName.32294420 = current 0/1/CPU0/5
entPhysicalName.32762639 = voltage 0/RSP1/CPU0
entPhysicalName.32764227 = voltage 0/RSP1/CPU0
entPhysicalName.32845674 = slot mau GigabitEthernet0/1/CPU0/10
entPhysicalName.32864381 = power Tx 0/0/CPU0/0
entPhysicalName.33008582 = power Rx 0/0/CPU0/0
entPhysicalName.33553176 = current 0/0/CPU0/19
entPhysicalName.33874532 = voltage 0/RSP0/CPU0
entPhysicalName.33876152 = voltage 0/RSP0/CPU0
entPhysicalName.34279116 = voltage 0/1/CPU0/2
entPhysicalName.34280704 = temperature 0/1/CPU0/2
entPhysicalName.34780199 = temperature 0/0/CPU0/1
entPhysicalName.34908909 = slot mau GigabitEthernet0/0/CPU0/10
entPhysicalName.34936936 = slot mau GigabitEthernet0/0/CPU0/18
entPhysicalName.35271015 = module 0/0/CPU0
entPhysicalName.35315789 = slot mau GigabitEthernet0/0/CPU0/17
entPhysicalName.35419625 = voltage 0/0/CPU0
entPhysicalName.35421245 = voltage 0/0/CPU0
entPhysicalName.36086291 = module mau GigabitEthernet0/0/CPU0/18
entPhysicalName.36731525 = module 0/RSP1/CPU0
entPhysicalName.37278534 = temperature 0/0/CPU0/18
entPhysicalName.37280154 = voltage 0/0/CPU0/18
entPhysicalName.37628331 = TenGigE0/0/0/0
entPhysicalName.37775412 = GigabitEthernet0/0/0/8
entPhysicalName.37776968 = GigabitEthernet0/0/0/4
entPhysicalName.37861394 = power Tx 0/1/CPU0/0
entPhysicalName.37965977 = GigabitEthernet0/0/0/14
entPhysicalName.37967661 = GigabitEthernet0/0/0/18
entPhysicalName.37989652 = power Rx 0/1/CPU0/19
entPhysicalName.38317973 = voltage 0/1/CPU0
entPhysicalName.38645760 = module 0/RSP0/CPU0
entPhysicalName.39005188 = current 0/0/CPU0/4
entPhysicalName.39327167 = voltage 0/0/CPU0
entPhysicalName.39328755 = voltage 0/0/CPU0
entPhysicalName.39479076 = voltage 0/0/CPU0
entPhysicalName.39480696 = voltage 0/0/CPU0
entPhysicalName.40425977 = slot mau GigabitEthernet0/0/CPU0/6
entPhysicalName.41200281 = voltage 0/1/CPU0
entPhysicalName.41201965 = voltage 0/1/CPU0
entPhysicalName.41484934 = voltage 0/0/CPU0/14
entPhysicalName.41486554 = temperature 0/0/CPU0/14
entPhysicalName.41608833 = power Tx 0/0/CPU0/1
entPhysicalName.42449536 = power Tx 0/0/CPU0/17
entPhysicalName.42811629 = module compact-flash 0/RSP1/CPU0
entPhysicalName.43725294 = slot 0/1
entPhysicalName.43775213 = slot mau TenGigE0/1/CPU0/0
entPhysicalName.44116026 = slot mau GigabitEthernet0/0/CPU0/12
entPhysicalName.44228906 = module mau GigabitEthernet0/1/CPU0/18
entPhysicalName.44292382 = voltage 0/RSP1/CPU0
entPhysicalName.44293970 = voltage 0/RSP1/CPU0
entPhysicalName.44400397 = power Rx 0/1/CPU0/0
entPhysicalName.44442655 = voltage 0/1/CPU0
entPhysicalName.44444243 = voltage 0/1/CPU0
entPhysicalName.44591420 = voltage 0/1/CPU0
entPhysicalName.44593008 = voltage 0/1/CPU0
entPhysicalName.44750384 = current 0/1/CPU0/18
entPhysicalName.44869298 = slot 0/RSP1
entPhysicalName.44987045 = MgmtEth0/RSP0/CPU0/1
entPhysicalName.46091638 = current 0/1/CPU0/3
entPhysicalName.46457974 = voltage 0/RSP0/CPU0
entPhysicalName.46461150 = temperature 0/RSP0/CPU0
entPhysicalName.46462738 = voltage 0/RSP0/CPU0
entPhysicalName.46839718 = module mau GigabitEthernet0/0/CPU0/4
entPhysicalName.47137978 = voltage 0/0/CPU0
entPhysicalName.47139534 = voltage 0/0/CPU0
entPhysicalName.47141122 = temperature 0/0/CPU0
entPhysicalName.47251659 = slot mau GigabitEthernet0/0/CPU0/15
entPhysicalName.47577445 = power Rx 0/1/CPU0/7
entPhysicalName.48133684 = GigabitEthernet0/1/0/0
entPhysicalName.48325120 = module mau GigabitEthernet0/1/CPU0/7
entPhysicalName.48479462 = GigabitEthernet0/1/0/16
entPhysicalName.48481082 = GigabitEthernet0/1/0/12
entPhysicalName.48626511 = GigabitEthernet0/1/0/10
entPhysicalName.48629719 = GigabitEthernet0/1/0/2
entPhysicalName.48631403 = GigabitEthernet0/1/0/6
entPhysicalName.48860629 = power Rx 0/0/CPU0/2
entPhysicalName.49072097 = temperature 0/1/CPU0/5
entPhysicalName.49073717 = voltage 0/1/CPU0/5
entPhysicalName.49096062 = slot mau TenGigE0/0/CPU0/0
entPhysicalName.49249616 = module mau GigabitEthernet0/0/CPU0/2
entPhysicalName.49540252 = voltage 0/RSP1/CPU0
entPhysicalName.49541840 = voltage 0/RSP1/CPU0
entPhysicalName.49640374 = voltage 0/0/CPU0/0
entPhysicalName.49641930 = temperature 0/0/CPU0/0
entPhysicalName.49784607 = power Tx 0/0/CPU0/0
entPhysicalName.50329169 = voltage 0/0/CPU0/19
entPhysicalName.50330853 = temperature 0/0/CPU0/19
entPhysicalName.50652145 = voltage 0/RSP0/CPU0
entPhysicalName.50653701 = voltage 0/RSP0/CPU0
entPhysicalName.50856007 = slot mau GigabitEthernet0/1/CPU0/1
entPhysicalName.50869705 = slot mau GigabitEthernet0/1/CPU0/3
entPhysicalName.51058413 = current 0/1/CPU0/2
entPhysicalName.51180438 = module mau GigabitEthernet0/1/CPU0/5
entPhysicalName.51557812 = power Tx 0/0/CPU0/1
entPhysicalName.52048628 = cpu 0/0/CPU0
entPhysicalName.52198794 = voltage 0/0/CPU0
entPhysicalName.52690955 = module 0/RSP0/CPU0
entPhysicalName.53519347 = slot mau GigabitEthernet0/0/CPU0/4
entPhysicalName.54054559 = current 0/0/CPU0/18
entPhysicalName.54145000 = slot mau GigabitEthernet0/1/CPU0/11
entPhysicalName.54405944 = daughtercard 0/0/CPU0
entPhysicalName.54523853 = slot mau GigabitEthernet0/1/CPU0/12
entPhysicalName.54551373 = GigabitEthernet0/0/0/9
entPhysicalName.54552961 = GigabitEthernet0/0/0/5
entPhysicalName.54554581 = GigabitEthernet0/0/0/1
entPhysicalName.54637483 = power Rx 0/1/CPU0/0
entPhysicalName.54743654 = GigabitEthernet0/0/0/13
entPhysicalName.54745274 = GigabitEthernet0/0/0/17
entPhysicalName.54767329 = power Tx 0/1/CPU0/19
entPhysicalName.55094062 = voltage 0/1/CPU0
entPhysicalName.55095650 = voltage 0/1/CPU0
entPhysicalName.55782801 = temperature 0/0/CPU0/4
entPhysicalName.55784485 = voltage 0/0/CPU0/4
entPhysicalName.55826880 = module compact-flash 0/RSP0/CPU0
entPhysicalName.55906083 = voltage 0/0/CPU0
entPhysicalName.56104716 = voltage 0/0/CPU0
entPhysicalName.56106304 = voltage 0/0/CPU0
entPhysicalName.56253481 = voltage 0/0/CPU0
entPhysicalName.56256689 = voltage 0/0/CPU0
entPhysicalName.56258245 = voltage 0/0/CPU0
entPhysicalName.56441000 = module mau TenGigE0/1/CPU0/0
entPhysicalName.56641985 = slot mau TenGigE0/0/CPU0/1
entPhysicalName.57886073 = module 0/1/CPU0
entPhysicalName.57977958 = voltage 0/1/CPU0
entPhysicalName.57979578 = voltage 0/1/CPU0
entPhysicalName.58262547 = current 0/0/CPU0/14
entPhysicalName.58386542 = temperature 0/0/CPU0/1
entPhysicalName.58388130 = voltage 0/0/CPU0/1
entPhysicalName.59027023 = cpu 0/1/CPU0
entPhysicalName.59227245 = power Rx 0/0/CPU0/17
entPhysicalName.59230118 = slot mau GigabitEthernet0/0/CPU0/16
entPhysicalName.59373463 = slot mau GigabitEthernet0/0/CPU0/19
entPhysicalName.59623968 = slot mau GigabitEthernet0/1/CPU0/8
entPhysicalName.59817663 = slot mau GigabitEthernet0/1/CPU0/9
entPhysicalName.60487386 = slot compact-flash 0/RSP1/CPU0
entPhysicalName.61066755 = voltage 0/RSP1/CPU0
entPhysicalName.61068375 = voltage 0/RSP1/CPU0
entPhysicalName.61070059 = temperature 0/RSP1/CPU0
entPhysicalName.61178010 = current 0/1/CPU0/0
entPhysicalName.61220332 = voltage 0/1/CPU0
entPhysicalName.61221920 = voltage 0/1/CPU0
entPhysicalName.61368969 = voltage 0/1/CPU0
entPhysicalName.61370589 = voltage 0/1/CPU0
entPhysicalName.61373861 = voltage 0/1/CPU0
entPhysicalName.61526345 = voltage 0/1/CPU0/18
entPhysicalName.61527965 = temperature 0/1/CPU0/18
entPhysicalName.61764658 = MgmtEth0/RSP0/CPU0/0
entPhysicalName.61932028 = slot mau GigabitEthernet0/0/CPU0/14
entPhysicalName.62867599 = temperature 0/1/CPU0/3
entPhysicalName.62869187 = voltage 0/1/CPU0/3
entPhysicalName.63237143 = voltage 0/RSP0/CPU0
entPhysicalName.63238827 = voltage 0/RSP0/CPU0
entPhysicalName.63324090 = slot mau GigabitEthernet0/1/CPU0/17
entPhysicalName.63915527 = voltage 0/0/CPU0
entPhysicalName.63917147 = voltage 0/0/CPU0
entPhysicalName.64355058 = current 0/1/CPU0/7
entPhysicalName.64909645 = daughtercard 0/1/CPU0
entPhysicalName.65255487 = GigabitEthernet0/1/0/17
entPhysicalName.65257075 = GigabitEthernet0/1/0/13
entPhysicalName.65270958 = slot mau GigabitEthernet0/0/CPU0/3
entPhysicalName.65404124 = GigabitEthernet0/1/0/9
entPhysicalName.65407396 = GigabitEthernet0/1/0/1
entPhysicalName.65407752 = module mau GigabitEthernet0/0/CPU0/17
entPhysicalName.65409016 = GigabitEthernet0/1/0/5
entPhysicalName.65576751 = module mau GigabitEthernet0/0/CPU0/0
entPhysicalName.65638306 = current 0/0/CPU0/2
entPhysicalName.65731683 = MgmtEth0/RSP1/CPU0/0
entPhysicalName.65733054 = slot mau GigabitEthernet0/1/CPU0/6
entPhysicalName.65849678 = power Tx 0/1/CPU0/5
entPhysicalName.66317929 = voltage 0/RSP1/CPU0
entPhysicalName.66319549 = voltage 0/RSP1/CPU0
entPhysicalName.66417923 = current 0/0/CPU0/0
entPhysicalName.66459723 = slot mau GigabitEthernet0/1/CPU0/14
entPhysicalName.66562284 = temperature 0/0/CPU0/0
entPhysicalName.67108466 = power Tx 0/0/CPU0/19

View File

@ -0,0 +1,287 @@
entPhysicalDescr.1 = HP J9091A Switch E8212zl (Formerly ProCurve)
entPhysicalDescr.2 = HP J9091A Switch backplane
entPhysicalDescr.3 = HP J9091A Switch power supply bay pseudocontainer
entPhysicalDescr.4 = HP J9091A Switch slot pseudocontainer
entPhysicalDescr.5 = HP J9091A Switch fan
entPhysicalDescr.6 = HP J9091A Switch fan
entPhysicalDescr.7 = HP J9091A Switch fan
entPhysicalDescr.8 = HP J9091A Switch fan
entPhysicalDescr.9 = HP J9091A Switch fan
entPhysicalDescr.10 = HP J9091A Switch fan
entPhysicalDescr.11 = HP J9091A Switch temperature sensor
entPhysicalDescr.14 = HP J9091A Switch temperature sensor
entPhysicalDescr.15 = HP J9091A Switch temperature sensor
entPhysicalDescr.17 = HP J9091A Switch temperature sensor
entPhysicalDescr.18 = HP J9091A Switch temperature sensor
entPhysicalDescr.21 = HP J9091A Switch temperature sensor
entPhysicalDescr.22 = HP J9091A Switch temperature sensor
entPhysicalDescr.23 = HP J9091A Switch temperature sensor
entPhysicalDescr.24 = HP J9091A Switch temperature sensor
entPhysicalDescr.25 = HP J9091A Switch temperature sensor
entPhysicalDescr.26 = HP J9091A Switch temperature sensor
entPhysicalDescr.27 = HP J9091A Switch temperature sensor
entPhysicalDescr.28 = HP J9091A Switch temperature sensor
entPhysicalDescr.31 = HP J9091A Switch power supply bay
entPhysicalDescr.32 = HP J9091A Switch power supply bay
entPhysicalDescr.33 = HP J9091A Switch power supply bay
entPhysicalDescr.34 = HP J9091A Switch power supply bay
entPhysicalDescr.35 = HP J9091A Switch power supply
entPhysicalDescr.36 = HP J9091A Switch power supply
entPhysicalDescr.38 = HP J9091A Switch power supply
entPhysicalDescr.42 = HP J9091A Switch Management Module Slot
entPhysicalDescr.43 = HP J9091A Switch Management Module Slot
entPhysicalDescr.44 = HP J9091A Switch Fabric Slot
entPhysicalDescr.45 = HP J9091A Switch Fabric Slot
entPhysicalDescr.46 = HP J9091A System Support Module Slot
entPhysicalDescr.47 = HP J9091A Switch port module slot
entPhysicalDescr.48 = HP J9091A Switch port module slot
entPhysicalDescr.49 = HP J9091A Switch port module slot
entPhysicalDescr.50 = HP J9091A Switch port module slot
entPhysicalDescr.51 = HP J9091A Switch port module slot
entPhysicalDescr.52 = HP J9091A Switch port module slot
entPhysicalDescr.53 = HP J9091A Switch port module slot
entPhysicalDescr.54 = HP J9091A Switch port module slot
entPhysicalDescr.55 = HP J9091A Switch port module slot
entPhysicalDescr.56 = HP J9091A Switch port module slot
entPhysicalDescr.57 = HP J9091A Switch port module slot
entPhysicalDescr.58 = HP J9091A Switch port module slot
entPhysicalDescr.59 = HP J9092A Management Module 8200zl
entPhysicalDescr.60 = HP J9092A Management Module 8200zl
entPhysicalDescr.61 = HP J9093A Fabric Module 8200zl
entPhysicalDescr.62 = HP J9093A Fabric Module 8200zl
entPhysicalDescr.63 = HP J9095A System Support Module
entPhysicalDescr.64 = HP J8706A 24p SFP zl Module
entPhysicalDescr.65 = HP J8707A 4p 10-GbE zl Module
entPhysicalDescr.68 = HP J8702A 24p Gig-T zl Module
entPhysicalDescr.69 = HP J8702A 24p Gig-T zl Module
entPhysicalDescr.70 = HP J8702A 24p Gig-T zl Module
entPhysicalDescr.71 = HP J8702A 24p Gig-T zl Module
entPhysicalDescr.72 = HP J8702A 24p Gig-T zl Module
entPhysicalDescr.73 = HP J8702A 24p Gig-T zl Module
entPhysicalDescr.74 = HP J8702A 24p Gig-T zl Module
entPhysicalDescr.75 = HP J8702A 24p Gig-T zl Module
entPhysicalDescr.76 = HP J8706A 1000BASE-SX Port
entPhysicalDescr.77 = HP J8706A 1000BASE-SX Port
entPhysicalDescr.78 = HP J8706A 1000BASE-SX Port
entPhysicalDescr.79 = HP J8706A 1000BASE-SX Port
entPhysicalDescr.80 = HP J8706A 1000BASE-SX Port
entPhysicalDescr.81 = HP J8706A 1000BASE-SX Port
entPhysicalDescr.82 = HP J8706A 1000BASE-SX Port
entPhysicalDescr.83 = HP J8706A No Card
entPhysicalDescr.84 = HP J8706A 1000BASE-SX Port
entPhysicalDescr.85 = HP J8706A 1000BASE-SX Port
entPhysicalDescr.86 = HP J8706A No Card
entPhysicalDescr.87 = HP J8706A No Card
entPhysicalDescr.88 = HP J8706A 1000BASE-SX Port
entPhysicalDescr.89 = HP J8706A 1000BASE-SX Port
entPhysicalDescr.90 = HP J8706A 1000BASE-SX Port
entPhysicalDescr.91 = HP J8706A 1000BASE-SX Port
entPhysicalDescr.92 = HP J8706A No Card
entPhysicalDescr.93 = HP J8706A No Card
entPhysicalDescr.94 = HP J8706A No Card
entPhysicalDescr.95 = HP J8706A No Card
entPhysicalDescr.96 = HP J8706A 1000BASE-SX Port
entPhysicalDescr.97 = HP J8706A 1000BASE-SX Port
entPhysicalDescr.98 = HP J8706A 1000BASE-SX Port
entPhysicalDescr.99 = HP J8706A No Card
entPhysicalDescr.100 = HP J8707A No Card
entPhysicalDescr.101 = HP J8707A 10GIGBASE-LR Port
entPhysicalDescr.102 = HP J8707A 10GIGBASE-LR Port
entPhysicalDescr.103 = HP J8707A No Card
entPhysicalDescr.172 = HP J8702A 100/1000BASE-T Port
entPhysicalDescr.173 = HP J8702A 100/1000BASE-T Port
entPhysicalDescr.174 = HP J8702A 100/1000BASE-T Port
entPhysicalDescr.175 = HP J8702A 100/1000BASE-T Port
entPhysicalDescr.176 = HP J8702A 100/1000BASE-T Port
entPhysicalDescr.177 = HP J8702A 100/1000BASE-T Port
entPhysicalDescr.178 = HP J8702A 100/1000BASE-T Port
entPhysicalDescr.179 = HP J8702A 100/1000BASE-T Port
entPhysicalDescr.180 = HP J8702A 100/1000BASE-T Port
entPhysicalDescr.181 = HP J8702A 100/1000BASE-T Port
entPhysicalDescr.182 = HP J8702A 100/1000BASE-T Port
entPhysicalDescr.183 = HP J8702A 100/1000BASE-T Port
entPhysicalDescr.184 = HP J8702A 100/1000BASE-T Port
entPhysicalDescr.185 = HP J8702A 100/1000BASE-T Port
entPhysicalDescr.186 = HP J8702A 100/1000BASE-T Port
entPhysicalDescr.187 = HP J8702A 100/1000BASE-T Port
entPhysicalDescr.188 = HP J8702A 100/1000BASE-T Port
entPhysicalDescr.189 = HP J8702A 100/1000BASE-T Port
entPhysicalDescr.190 = HP J8702A 100/1000BASE-T Port
entPhysicalDescr.191 = HP J8702A 100/1000BASE-T Port
entPhysicalDescr.192 = HP J8702A 100/1000BASE-T Port
entPhysicalDescr.193 = HP J8702A 100/1000BASE-T Port
entPhysicalDescr.194 = HP J8702A 100/1000BASE-T Port
entPhysicalDescr.195 = HP J8702A 100/1000BASE-T Port
entPhysicalDescr.196 = HP J8702A 100/1000BASE-T Port
entPhysicalDescr.197 = HP J8702A 100/1000BASE-T Port
entPhysicalDescr.198 = HP J8702A 100/1000BASE-T Port
entPhysicalDescr.199 = HP J8702A 100/1000BASE-T Port
entPhysicalDescr.200 = HP J8702A 100/1000BASE-T Port
entPhysicalDescr.201 = HP J8702A 100/1000BASE-T Port
entPhysicalDescr.202 = HP J8702A 100/1000BASE-T Port
entPhysicalDescr.203 = HP J8702A 100/1000BASE-T Port
entPhysicalDescr.204 = HP J8702A 100/1000BASE-T Port
entPhysicalDescr.205 = HP J8702A 100/1000BASE-T Port
entPhysicalDescr.206 = HP J8702A 100/1000BASE-T Port
entPhysicalDescr.207 = HP J8702A 100/1000BASE-T Port
entPhysicalDescr.208 = HP J8702A 100/1000BASE-T Port
entPhysicalDescr.209 = HP J8702A 100/1000BASE-T Port
entPhysicalDescr.210 = HP J8702A 100/1000BASE-T Port
entPhysicalDescr.211 = HP J8702A 100/1000BASE-T Port
entPhysicalDescr.212 = HP J8702A 100/1000BASE-T Port
entPhysicalDescr.213 = HP J8702A 100/1000BASE-T Port
entPhysicalDescr.214 = HP J8702A 100/1000BASE-T Port
entPhysicalDescr.215 = HP J8702A 100/1000BASE-T Port
entPhysicalDescr.216 = HP J8702A 100/1000BASE-T Port
entPhysicalDescr.217 = HP J8702A 100/1000BASE-T Port
entPhysicalDescr.218 = HP J8702A 100/1000BASE-T Port
entPhysicalDescr.219 = HP J8702A 100/1000BASE-T Port
entPhysicalDescr.220 = HP J8702A 100/1000BASE-T Port
entPhysicalDescr.221 = HP J8702A 100/1000BASE-T Port
entPhysicalDescr.222 = HP J8702A 100/1000BASE-T Port
entPhysicalDescr.223 = HP J8702A 100/1000BASE-T Port
entPhysicalDescr.224 = HP J8702A 100/1000BASE-T Port
entPhysicalDescr.225 = HP J8702A 100/1000BASE-T Port
entPhysicalDescr.226 = HP J8702A 100/1000BASE-T Port
entPhysicalDescr.227 = HP J8702A 100/1000BASE-T Port
entPhysicalDescr.228 = HP J8702A 100/1000BASE-T Port
entPhysicalDescr.229 = HP J8702A 100/1000BASE-T Port
entPhysicalDescr.230 = HP J8702A 100/1000BASE-T Port
entPhysicalDescr.231 = HP J8702A 100/1000BASE-T Port
entPhysicalDescr.232 = HP J8702A 100/1000BASE-T Port
entPhysicalDescr.233 = HP J8702A 100/1000BASE-T Port
entPhysicalDescr.234 = HP J8702A 100/1000BASE-T Port
entPhysicalDescr.235 = HP J8702A 100/1000BASE-T Port
entPhysicalDescr.236 = HP J8702A 100/1000BASE-T Port
entPhysicalDescr.237 = HP J8702A 100/1000BASE-T Port
entPhysicalDescr.238 = HP J8702A 100/1000BASE-T Port
entPhysicalDescr.239 = HP J8702A 100/1000BASE-T Port
entPhysicalDescr.240 = HP J8702A 100/1000BASE-T Port
entPhysicalDescr.241 = HP J8702A 100/1000BASE-T Port
entPhysicalDescr.242 = HP J8702A 100/1000BASE-T Port
entPhysicalDescr.243 = HP J8702A 100/1000BASE-T Port
entPhysicalDescr.244 = HP J8702A 100/1000BASE-T Port
entPhysicalDescr.245 = HP J8702A 100/1000BASE-T Port
entPhysicalDescr.246 = HP J8702A 100/1000BASE-T Port
entPhysicalDescr.247 = HP J8702A 100/1000BASE-T Port
entPhysicalDescr.248 = HP J8702A 100/1000BASE-T Port
entPhysicalDescr.249 = HP J8702A 100/1000BASE-T Port
entPhysicalDescr.250 = HP J8702A 100/1000BASE-T Port
entPhysicalDescr.251 = HP J8702A 100/1000BASE-T Port
entPhysicalDescr.252 = HP J8702A 100/1000BASE-T Port
entPhysicalDescr.253 = HP J8702A 100/1000BASE-T Port
entPhysicalDescr.254 = HP J8702A 100/1000BASE-T Port
entPhysicalDescr.255 = HP J8702A 100/1000BASE-T Port
entPhysicalDescr.256 = HP J8702A 100/1000BASE-T Port
entPhysicalDescr.257 = HP J8702A 100/1000BASE-T Port
entPhysicalDescr.258 = HP J8702A 100/1000BASE-T Port
entPhysicalDescr.259 = HP J8702A 100/1000BASE-T Port
entPhysicalDescr.260 = HP J8702A 100/1000BASE-T Port
entPhysicalDescr.261 = HP J8702A 100/1000BASE-T Port
entPhysicalDescr.262 = HP J8702A 100/1000BASE-T Port
entPhysicalDescr.263 = HP J8702A 100/1000BASE-T Port
entPhysicalDescr.264 = HP J8702A 100/1000BASE-T Port
entPhysicalDescr.265 = HP J8702A 100/1000BASE-T Port
entPhysicalDescr.266 = HP J8702A 100/1000BASE-T Port
entPhysicalDescr.267 = HP J8702A 100/1000BASE-T Port
entPhysicalDescr.268 = HP J8702A 100/1000BASE-T Port
entPhysicalDescr.269 = HP J8702A 100/1000BASE-T Port
entPhysicalDescr.270 = HP J8702A 100/1000BASE-T Port
entPhysicalDescr.271 = HP J8702A 100/1000BASE-T Port
entPhysicalDescr.272 = HP J8702A 100/1000BASE-T Port
entPhysicalDescr.273 = HP J8702A 100/1000BASE-T Port
entPhysicalDescr.274 = HP J8702A 100/1000BASE-T Port
entPhysicalDescr.275 = HP J8702A 100/1000BASE-T Port
entPhysicalDescr.276 = HP J8702A 100/1000BASE-T Port
entPhysicalDescr.277 = HP J8702A 100/1000BASE-T Port
entPhysicalDescr.278 = HP J8702A 100/1000BASE-T Port
entPhysicalDescr.279 = HP J8702A 100/1000BASE-T Port
entPhysicalDescr.280 = HP J8702A 100/1000BASE-T Port
entPhysicalDescr.281 = HP J8702A 100/1000BASE-T Port
entPhysicalDescr.282 = HP J8702A 100/1000BASE-T Port
entPhysicalDescr.283 = HP J8702A 100/1000BASE-T Port
entPhysicalDescr.284 = HP J8702A 100/1000BASE-T Port
entPhysicalDescr.285 = HP J8702A 100/1000BASE-T Port
entPhysicalDescr.286 = HP J8702A 100/1000BASE-T Port
entPhysicalDescr.287 = HP J8702A 100/1000BASE-T Port
entPhysicalDescr.288 = HP J8702A 100/1000BASE-T Port
entPhysicalDescr.289 = HP J8702A 100/1000BASE-T Port
entPhysicalDescr.290 = HP J8702A 100/1000BASE-T Port
entPhysicalDescr.291 = HP J8702A 100/1000BASE-T Port
entPhysicalDescr.292 = HP J8702A 100/1000BASE-T Port
entPhysicalDescr.293 = HP J8702A 100/1000BASE-T Port
entPhysicalDescr.294 = HP J8702A 100/1000BASE-T Port
entPhysicalDescr.295 = HP J8702A 100/1000BASE-T Port
entPhysicalDescr.296 = HP J8702A 100/1000BASE-T Port
entPhysicalDescr.297 = HP J8702A 100/1000BASE-T Port
entPhysicalDescr.298 = HP J8702A 100/1000BASE-T Port
entPhysicalDescr.299 = HP J8702A 100/1000BASE-T Port
entPhysicalDescr.300 = HP J8702A 100/1000BASE-T Port
entPhysicalDescr.301 = HP J8702A 100/1000BASE-T Port
entPhysicalDescr.302 = HP J8702A 100/1000BASE-T Port
entPhysicalDescr.303 = HP J8702A 100/1000BASE-T Port
entPhysicalDescr.304 = HP J8702A 100/1000BASE-T Port
entPhysicalDescr.305 = HP J8702A 100/1000BASE-T Port
entPhysicalDescr.306 = HP J8702A 100/1000BASE-T Port
entPhysicalDescr.307 = HP J8702A 100/1000BASE-T Port
entPhysicalDescr.308 = HP J8702A 100/1000BASE-T Port
entPhysicalDescr.309 = HP J8702A 100/1000BASE-T Port
entPhysicalDescr.310 = HP J8702A 100/1000BASE-T Port
entPhysicalDescr.311 = HP J8702A 100/1000BASE-T Port
entPhysicalDescr.312 = HP J8702A 100/1000BASE-T Port
entPhysicalDescr.313 = HP J8702A 100/1000BASE-T Port
entPhysicalDescr.314 = HP J8702A 100/1000BASE-T Port
entPhysicalDescr.315 = HP J8702A 100/1000BASE-T Port
entPhysicalDescr.316 = HP J8702A 100/1000BASE-T Port
entPhysicalDescr.317 = HP J8702A 100/1000BASE-T Port
entPhysicalDescr.318 = HP J8702A 100/1000BASE-T Port
entPhysicalDescr.319 = HP J8702A 100/1000BASE-T Port
entPhysicalDescr.320 = HP J8702A 100/1000BASE-T Port
entPhysicalDescr.321 = HP J8702A 100/1000BASE-T Port
entPhysicalDescr.322 = HP J8702A 100/1000BASE-T Port
entPhysicalDescr.323 = HP J8702A 100/1000BASE-T Port
entPhysicalDescr.324 = HP J8702A 100/1000BASE-T Port
entPhysicalDescr.325 = HP J8702A 100/1000BASE-T Port
entPhysicalDescr.326 = HP J8702A 100/1000BASE-T Port
entPhysicalDescr.327 = HP J8702A 100/1000BASE-T Port
entPhysicalDescr.328 = HP J8702A 100/1000BASE-T Port
entPhysicalDescr.329 = HP J8702A 100/1000BASE-T Port
entPhysicalDescr.330 = HP J8702A 100/1000BASE-T Port
entPhysicalDescr.331 = HP J8702A 100/1000BASE-T Port
entPhysicalDescr.332 = HP J8702A 100/1000BASE-T Port
entPhysicalDescr.333 = HP J8702A 100/1000BASE-T Port
entPhysicalDescr.334 = HP J8702A 100/1000BASE-T Port
entPhysicalDescr.335 = HP J8702A 100/1000BASE-T Port
entPhysicalDescr.336 = HP J8702A 100/1000BASE-T Port
entPhysicalDescr.337 = HP J8702A 100/1000BASE-T Port
entPhysicalDescr.338 = HP J8702A 100/1000BASE-T Port
entPhysicalDescr.339 = HP J8702A 100/1000BASE-T Port
entPhysicalDescr.340 = HP J8702A 100/1000BASE-T Port
entPhysicalDescr.341 = HP J8702A 100/1000BASE-T Port
entPhysicalDescr.342 = HP J8702A 100/1000BASE-T Port
entPhysicalDescr.343 = HP J8702A 100/1000BASE-T Port
entPhysicalDescr.344 = HP J8702A 100/1000BASE-T Port
entPhysicalDescr.345 = HP J8702A 100/1000BASE-T Port
entPhysicalDescr.346 = HP J8702A 100/1000BASE-T Port
entPhysicalDescr.347 = HP J8702A 100/1000BASE-T Port
entPhysicalDescr.348 = HP J8702A 100/1000BASE-T Port
entPhysicalDescr.349 = HP J8702A 100/1000BASE-T Port
entPhysicalDescr.350 = HP J8702A 100/1000BASE-T Port
entPhysicalDescr.351 = HP J8702A 100/1000BASE-T Port
entPhysicalDescr.352 = HP J8702A 100/1000BASE-T Port
entPhysicalDescr.353 = HP J8702A 100/1000BASE-T Port
entPhysicalDescr.354 = HP J8702A 100/1000BASE-T Port
entPhysicalDescr.355 = HP J8702A 100/1000BASE-T Port
entPhysicalDescr.356 = HP J8702A 100/1000BASE-T Port
entPhysicalDescr.357 = HP J8702A 100/1000BASE-T Port
entPhysicalDescr.358 = HP J8702A 100/1000BASE-T Port
entPhysicalDescr.359 = HP J8702A 100/1000BASE-T Port
entPhysicalDescr.360 = HP J8702A 100/1000BASE-T Port
entPhysicalDescr.361 = HP J8702A 100/1000BASE-T Port
entPhysicalDescr.362 = HP J8702A 100/1000BASE-T Port
entPhysicalDescr.363 = HP J8702A 100/1000BASE-T Port
entPhysicalDescr.364 = Reset, I2C, System interface, Dual MM
entPhysicalDescr.365 = Front panel LEDs
entPhysicalDescr.404 = EPS, LED, 50V
entPhysicalDescr.405 = HA, SIO, IPS
entPhysicalDescr.406 = Reset, Hotswap

View File

@ -0,0 +1,287 @@
entPhysicalName.1 = Chassis
entPhysicalName.2 = Backplane
entPhysicalName.3 =
entPhysicalName.4 =
entPhysicalName.5 = Fan 1
entPhysicalName.6 = Fan 2
entPhysicalName.7 = Fan 3
entPhysicalName.8 = Fan 4
entPhysicalName.9 = Fan 5
entPhysicalName.10 = Fan 6
entPhysicalName.11 = Chassis Temperature
entPhysicalName.14 = Fabric Module 1 Temperature
entPhysicalName.15 = Fabric Module 2 Temperature
entPhysicalName.17 = Slot A Temperature
entPhysicalName.18 = Slot B Temperature
entPhysicalName.21 = Slot E Temperature
entPhysicalName.22 = Slot F Temperature
entPhysicalName.23 = Slot G Temperature
entPhysicalName.24 = Slot H Temperature
entPhysicalName.25 = Slot I Temperature
entPhysicalName.26 = Slot J Temperature
entPhysicalName.27 = Slot K Temperature
entPhysicalName.28 = Slot L Temperature
entPhysicalName.31 = Power Supply Bay 1
entPhysicalName.32 = Power Supply Bay 2
entPhysicalName.33 = Power Supply Bay 3
entPhysicalName.34 = Power Supply Bay 4
entPhysicalName.35 = Power Supply 1
entPhysicalName.36 = Power Supply 2
entPhysicalName.38 = Power Supply 4
entPhysicalName.42 = Switch Management Module Slot
entPhysicalName.43 = Switch Management Module Slot
entPhysicalName.44 = Switch Fabric Slot
entPhysicalName.45 = Switch Fabric Slot
entPhysicalName.46 = System Support Module Slot
entPhysicalName.47 = Slot A
entPhysicalName.48 = Slot B
entPhysicalName.49 = Slot C
entPhysicalName.50 = Slot D
entPhysicalName.51 = Slot E
entPhysicalName.52 = Slot F
entPhysicalName.53 = Slot G
entPhysicalName.54 = Slot H
entPhysicalName.55 = Slot I
entPhysicalName.56 = Slot J
entPhysicalName.57 = Slot K
entPhysicalName.58 = Slot L
entPhysicalName.59 = Switch Management Module
entPhysicalName.60 = Switch Management Module
entPhysicalName.61 = Switch Fabric
entPhysicalName.62 = Switch Fabric
entPhysicalName.63 = System Support Module
entPhysicalName.64 = A
entPhysicalName.65 = B
entPhysicalName.68 = E
entPhysicalName.69 = F
entPhysicalName.70 = G
entPhysicalName.71 = H
entPhysicalName.72 = I
entPhysicalName.73 = J
entPhysicalName.74 = K
entPhysicalName.75 = L
entPhysicalName.76 = Port A1
entPhysicalName.77 = Port A2
entPhysicalName.78 = Port A3
entPhysicalName.79 = Port A4
entPhysicalName.80 = Port A5
entPhysicalName.81 = Port A6
entPhysicalName.82 = Port A7
entPhysicalName.83 = Port A8
entPhysicalName.84 = Port A9
entPhysicalName.85 = Port A10
entPhysicalName.86 = Port A11
entPhysicalName.87 = Port A12
entPhysicalName.88 = Port A13
entPhysicalName.89 = Port A14
entPhysicalName.90 = Port A15
entPhysicalName.91 = Port A16
entPhysicalName.92 = Port A17
entPhysicalName.93 = Port A18
entPhysicalName.94 = Port A19
entPhysicalName.95 = Port A20
entPhysicalName.96 = Port A21
entPhysicalName.97 = Port A22
entPhysicalName.98 = Port A23
entPhysicalName.99 = Port A24
entPhysicalName.100 = Port B1
entPhysicalName.101 = Port B2
entPhysicalName.102 = Port B3
entPhysicalName.103 = Port B4
entPhysicalName.172 = Port E1
entPhysicalName.173 = Port E2
entPhysicalName.174 = Port E3
entPhysicalName.175 = Port E4
entPhysicalName.176 = Port E5
entPhysicalName.177 = Port E6
entPhysicalName.178 = Port E7
entPhysicalName.179 = Port E8
entPhysicalName.180 = Port E9
entPhysicalName.181 = Port E10
entPhysicalName.182 = Port E11
entPhysicalName.183 = Port E12
entPhysicalName.184 = Port E13
entPhysicalName.185 = Port E14
entPhysicalName.186 = Port E15
entPhysicalName.187 = Port E16
entPhysicalName.188 = Port E17
entPhysicalName.189 = Port E18
entPhysicalName.190 = Port E19
entPhysicalName.191 = Port E20
entPhysicalName.192 = Port E21
entPhysicalName.193 = Port E22
entPhysicalName.194 = Port E23
entPhysicalName.195 = Port E24
entPhysicalName.196 = Port F1
entPhysicalName.197 = Port F2
entPhysicalName.198 = Port F3
entPhysicalName.199 = Port F4
entPhysicalName.200 = Port F5
entPhysicalName.201 = Port F6
entPhysicalName.202 = Port F7
entPhysicalName.203 = Port F8
entPhysicalName.204 = Port F9
entPhysicalName.205 = Port F10
entPhysicalName.206 = Port F11
entPhysicalName.207 = Port F12
entPhysicalName.208 = Port F13
entPhysicalName.209 = Port F14
entPhysicalName.210 = Port F15
entPhysicalName.211 = Port F16
entPhysicalName.212 = Port F17
entPhysicalName.213 = Port F18
entPhysicalName.214 = Port F19
entPhysicalName.215 = Port F20
entPhysicalName.216 = Port F21
entPhysicalName.217 = Port F22
entPhysicalName.218 = Port F23
entPhysicalName.219 = Port F24
entPhysicalName.220 = Port G1
entPhysicalName.221 = Port G2
entPhysicalName.222 = Port G3
entPhysicalName.223 = Port G4
entPhysicalName.224 = Port G5
entPhysicalName.225 = Port G6
entPhysicalName.226 = Port G7
entPhysicalName.227 = Port G8
entPhysicalName.228 = Port G9
entPhysicalName.229 = Port G10
entPhysicalName.230 = Port G11
entPhysicalName.231 = Port G12
entPhysicalName.232 = Port G13
entPhysicalName.233 = Port G14
entPhysicalName.234 = Port G15
entPhysicalName.235 = Port G16
entPhysicalName.236 = Port G17
entPhysicalName.237 = Port G18
entPhysicalName.238 = Port G19
entPhysicalName.239 = Port G20
entPhysicalName.240 = Port G21
entPhysicalName.241 = Port G22
entPhysicalName.242 = Port G23
entPhysicalName.243 = Port G24
entPhysicalName.244 = Port H1
entPhysicalName.245 = Port H2
entPhysicalName.246 = Port H3
entPhysicalName.247 = Port H4
entPhysicalName.248 = Port H5
entPhysicalName.249 = Port H6
entPhysicalName.250 = Port H7
entPhysicalName.251 = Port H8
entPhysicalName.252 = Port H9
entPhysicalName.253 = Port H10
entPhysicalName.254 = Port H11
entPhysicalName.255 = Port H12
entPhysicalName.256 = Port H13
entPhysicalName.257 = Port H14
entPhysicalName.258 = Port H15
entPhysicalName.259 = Port H16
entPhysicalName.260 = Port H17
entPhysicalName.261 = Port H18
entPhysicalName.262 = Port H19
entPhysicalName.263 = Port H20
entPhysicalName.264 = Port H21
entPhysicalName.265 = Port H22
entPhysicalName.266 = Port H23
entPhysicalName.267 = Port H24
entPhysicalName.268 = Port I1
entPhysicalName.269 = Port I2
entPhysicalName.270 = Port I3
entPhysicalName.271 = Port I4
entPhysicalName.272 = Port I5
entPhysicalName.273 = Port I6
entPhysicalName.274 = Port I7
entPhysicalName.275 = Port I8
entPhysicalName.276 = Port I9
entPhysicalName.277 = Port I10
entPhysicalName.278 = Port I11
entPhysicalName.279 = Port I12
entPhysicalName.280 = Port I13
entPhysicalName.281 = Port I14
entPhysicalName.282 = Port I15
entPhysicalName.283 = Port I16
entPhysicalName.284 = Port I17
entPhysicalName.285 = Port I18
entPhysicalName.286 = Port I19
entPhysicalName.287 = Port I20
entPhysicalName.288 = Port I21
entPhysicalName.289 = Port I22
entPhysicalName.290 = Port I23
entPhysicalName.291 = Port I24
entPhysicalName.292 = Port J1
entPhysicalName.293 = Port J2
entPhysicalName.294 = Port J3
entPhysicalName.295 = Port J4
entPhysicalName.296 = Port J5
entPhysicalName.297 = Port J6
entPhysicalName.298 = Port J7
entPhysicalName.299 = Port J8
entPhysicalName.300 = Port J9
entPhysicalName.301 = Port J10
entPhysicalName.302 = Port J11
entPhysicalName.303 = Port J12
entPhysicalName.304 = Port J13
entPhysicalName.305 = Port J14
entPhysicalName.306 = Port J15
entPhysicalName.307 = Port J16
entPhysicalName.308 = Port J17
entPhysicalName.309 = Port J18
entPhysicalName.310 = Port J19
entPhysicalName.311 = Port J20
entPhysicalName.312 = Port J21
entPhysicalName.313 = Port J22
entPhysicalName.314 = Port J23
entPhysicalName.315 = Port J24
entPhysicalName.316 = Port K1
entPhysicalName.317 = Port K2
entPhysicalName.318 = Port K3
entPhysicalName.319 = Port K4
entPhysicalName.320 = Port K5
entPhysicalName.321 = Port K6
entPhysicalName.322 = Port K7
entPhysicalName.323 = Port K8
entPhysicalName.324 = Port K9
entPhysicalName.325 = Port K10
entPhysicalName.326 = Port K11
entPhysicalName.327 = Port K12
entPhysicalName.328 = Port K13
entPhysicalName.329 = Port K14
entPhysicalName.330 = Port K15
entPhysicalName.331 = Port K16
entPhysicalName.332 = Port K17
entPhysicalName.333 = Port K18
entPhysicalName.334 = Port K19
entPhysicalName.335 = Port K20
entPhysicalName.336 = Port K21
entPhysicalName.337 = Port K22
entPhysicalName.338 = Port K23
entPhysicalName.339 = Port K24
entPhysicalName.340 = Port L1
entPhysicalName.341 = Port L2
entPhysicalName.342 = Port L3
entPhysicalName.343 = Port L4
entPhysicalName.344 = Port L5
entPhysicalName.345 = Port L6
entPhysicalName.346 = Port L7
entPhysicalName.347 = Port L8
entPhysicalName.348 = Port L9
entPhysicalName.349 = Port L10
entPhysicalName.350 = Port L11
entPhysicalName.351 = Port L12
entPhysicalName.352 = Port L13
entPhysicalName.353 = Port L14
entPhysicalName.354 = Port L15
entPhysicalName.355 = Port L16
entPhysicalName.356 = Port L17
entPhysicalName.357 = Port L18
entPhysicalName.358 = Port L19
entPhysicalName.359 = Port L20
entPhysicalName.360 = Port L21
entPhysicalName.361 = Port L22
entPhysicalName.362 = Port L23
entPhysicalName.363 = Port L24
entPhysicalName.364 = SSC
entPhysicalName.365 = CSI
entPhysicalName.404 = CSI
entPhysicalName.405 = GP1
entPhysicalName.406 = GP2

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,4 @@
{
"dupsIdentManufacturer": "Delta",
"dupsIdentModel": "UPS302R2RT2B035"
}

View File

@ -0,0 +1,46 @@
{
"121": {
"14": {
"1182": {
"lldpRemSysDesc": "Ruijie 10G Ethernet Switch(S2910-48GT4XS-E) By Ruijie Networks"
}
}
},
"120": {
"21": {
"2486": {
"lldpRemSysDesc": "S5700S-52P-LI-AC"
}
},
"24": {
"1072": {
"lldpRemSysDesc": "Cisco IOS Software, C2960 Software (C2960-LANBASEK9-M), Version 12.2(37)SE, RELEASE SOFTWARE (fc2)"
}
},
"32": {
"1361": {
"lldpRemSysDesc": "MikroTik RouterOS 6.40.9 (bugfix) CCR1009-8G-1S-1S+"
}
},
"36": {
"925": {
"lldpRemSysDesc": "Cisco IOS Software, C2960 Software (C2960-LANBASEK9-M), Version 12.2(37)SE, RELEASE SOFTWARE (fc2)"
}
},
"50": {
"2432": {
"lldpRemSysDesc": ""
}
},
"51": {
"948": {
"lldpRemSysDesc": "V4.10(AAGE.6) | 09\/16\/2014"
}
},
"52": {
"949": {
"lldpRemSysDesc": "V4.10(AAGE.6) | 09\/16\/2014"
}
}
}
}

View File

@ -0,0 +1,46 @@
{
"121": {
"14": {
"1182": {
"lldpRemSysDesc": "Ruijie 10G Ethernet Switch(S2910-48GT4XS-E) By Ruijie Networks"
}
}
},
"120": {
"21": {
"2486": {
"lldpRemSysDesc": "S5700S-52P-LI-AC Huawei Versatile Routing Platform Software VRP (R) software, Version 5.160 (S5700 V200R006C00SPC500) Copyright (C) 2000-2014 HUAWEI TECH CO., LTD"
}
},
"24": {
"1072": {
"lldpRemSysDesc": "Cisco IOS Software, C2960 Software (C2960-LANBASEK9-M), Version 12.2(37)SE, RELEASE SOFTWARE (fc2) Copyright (c) 1986-2007 by Cisco Systems, Inc. Compiled Thu 10-May-07 16:43 by antonino"
}
},
"32": {
"1361": {
"lldpRemSysDesc": "MikroTik RouterOS 6.40.9 (bugfix) CCR1009-8G-1S-1S+"
}
},
"36": {
"925": {
"lldpRemSysDesc": "Cisco IOS Software, C2960 Software (C2960-LANBASEK9-M), Version 12.2(37)SE, RELEASE SOFTWARE (fc2) Copyright (c) 1986-2007 by Cisco Systems, Inc. Compiled Thu 10-May-07 16:43 by antonino"
}
},
"50": {
"2432": {
"lldpRemSysDesc": ""
}
},
"51": {
"948": {
"lldpRemSysDesc": "V4.10(AAGE.6) | 09\/16\/2014"
}
},
"52": {
"949": {
"lldpRemSysDesc": "V4.10(AAGE.6) | 09\/16\/2014"
}
}
}
}

View File

@ -0,0 +1,28 @@
{
"58": {
"11": {
"1": {
"lldpRemSysDesc": ""
}
}
},
"75": {
"1": {
"2": {
"lldpRemSysDesc": ""
}
}
},
"88": {
"10": {
"9": {
"lldpRemSysDesc": ""
}
},
"12": {
"10": {
"lldpRemSysDesc": ""
}
}
}
}

View File

@ -0,0 +1,94 @@
{
"121": {
"14": {
"1182": {
"lldpRemChassisIdSubtype": "macAddress",
"lldpRemChassisId": "00 74 9C CB 53 FD ",
"lldpRemPortIdSubtype": "interfaceName",
"lldpRemPortId": "Gi0\/13",
"lldpRemPortDesc": "GigabitEthernet 0\/13",
"lldpRemSysName": "MMR-IDC3D-SW",
"lldpRemSysDesc": "Ruijie 10G Ethernet Switch(S2910-48GT4XS-E) By Ruijie Networks"
}
}
},
"120": {
"21": {
"2486": {
"lldpRemChassisIdSubtype": "macAddress",
"lldpRemChassisId": "68 8F 84 02 4E D1 ",
"lldpRemPortIdSubtype": "interfaceName",
"lldpRemPortId": "GigabitEthernet0\/0\/15",
"lldpRemPortDesc": "Peer-Upstream-Isatnet",
"lldpRemSysName": "SW-MMR-3D-JKT01",
"lldpRemSysDesc": "S5700S-52P-LI-AC Huawei Versatile Routing Platform Software VRP (R) software, Version 5.160 (S5700 V200R006C00SPC500) Copyright (C) 2000-2014 HUAWEI TECH CO., LTD"
}
},
"24": {
"1072": {
"lldpRemChassisIdSubtype": "macAddress",
"lldpRemChassisId": "00 1C B1 02 4C 94 ",
"lldpRemPortIdSubtype": "interfaceAlias",
"lldpRemPortId": "To-Isat",
"lldpRemPortDesc": "GigabitEthernet0\/20",
"lldpRemSysName": "SW01-3D-F3-MMR",
"lldpRemSysDesc": "Cisco IOS Software, C2960 Software (C2960-LANBASEK9-M), Version 12.2(37)SE, RELEASE SOFTWARE (fc2) Copyright (c) 1986-2007 by Cisco Systems, Inc. Compiled Thu 10-May-07 16:43 by antonino"
}
},
"32": {
"1361": {
"lldpRemChassisIdSubtype": "macAddress",
"lldpRemChassisId": "6C 3B 6B 1B FB DA ",
"lldpRemPortIdSubtype": "interfaceName",
"lldpRemPortId": "ether7",
"lldpRemPortDesc": "",
"lldpRemSysName": "RB-D3",
"lldpRemSysDesc": "MikroTik RouterOS 6.40.9 (bugfix) CCR1009-8G-1S-1S+"
}
},
"36": {
"925": {
"lldpRemChassisIdSubtype": "macAddress",
"lldpRemChassisId": "00 1C B1 02 4C 92 ",
"lldpRemPortIdSubtype": "interfaceAlias",
"lldpRemPortId": "Isat-2",
"lldpRemPortDesc": "GigabitEthernet0\/18",
"lldpRemSysName": "SW01-3D-F3-MMR",
"lldpRemSysDesc": "Cisco IOS Software, C2960 Software (C2960-LANBASEK9-M), Version 12.2(37)SE, RELEASE SOFTWARE (fc2) Copyright (c) 1986-2007 by Cisco Systems, Inc. Compiled Thu 10-May-07 16:43 by antonino"
}
},
"50": {
"2432": {
"lldpRemChassisIdSubtype": "macAddress",
"lldpRemChassisId": "34 17 EB 2E 16 00 ",
"lldpRemPortIdSubtype": "interfaceName",
"lldpRemPortId": "TenGigabitEthernet 1\/18",
"lldpRemPortDesc": "",
"lldpRemSysName": "",
"lldpRemSysDesc": ""
}
},
"51": {
"948": {
"lldpRemChassisIdSubtype": "macAddress",
"lldpRemChassisId": "B0 B2 DC 6F 3A 67 ",
"lldpRemPortIdSubtype": "local",
"lldpRemPortId": "51",
"lldpRemPortDesc": "To3D-Hypernet",
"lldpRemSysName": "XGS3700-Multitech",
"lldpRemSysDesc": "V4.10(AAGE.6) | 09\/16\/2014"
}
},
"52": {
"949": {
"lldpRemChassisIdSubtype": "macAddress",
"lldpRemChassisId": "B0 B2 DC 6F 3A 67 ",
"lldpRemPortIdSubtype": "local",
"lldpRemPortId": "52",
"lldpRemPortDesc": "To3D-Powertel",
"lldpRemSysName": "XGS3700-Multitech",
"lldpRemSysDesc": "V4.10(AAGE.6) | 09\/16\/2014"
}
}
}
}

View File

@ -0,0 +1,86 @@
{
"121": {
"14": {
"1182": {
"lldpRemChassisIdSubtype": "macAddress",
"lldpRemChassisId": "00 74 9C CB 53 FD ",
"lldpRemPortIdSubtype": "interfaceName",
"lldpRemPortId": "Gi0\/13",
"lldpRemPortDesc": "GigabitEthernet 0\/13",
"lldpRemSysName": "MMR-IDC3D-SW"
}
}
},
"120": {
"21": {
"2486": {
"lldpRemChassisIdSubtype": "macAddress",
"lldpRemChassisId": "68 8F 84 02 4E D1 ",
"lldpRemPortIdSubtype": "interfaceName",
"lldpRemPortId": "GigabitEthernet0\/0\/15",
"lldpRemPortDesc": "Peer-Upstream-Isatnet",
"lldpRemSysName": "SW-MMR-3D-JKT01"
}
},
"24": {
"1072": {
"lldpRemChassisIdSubtype": "macAddress",
"lldpRemChassisId": "00 1C B1 02 4C 94 ",
"lldpRemPortIdSubtype": "interfaceAlias",
"lldpRemPortId": "To-Isat",
"lldpRemPortDesc": "GigabitEthernet0\/20",
"lldpRemSysName": "SW01-3D-F3-MMR"
}
},
"32": {
"1361": {
"lldpRemChassisIdSubtype": "macAddress",
"lldpRemChassisId": "6C 3B 6B 1B FB DA ",
"lldpRemPortIdSubtype": "interfaceName",
"lldpRemPortId": "ether7",
"lldpRemPortDesc": "",
"lldpRemSysName": "RB-D3"
}
},
"36": {
"925": {
"lldpRemChassisIdSubtype": "macAddress",
"lldpRemChassisId": "00 1C B1 02 4C 92 ",
"lldpRemPortIdSubtype": "interfaceAlias",
"lldpRemPortId": "Isat-2",
"lldpRemPortDesc": "GigabitEthernet0\/18",
"lldpRemSysName": "SW01-3D-F3-MMR"
}
},
"50": {
"2432": {
"lldpRemChassisIdSubtype": "macAddress",
"lldpRemChassisId": "34 17 EB 2E 16 00 ",
"lldpRemPortIdSubtype": "interfaceName",
"lldpRemPortId": "TenGigabitEthernet 1\/18",
"lldpRemPortDesc": "",
"lldpRemSysName": ""
}
},
"51": {
"948": {
"lldpRemChassisIdSubtype": "macAddress",
"lldpRemChassisId": "B0 B2 DC 6F 3A 67 ",
"lldpRemPortIdSubtype": "local",
"lldpRemPortId": "51",
"lldpRemPortDesc": "To3D-Hypernet",
"lldpRemSysName": "XGS3700-Multitech"
}
},
"52": {
"949": {
"lldpRemChassisIdSubtype": "macAddress",
"lldpRemChassisId": "B0 B2 DC 6F 3A 67 ",
"lldpRemPortIdSubtype": "local",
"lldpRemPortId": "52",
"lldpRemPortDesc": "To3D-Powertel",
"lldpRemSysName": "XGS3700-Multitech"
}
}
}
}

View File

@ -0,0 +1,32 @@
{
"64": {
"72": {
"74": {
"193": {
"bgpPeerState": "idle",
"bgpPeerAdminStatus": "stop"
}
}
}
},
"65": {
"169": {
"15": {
"2": {
"bgpPeerState": "established",
"bgpPeerAdminStatus": "start"
}
}
}
},
"104": {
"247": {
"49": {
"221": {
"bgpPeerState": "established",
"bgpPeerAdminStatus": "start"
}
}
}
}
}

View File

@ -0,0 +1,8 @@
{
".1.3.6.1.2.1.15.3.1.2.64.72.74.193": "idle",
".1.3.6.1.2.1.15.3.1.2.65.169.15.2": "established",
".1.3.6.1.2.1.15.3.1.2.104.247.49.221": "established",
".1.3.6.1.2.1.15.3.1.3.64.72.74.193": "stop",
".1.3.6.1.2.1.15.3.1.3.65.169.15.2": "start",
".1.3.6.1.2.1.15.3.1.3.104.247.49.221": "start"
}

View File

@ -0,0 +1,26 @@
{
"0": {
"nsExtendNumEntries": "3"
},
"test1": {
"nsExtendOutputFull": "Hello, world!",
"1": {
"nsExtendOutLine": "Hello, world!"
}
},
"test2": {
"nsExtendOutputFull": "Hello, world!",
"1": {
"nsExtendOutLine": "Hello, world!"
},
"2": {
"nsExtendOutLine": "Hi there"
}
},
"distro": {
"nsExtendOutputFull": "Linux|4.4.0-77-generic|amd64|Ubuntu|16.04|kvm",
"1": {
"nsExtendOutLine": "Linux|4.4.0-77-generic|amd64|Ubuntu|16.04|kvm"
}
}
}

View File

@ -0,0 +1,6 @@
{
"": {
"dupsIdentManufacturer": "Delta",
"dupsIdentModel": "UPS302R2RT2B035"
}
}

View File

@ -0,0 +1,14 @@
{
"1": {
"1": {
"prtMarkerSuppliesDescription": "42 6C 61 63 6B 20 43 61 72 74 72 69 64 67 65 20",
"prtMarkerSuppliesType": "tonerCartridge",
"prtMarkerSuppliesLevel": "73"
},
"2": {
"prtMarkerSuppliesDescription": "4D 61 69 6E 74 65 6E 61 6E 63 65 20 4B 69 74 20",
"prtMarkerSuppliesType": "fuser",
"prtMarkerSuppliesLevel": "-2"
}
}
}

View File

@ -0,0 +1,14 @@
{
"1": {
"1": {
"prtMarkerSuppliesDescription": "42 6C 61 63 6B 20 43 61 72 74 72 69 64 67 65 20 38 31 58 20 48 50 20 43 46 32 38 31 58 00 ",
"prtMarkerSuppliesType": "tonerCartridge",
"prtMarkerSuppliesLevel": "73"
},
"2": {
"prtMarkerSuppliesDescription": "4D 61 69 6E 74 65 6E 61 6E 63 65 20 4B 69 74 20 48 50 20 31 31 30 56 2D 46 32 47 37 36 41 2C 20 32 32 30 56 2D 46 32 47 37 37 41 00 ",
"prtMarkerSuppliesType": "fuser",
"prtMarkerSuppliesLevel": "-2"
}
}
}

View File

@ -0,0 +1,14 @@
{
"1": {
"1": {
"prtMarkerSuppliesDescription": "Black Cartridge 81X HP CF281X.",
"prtMarkerSuppliesType": "tonerCartridge",
"prtMarkerSuppliesLevel": "73"
},
"2": {
"prtMarkerSuppliesDescription": "Maintenance Kit HP 110V-F2G76A, 220V-F2G77A.",
"prtMarkerSuppliesType": "fuser",
"prtMarkerSuppliesLevel": "-2"
}
}
}

View File

@ -0,0 +1,205 @@
<?php
/**
* Observium
*
* This file is part of Observium.
*
* @package observium
* @subpackage tests
* @copyright (C) 2006-2013 Adam Armstrong, (C) 2013-2016 Observium Limited
*
*/
/////////////////////////////////////////////////////////
// NO CHANGES TO THIS FILE, IT IS NOT USER-EDITABLE //
/////////////////////////////////////////////////////////
// FAKE DEFINITIONS //
/////////////////////////////////////////////////////////
$GLOBALS['cache']['db_version'] = 999; // Set fake DB version
setlocale(LC_ALL, 'C');
putenv('LC_ALL=C');
define('OBS_DEBUG', 0);
/*
set_include_path(dirname(__FILE__) . "/../../includes/pear" . PATH_SEPARATOR . get_include_path());
require("Net/IPv4.php");
require("Net/IPv6.php");
require("Console/Color2.php");
*/
unset($config['os_group']['default']); // Override default for tests
$config['os_group']['default']['graphs'][] = "device_bits";
$config['os_group']['default']['graphs'][] = "device_uptime";
$config['os_group']['default']['graphs'][] = "device_ping";
$config['os_group']['default']['comments'] = "/^\s*#/";
// MIBs enabled for any os (except blacklisted mibs)
$config['os_group']['default']['mibs'][] = "EtherLike-MIB"; // in ports module
$config['os_group']['default']['mibs'][] = "ENTITY-MIB";
$config['os_group']['default']['mibs'][] = "ENTITY-SENSOR-MIB";
$config['os_group']['default']['mibs'][] = "CISCO-ENTITY-VENDORTYPE-OID-MIB"; // Inventory module
$config['os_group']['default']['mibs'][] = "HOST-RESOURCES-MIB";
$config['os_group']['default']['mibs'][] = "Q-BRIDGE-MIB";
$config['os_group']['default']['mibs'][] = "LLDP-MIB"; // Should be before CISCO-CDP-MIB, but I not know why (in neighbours)
$config['os_group']['default']['mibs'][] = "CISCO-CDP-MIB";
$config['os_group']['default']['mibs'][] = "PW-STD-MIB"; // Pseudowires. FIXME, possible more os specific?
$config['os_group']['default']['mibs'][] = "DISMAN-PING-MIB";// RFC4560, SLA
$config['os_group']['default']['mibs'][] = "BGP4-MIB";
$os_group = "test_unix";
$config['os_group'][$os_group]['type'] = "server";
$config['os_group'][$os_group]['processor_stacked'] = 1;
$config['os_group'][$os_group]['graphs'][0] = "device_processor";
$config['os_group'][$os_group]['graphs'][1] = "device_ucd_memory";
$config['os_group'][$os_group]['mibs'][] = "UCD-SNMP-MIB"; // Should be before HOST-RESOURCES-MIB (in storage)
$config['os_group'][$os_group]['mibs'][] = "HOST-RESOURCES-MIB"; // There duplicate entry as in default, for correct order!
$config['os_group'][$os_group]['mibs'][] = "LSI-MegaRAID-SAS-MIB";
$os_group = "test_cisco";
$config['os_group'][$os_group]['type'] = "network";
$config['os_group'][$os_group]['graphs'][0] = "device_bits";
$config['os_group'][$os_group]['graphs'][1] = "device_processor";
$config['os_group'][$os_group]['graphs'][2] = "device_mempool";
$config['os_group'][$os_group]['comments'] = "/^\s*!/";
$config['os_group'][$os_group]['mibs'][] = "CISCO-IETF-IP-MIB";
$config['os_group'][$os_group]['mibs'][] = "CISCO-ENTITY-SENSOR-MIB";
$config['os_group'][$os_group]['mibs'][] = "CISCO-VTP-MIB";
$config['os_group'][$os_group]['mibs'][] = "CISCO-ENVMON-MIB";
$config['os_group'][$os_group]['mibs'][] = "CISCO-ENTITY-QFP-MIB";
$config['os_group'][$os_group]['mibs'][] = "CISCO-IP-STAT-MIB";
$config['os_group'][$os_group]['mibs'][] = "CISCO-FIREWALL-MIB";
$config['os_group'][$os_group]['mibs'][] = "CISCO-ENHANCED-MEMPOOL-MIB";
$config['os_group'][$os_group]['mibs'][] = "CISCO-MEMORY-POOL-MIB"; // Keep this below CISCO-ENHANCED-MEMPOOL-MIB, checks for duplicates.
$config['os_group'][$os_group]['mibs'][] = "CISCO-PROCESS-MIB"; // Goes after "CISCO-MEMORY-POOL-MIB" and "CISCO-ENHANCED-MEMPOOL-MIB" cos Cisco suck.
$os_group = "test_exclude";
$config['os_group'][$os_group]['type'] = "network";
$config['os_group'][$os_group]['graphs'][0] = "device_bits";
$config['os_group'][$os_group]['graphs'][1] = "device_processor";
$config['os_group'][$os_group]['graphs'][2] = "device_mempool";
$config['os_group'][$os_group]['mibs'][] = "CISCO-IETF-IP-MIB";
$config['os_group'][$os_group]['mibs'][] = "CISCO-ENTITY-SENSOR-MIB";
$config['os_group'][$os_group]['mib_blacklist'][] = "Q-BRIDGE-MIB";
$os = "test_generic";
$config['os'][$os]['text'] = "Generic Device";
$config['os'][$os]['group'] = "test_unix"; // Try detect generic device as generic Unix
// Linux-based OSes here please.
$os = "test_linux";
$config['os'][$os]['text'] = "Linux";
$config['os'][$os]['type'] = "server";
$config['os'][$os]['group'] = "test_unix";
$config['os'][$os]['ifname'] = 1;
$config['os'][$os]['snmp']['max-rep'] = 100;
$config['os'][$os]['graphs'][0] = "device_processor";
$config['os'][$os]['graphs'][1] = "device_ucd_memory";
$config['os'][$os]['graphs'][2] = "device_storage";
$config['os'][$os]['graphs'][3] = "device_bits";
$config['os'][$os]['mibs'][] = "LM-SENSORS-MIB";
$config['os'][$os]['mibs'][] = "SUPERMICRO-HEALTH-MIB";
$config['os'][$os]['mibs'][] = "MIB-Dell-10892";
$config['os'][$os]['mibs'][] = "CPQHLTH-MIB";
$config['os'][$os]['mibs'][] = "CPQIDA-MIB";
$config['os'][$os]['realtime'] = 15;
$os = "test_freebsd";
$config['os'][$os]['text'] = "FreeBSD";
$config['os'][$os]['type'] = "server";
$config['os'][$os]['group'] = "test_exclude";
$config['os'][$os]['discovery_os'] = "freebsd";
$config['os'][$os]['sysObjectID'][] = ".1.3.6.1.4.1.8072.3.2.8";
$config['os'][$os]['mib_blacklist'][] = "ENTITY-SENSOR-MIB";
$os = "test_ios";
$config['os'][$os]['text'] = "Cisco IOS";
$config['os'][$os]['group'] = "test_cisco";
$config['os'][$os]['type'] = "network";
$config['os'][$os]['discovery_os'] = "cisco";
$config['os'][$os]['snmp']['max-rep'] = 100;
$config['os'][$os]['graphs'][0] = "device_bits";
$config['os'][$os]['graphs'][1] = "device_processor";
$config['os'][$os]['graphs'][2] = "device_mempool";
$config['os'][$os]['icon'] = "cisco";
$os = "test_ciscosb";
$config['os'][$os]['text'] = "Cisco Small Business";
$config['os'][$os]['ifname'] = 1;
$config['os'][$os]['type'] = "network";
$config['os'][$os]['icon'] = "ciscosb";
$config['os'][$os]['graphs'][0] = "device_bits";
$config['os'][$os]['graphs'][1] = "device_processor";
$config['os'][$os]['sysObjectID'][] = ".1.3.6.1.4.1.9.6.1.80.";
$config['os'][$os]['sysObjectID'][] = ".1.3.6.1.4.1.9.6.1.81.";
$config['os'][$os]['sysObjectID'][] = ".1.3.6.1.4.1.9.6.1.82.";
$config['os'][$os]['sysObjectID'][] = ".1.3.6.1.4.1.9.6.1.83.";
$config['os'][$os]['sysObjectID'][] = ".1.3.6.1.4.1.9.6.1.85.";
$config['os'][$os]['sysObjectID'][] = ".1.3.6.1.4.1.9.6.1.87."; // SF200-48
$config['os'][$os]['sysObjectID'][] = ".1.3.6.1.4.1.9.6.1.88."; // SG200-50
$config['os'][$os]['sysObjectID'][] = ".1.3.6.1.4.1.9.6.1.89.";
$config['os'][$os]['sysObjectID'][] = ".1.3.6.1.4.1.9.6.1.11.82.";
$config['os'][$os]['sysObjectID'][] = ".1.3.6.1.4.1.3955.";
$config['os'][$os]['mibs'][] = "CISCOSB-rndMng";
$os = "test_junos";
$config['os'][$os]['text'] = "Juniper JunOS";
$config['os'][$os]['type'] = "network";
$config['os'][$os]['icon'] = "juniper";
// $config['os'][$os]['snmp']['max-rep'] = 50; // Juniper is full of derp, this massively reduces performance.
$config['os'][$os]['graphs'][0] = "device_bits";
$config['os'][$os]['graphs'][1] = "device_processor";
$config['os'][$os]['graphs'][2] = "device_mempool";
$config['os'][$os]['sysObjectID'][] = ".1.3.6.1.4.1.2636";
$config['os'][$os]['mib_blacklist'][] = "ENTITY-MIB";
$config['os'][$os]['mib_blacklist'][] = "ENTITY-SENSOR-MIB";
$config['os'][$os]['mibs'][] = "JUNIPER-MIB";
$config['os'][$os]['mibs'][] = "JUNIPER-ALARM-MIB";
$config['os'][$os]['mibs'][] = "JUNIPER-DOM-MIB";
$config['os'][$os]['mibs'][] = "JUNIPER-SRX5000-SPU-MONITORING-MIB";
$config['os'][$os]['mibs'][] = "JUNIPER-VLAN-MIB";
$config['os'][$os]['mibs'][] = "JUNIPER-MAC-MIB";
$os = "test_drac";
$config['os'][$os]['text'] = "Dell iDRAC";
$config['os'][$os]['icon'] = "dell";
$config['os'][$os]['sysObjectID'][] = ".1.3.6.1.4.1.674.10892.2";
$config['os'][$os]['sysObjectID'][] = ".1.3.6.1.4.1.674.10892.5";
$config['os'][$os]['mibs'][] = "DELL-RAC-MIB";
$os = "test_dlinkfw";
$config['os'][$os]['text'] = "D-Link Firewall";
$config['os'][$os]['type'] = "firewall";
$config['os'][$os]['vendor'] = "D-Link";
$config['os'][$os]['sysDescr'][] = "/D-Link Firewall /";
$config['os'][$os]['sysObjectID'][] = ".1.3.6.1.4.1.171.20.";
$config['os'][$os]['mibs'][] = "JUST-TEST-MIB";
$config['os'][$os]['model'] = "d-link";
$os = "test_order";
$config['os'][$os]['text'] = "D-Link Firewall";
$config['os'][$os]['type'] = "firewall";
$config['os'][$os]['group'] = "test_exclude";
$config['os'][$os]['vendor'] = "D-Link";
$config['os'][$os]['sysDescr'][] = "/D-Link Firewall /";
$config['os'][$os]['sysObjectID'][] = ".1.3.6.1.4.1.171.20.";
$config['os'][$os]['mibs'][] = "JUST-TEST-MIB";
$config['os'][$os]['model'] = "d-link";
$os = "test_calix";
$config['os'][$os]['text'] = "Calix";
$config['os'][$os]['type'] = "network";
$config['os'][$os]['icon'] = "calix";
$config['os'][$os]['ifname'] = 1;
#$config['os'][$os]['snmp']['max-rep'] = 15; // More - breaks, less or nobulk - very slow polling and discovery
$config['os'][$os]['graphs'][] = "device_bits";
$config['os'][$os]['graphs'][] = "device_processor";
$config['os'][$os]['graphs'][] = "device_mempool";
$config['os'][$os]['sysObjectID'][] = ".1.3.6.1.4.1.6321";
$config['os'][$os]['mibs'][] = "E7-Calix-MIB";
$config['os'][$os]['model'] = "calix"; // Per-HW hardware names
// EOF

11
tests/data/text.txt Normal file
View File

@ -0,0 +1,11 @@
Observium is an autodiscovering network monitoring platform
supporting a wide range of hardware platforms and operating systems
including Cisco, Windows, Linux, HP, Juniper, Dell, FreeBSD, Brocade,
Netscaler, NetApp and many more.
Observium seeks to provide a powerful yet simple and intuitive interface
to the health and status of your network.
~!@#$%^&*()_+`1234567890-=[]\{}|;':",./<>?

View File

@ -0,0 +1,9 @@
hwEntityBomEnDesc.67108873 = Quidway S6324-EI, LS6ZE24CM0, S6324-EI Mainframe (24 GE SFP/10 GE SFP+, Chassis, Dual Slots of power, Without Power Module)
hwEntityBomEnDesc.67158029 = Ethernet Switch,CX7E1FANA,Fan Assembly
hwEntityBomEnDesc.67174413 = AC/DC power module--25degC-55degC-90V-264V-12V/10A,-53.5V/7.1A
hwEntityBomEnDesc.67190797 = AC/DC power module--25degC-55degC-90V-264V-12V/10A,-53.5V/7.1A
hwEntityBomEnDesc.67239949 = Ethernet Switch,CX7E1FANA,Fan Assembly
hwEntityBomEnDesc.67321934 = 10Gbps-256nm-0
hwEntityBomEnDesc.67321998 = 10Gbps-1310nm-0
hwEntityBomEnDesc.67322126 = 10Gbps-1310nm-0
hwEntityBomEnDesc.67323086 = 10Gbps-1310nm-0

6
tests/templates/README Normal file
View File

@ -0,0 +1,6 @@
Most template examples copied from Mustache.php tests (except classes):
https://github.com/bobthecow/mustache.php/tree/master/test/fixtures/examples
if in dir exist file with extension .json than test should pass,
if no exist or exist file extension .json.failed than this syntax not fully implemented now.

View File

@ -0,0 +1,14 @@
<?php
$arr = array('parent' => array(
'child' => 'child works',
),
'grandparent' => array(
'parent' => array(
'child' => 'grandchild works',
),
)
);
echo json_encode($arr);

View File

@ -0,0 +1 @@
{"parent":{"child":"child works"},"grandparent":{"parent":{"child":"grandchild works"}}}

View File

@ -0,0 +1,2 @@
<h1>{{#parent}}{{child}}{{/parent}}</h1>
<h2>{{#grandparent}}{{#parent}}{{child}}{{/parent}}{{/grandparent}}</h2>

View File

@ -0,0 +1,2 @@
<h1>child works</h1>
<h2>grandchild works</h2>

View File

@ -0,0 +1,5 @@
<?php
$arr = array('title' => 'A Comedy of Errors');
echo json_encode($arr);

View File

@ -0,0 +1 @@
{"title":"A Comedy of Errors"}

View File

@ -0,0 +1 @@
<h1>{{title}}{{! just something interesting... #or ^not... }}</h1>

View File

@ -0,0 +1 @@
<h1>A Comedy of Errors</h1>

View File

@ -0,0 +1 @@
{"header":"Colors","item":[{"name":"red","current":true,"url":"#Red"},{"name":"green","current":false,"url":"#Green"},{"name":"blue","current":false,"url":"#Blue"}],"isEmpty":false,"notEmpty":true}

View File

@ -0,0 +1,16 @@
<h1>{{header}}</h1>
{{#notEmpty}}
<ul>
{{#item}}
{{#current}}
<li><strong>{{name}}</strong></li>
{{/current}}
{{^current}}
<li><a href="{{url}}">{{name}}</a></li>
{{/current}}
{{/item}}
</ul>
{{/notEmpty}}
{{#isEmpty}}
<p>The list is empty.</p>
{{/isEmpty}}

View File

@ -0,0 +1,14 @@
<?php
$arr = array('header' => 'Colors',
'item' => array(
array('name' => 'red', 'current' => true, 'url' => '#Red'),
array('name' => 'green', 'current' => false, 'url' => '#Green'),
array('name' => 'blue', 'current' => false, 'url' => '#Blue'),
));
$arr['isEmpty'] = count($arr['item']) === 0;
$arr['notEmpty'] = !$arr['isEmpty'];
echo json_encode($arr);

View File

@ -0,0 +1,6 @@
<h1>Colors</h1>
<ul>
<li><strong>red</strong></li>
<li><a href="#Green">green</a></li>
<li><a href="#Blue">blue</a></li>
</ul>

View File

@ -0,0 +1,12 @@
<?php
$arr = array('start' => "It worked the first time.",
'middle' => array(
array('item' => "And it worked the second time."),
array('item' => "As well as the third."),
),
'final' => "Then, surprisingly, it worked the final time.");
echo json_encode($arr);

View File

@ -0,0 +1 @@
{"start":"It worked the first time.","middle":[{"item":"And it worked the second time."},{"item":"As well as the third."}],"final":"Then, surprisingly, it worked the final time."}

View File

@ -0,0 +1,8 @@
{{=<% %>=}}
* <% start %>
<%=| |=%>
|# middle |
* | item |
|/ middle |
|={{ }}=|
* {{ final }}

View File

@ -0,0 +1,4 @@
* It worked the first time.
* And it worked the second time.
* As well as the third.
* Then, surprisingly, it worked the final time.

View File

@ -0,0 +1,15 @@
<?php
$arr = array(
'person' => array(
'name' => array('first' => 'Chris', 'last' => 'Firescythe'),
'age' => 24,
'hometown' => array(
'city' => 'Cincinnati',
'state' => 'OH',
)
),
'normal' => 'Normal'
);
echo json_encode($arr);

View File

@ -0,0 +1 @@
{"person":{"name":{"first":"Chris","last":"Firescythe"},"age":24,"hometown":{"city":"Cincinnati","state":"OH"}},"normal":"Normal"}

View File

@ -0,0 +1,4 @@
* {{person.name.first}} {{person.name.last}}
* {{person.age}}
* {{person.hometown.city}}, {{person.hometown.state}}
* {{normal}}

View File

@ -0,0 +1,4 @@
* Chris Firescythe
* 24
* Cincinnati, OH
* Normal

View File

@ -0,0 +1,3 @@
<?php
echo json_encode(array('t' => TRUE, 'two' => 'second'));

View File

@ -0,0 +1 @@
{"t":true,"two":"second"}

View File

@ -0,0 +1,7 @@
{{#t}}
* first
{{/t}}
* {{two}}
{{#t}}
* third
{{/t}}

View File

@ -0,0 +1,3 @@
* first
* second
* third

View File

@ -0,0 +1,3 @@
<?php
echo json_encode(array('title' => '"Bear" > "Shark"'));

View File

@ -0,0 +1 @@
{"title":"\"Bear\" > \"Shark\""}

View File

@ -0,0 +1 @@
<h1>{{title}}</h1>

View File

@ -0,0 +1 @@
<h1>&quot;Bear&quot; &gt; &quot;Shark&quot;</h1>

View File

@ -0,0 +1,88 @@
<?php
class Filters
{
public $states = array(
'al' => 'Alabama',
'ak' => 'Alaska',
'az' => 'Arizona',
'ar' => 'Arkansas',
'ca' => 'California',
'co' => 'Colorado',
'ct' => 'Connecticut',
'de' => 'Delaware',
'fl' => 'Florida',
'ga' => 'Georgia',
'hi' => 'Hawaii',
'id' => 'Idaho',
'il' => 'Illinois',
'in' => 'Indiana',
'ia' => 'Iowa',
'ks' => 'Kansas',
'ky' => 'Kentucky',
'la' => 'Louisiana',
'me' => 'Maine',
'md' => 'Maryland',
'ma' => 'Massachusetts',
'mi' => 'Michigan',
'mn' => 'Minnesota',
'ms' => 'Mississippi',
'mo' => 'Missouri',
'mt' => 'Montana',
'ne' => 'Nebraska',
'nv' => 'Nevada',
'nh' => 'New Hampshire',
'nj' => 'New Jersey',
'nm' => 'New Mexico',
'ny' => 'New York',
'nc' => 'North Carolina',
'nd' => 'North Dakota',
'oh' => 'Ohio',
'ok' => 'Oklahoma',
'or' => 'Oregon',
'pa' => 'Pennsylvania',
'ri' => 'Rhode Island',
'sc' => 'South Carolina',
'sd' => 'South Dakota',
'tn' => 'Tennessee',
'tx' => 'Texas',
'ut' => 'Utah',
'vt' => 'Vermont',
'va' => 'Virginia',
'wa' => 'Washington',
'wv' => 'West Virginia',
'wi' => 'Wisconsin',
'wy' => 'Wyoming',
);
// The next few functions are ugly, because they have to work in PHP 5.2...
// for everyone who doesn't have to support 5.2, please, for the love, make
// your ViewModel return closures rather than `array($this, '...')`
//
// :)
public function upcase()
{
return array($this, '_upcase');
}
public function _upcase($val)
{
return strtoupper($val);
}
public function eachPair()
{
return array($this, '_eachPair');
}
public function _eachPair($val)
{
$ret = array();
foreach ($val as $key => $value) {
array_push($ret, compact('key', 'value'));
}
return $ret;
}
}

View File

@ -0,0 +1,4 @@
{{%FILTERS}}
{{# states | eachPair }}
{{ key | upcase }}: {{ value }}
{{/ states }}

View File

@ -0,0 +1,50 @@
AL: Alabama
AK: Alaska
AZ: Arizona
AR: Arkansas
CA: California
CO: Colorado
CT: Connecticut
DE: Delaware
FL: Florida
GA: Georgia
HI: Hawaii
ID: Idaho
IL: Illinois
IN: Indiana
IA: Iowa
KS: Kansas
KY: Kentucky
LA: Louisiana
ME: Maine
MD: Maryland
MA: Massachusetts
MI: Michigan
MN: Minnesota
MS: Mississippi
MO: Missouri
MT: Montana
NE: Nebraska
NV: Nevada
NH: New Hampshire
NJ: New Jersey
NM: New Mexico
NY: New York
NC: North Carolina
ND: North Dakota
OH: Ohio
OK: Oklahoma
OR: Oregon
PA: Pennsylvania
RI: Rhode Island
SC: South Carolina
SD: South Dakota
TN: Tennessee
TX: Texas
UT: Utah
VT: Vermont
VA: Virginia
WA: Washington
WV: West Virginia
WI: Wisconsin
WY: Wyoming

View File

@ -0,0 +1,15 @@
<?php
$arr = array('grand_parent_id' => 'grand_parent1',
'parent_contexts' => array());
$arr['parent_contexts'][] = array('parent_id' => 'parent1', 'child_contexts' => array(
array('child_id' => 'parent1-child1'),
array('child_id' => 'parent1-child2')
));
$arr['parent_contexts'][] = array('parent_id' => 'parent2', 'child_contexts' =>array(
array('child_id' => 'parent2-child1'),
array('child_id' => 'parent2-child2')
));
echo json_encode($arr);

View File

@ -0,0 +1 @@
{"grand_parent_id":"grand_parent1","parent_contexts":[{"parent_id":"parent1","child_contexts":[{"child_id":"parent1-child1"},{"child_id":"parent1-child2"}]},{"parent_id":"parent2","child_contexts":[{"child_id":"parent2-child1"},{"child_id":"parent2-child2"}]}]}

View File

@ -0,0 +1,7 @@
{{grand_parent_id}}
{{#parent_contexts}}
{{parent_id}} ({{grand_parent_id}})
{{#child_contexts}}
{{child_id}} ({{parent_id}} << {{grand_parent_id}})
{{/child_contexts}}
{{/parent_contexts}}

View File

@ -0,0 +1,7 @@
grand_parent1
parent1 (grand_parent1)
parent1-child1 (parent1 << grand_parent1)
parent1-child2 (parent1 << grand_parent1)
parent2 (grand_parent1)
parent2-child1 (parent2 << grand_parent1)
parent2-child2 (parent2 << grand_parent1)

View File

@ -0,0 +1,22 @@
<?php
class I18n
{
// Variable to be interpolated
public $name = 'Bob';
// Add a {{#__}} lambda for i18n
public $__ = array(__CLASS__, '__trans');
// A *very* small i18n dictionary :)
private static $dictionary = array(
'Hello.' => 'Hola.',
'My name is {{ name }}.' => 'Me llamo {{ name }}.',
);
public static function _trans($text)
{
return isset(self::$dictionary[$text]) ? self::$dictionary[$text] : $text;
}
}

View File

@ -0,0 +1 @@
{{#__}}Hello.{{/__}} {{#__}}My name is {{ name }}.{{/__}}

View File

@ -0,0 +1 @@
Hola. Me llamo Bob.

View File

@ -0,0 +1,5 @@
<?php
$arr = array('data' => array('Donkey Kong', 'Luigi', 'Mario', 'Peach', 'Yoshi'));
echo json_encode($arr);

View File

@ -0,0 +1 @@
{"data":["Donkey Kong","Luigi","Mario","Peach","Yoshi"]}

View File

@ -0,0 +1,3 @@
{{#data}}
* {{.}}
{{/data}}

View File

@ -0,0 +1,5 @@
* Donkey Kong
* Luigi
* Mario
* Peach
* Yoshi

View File

@ -0,0 +1,4 @@
<?php
echo json_encode(array('t' => false, 'two' => 'second'));

View File

@ -0,0 +1 @@
{"t":false,"two":"second"}

View File

@ -0,0 +1,7 @@
{{^t}}
* first
{{/t}}
* {{two}}
{{^t}}
* third
{{/t}}

View File

@ -0,0 +1,3 @@
* first
* second
* third

View File

@ -0,0 +1,3 @@
<?php
echo json_encode(array('repo' => array()));

View File

@ -0,0 +1 @@
{"repo":[]}

View File

@ -0,0 +1,6 @@
{{#repo}}
<b>{{name}}</b>
{{/repo}}
{{^repo}}
No repos :(
{{/repo}}

View File

@ -0,0 +1 @@
No repos :(

View File

@ -0,0 +1,6 @@
<?php
class NestedPartials
{
public $val = 'FOURTH!';
}

View File

@ -0,0 +1,3 @@
<first>
{{> second }}
</first>

View File

@ -0,0 +1,7 @@
<first>
<second>
<third>
FOURTH!
</third>
</second>
</first>

View File

@ -0,0 +1 @@
{{ val }}

View File

@ -0,0 +1,3 @@
<second>
{{> third }}
</second>

View File

@ -0,0 +1,3 @@
<third>
{{> fourth }}
</third>

View File

@ -0,0 +1 @@
{"ALERT_STATE":"ALERT","ALERT_MESSAGE":"Flap in bgp","DEVICE_HOSTNAME":"my-router-name","ENTITY_NAME":"ASxxxxx 177.x.x.x","DURATION":"some time","DEVICE_UPTIME":"11 days, 15h 53m 21s","ALERT_URL":"http://observium.mydomain.net/device/device=23/tab=alert/alert_entry=9774/"}

Some files were not shown because too many files have changed in this diff Show More