mirror of
https://gitlab.com/JKANetwork/CheckServer.git
synced 2026-08-15 02:09:18 +02:00
Start again
This commit is contained in:
@@ -0,0 +1,85 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
Copyright (c) 2012 - 2013, Open Source Solutions Limited, Dublin, Ireland
|
||||
Copyright (c) 2013 Jacques Marneweck
|
||||
Copyright (c) 2013 Old Bay Industries
|
||||
All rights reserved.
|
||||
|
||||
Contact: Barry O'Donovan - barry (at) opensolutions (dot) ie
|
||||
http://www.opensolutions.ie/
|
||||
|
||||
This file is part of the OSS_SNMP package.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of Open Source Solutions Limited nor the
|
||||
names of its contributors may be used to endorse or promote products
|
||||
derived from this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
|
||||
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
|
||||
// Works with sysDescr such as:
|
||||
//
|
||||
// 'Alcatel-Lucent OS9600/OS9700-CFM 6.4.3.520.R01 GA, April 08, 2010.'
|
||||
// 'Alcatel-Lucent OS6850-P24 6.4.3.520.R01 GA, April 08, 2010.'
|
||||
|
||||
if( substr( $sysDescr, 0, 14 ) == 'Alcatel-Lucent' )
|
||||
{
|
||||
$this->setVendor( 'Alcatel-Lucent' );
|
||||
$this->setOs( 'AOS' );
|
||||
|
||||
if( substr( $sysDescr, 0, 18 ) == 'Alcatel-Lucent OS9' ) {
|
||||
preg_match( '/Alcatel-Lucent (OS.+CFM) ([0-9A-Za-z\(\)\.]+) GA,\s([a-zA-Z]+)\s(\d+),\s(\d+)\./',
|
||||
$sysDescr, $matches );
|
||||
|
||||
$this->setModel( explode("/", $matches[1])[0] );
|
||||
|
||||
$this->setOsVersion( $matches[2] );
|
||||
$this->setOsDate( new \DateTime( "{$matches[5]}-{$matches[3]}-{$matches[4]}" ) );
|
||||
$this->getOsDate()->setTimezone( new \DateTimeZone( 'UTC' ) );
|
||||
} else if ( substr( $sysDescr, 0, 18 ) == 'Alcatel-Lucent OS6' ) {
|
||||
preg_match( '/Alcatel-Lucent (OS.+) ([0-9A-Za-z\(\)\.]+) GA,\s([a-zA-Z]+)\s(\d+),\s(\d+)\./',
|
||||
$sysDescr, $matches );
|
||||
|
||||
$this->setModel( $matches[1] );
|
||||
|
||||
$this->setOsVersion( $matches[2] );
|
||||
$this->setOsDate( new \DateTime( "{$matches[5]}-{$matches[3]}-{$matches[4]}" ) );
|
||||
$this->getOsDate()->setTimezone( new \DateTimeZone( 'UTC' ) );
|
||||
} else {
|
||||
$model = $this->getSNMPHost()->get( '.1.3.6.1.2.1.47.1.1.1.1.13.1' );
|
||||
|
||||
if ( !empty ( $model ) ) {
|
||||
$this->setModel( $model );
|
||||
|
||||
preg_match( '/Alcatel-Lucent ([0-9A-Za-z\(\)\.]+) GA,\s([a-zA-Z]+)\s(\d+),\s(\d+)\./',
|
||||
$sysDescr, $matches );
|
||||
|
||||
$this->setOsVersion( $matches[1] );
|
||||
$this->setOsDate( new \DateTime( "{$matches[4]}-{$matches[2]}-{$matches[3]}" ) );
|
||||
$this->getOsDate()->setTimezone( new \DateTimeZone( 'UTC' ) );
|
||||
} else {
|
||||
$this->setModel( 'Unknown' );
|
||||
$this->setOsVersion( 'Unknown' );
|
||||
$this->setOsDate( null );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,59 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
Copyright (c) 2012 - 2018, Open Source Solutions Limited, Dublin, Ireland
|
||||
All rights reserved.
|
||||
|
||||
Contact: Barry O'Donovan - barry (at) opensolutions (dot) ie
|
||||
http://www.opensolutions.ie/
|
||||
|
||||
This file is part of the OSS_SNMP package.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of Open Source Solutions Limited nor the
|
||||
names of its contributors may be used to endorse or promote products
|
||||
derived from this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
|
||||
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
|
||||
// Works with sysDescr such as:
|
||||
//
|
||||
// 'Allied Telesis router/switch, AW+ v5.4.7-2.5'
|
||||
// https://github.com/opensolutions/OSS_SNMP/issues/54
|
||||
|
||||
if( substr( $sysDescr, 0, 14 ) == 'Allied Telesis' )
|
||||
{
|
||||
$this->setVendor( 'Allied Telesis' );
|
||||
$this->setOs( 'AW+' );
|
||||
|
||||
preg_match( '/Allied Telesis router\/switch, AW\+ v([0-9\-\.]+)/',
|
||||
$sysDescr, $matches );
|
||||
|
||||
if( $sysObjectId && $sysObjectId == '.1.3.6.1.4.1.207.1.14.118' ) {
|
||||
$this->setModel('AT-28GTX');
|
||||
} else {
|
||||
$this->setModel('Unknown');
|
||||
}
|
||||
|
||||
$this->setOsVersion( isset( $matches[1] ) ? $matches[1] : 'Unknown' );
|
||||
$this->setOsDate( null );
|
||||
|
||||
}
|
||||
@@ -0,0 +1,52 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
Copyright (c) 2012 - 2015, Open Source Solutions Limited, Dublin, Ireland
|
||||
All rights reserved.
|
||||
|
||||
Contact: Barry O'Donovan - barry (at) opensolutions (dot) ie
|
||||
http://www.opensolutions.ie/
|
||||
|
||||
This file is part of the OSS_SNMP package.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of Open Source Solutions Limited nor the
|
||||
names of its contributors may be used to endorse or promote products
|
||||
derived from this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
|
||||
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
// Author: Elisa Jasinska https://github.com/fooelisa
|
||||
|
||||
// Following block works with sysDescr such as:
|
||||
//
|
||||
// "Arista Networks EOS version 4.14.2F running on an Arista Networks DCS-7504"
|
||||
|
||||
if( substr( $sysDescr, 0, 7 ) == 'Arista ' )
|
||||
{
|
||||
preg_match( '/Arista Networks EOS version (.+) running on an Arista Networks (.+)$/',
|
||||
$sysDescr, $matches );
|
||||
|
||||
$this->setVendor( 'Arista' );
|
||||
$this->setModel( isset( $matches[2] ) ? $matches[2] : 'Uknown' );
|
||||
$this->setOs( 'EOS' );
|
||||
$this->setOsVersion( isset( $matches[1] ) ? $matches[1] : 'Unknown' );
|
||||
$this->setOsDate( null );
|
||||
}
|
||||
@@ -0,0 +1,97 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
Copyright (c) 2012 - 2013, Open Source Solutions Limited, Dublin, Ireland
|
||||
All rights reserved.
|
||||
|
||||
Contact: Barry O'Donovan - barry (at) opensolutions (dot) ie
|
||||
http://www.opensolutions.ie/
|
||||
|
||||
This file is part of the OSS_SNMP package.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of Open Source Solutions Limited nor the
|
||||
names of its contributors may be used to endorse or promote products
|
||||
derived from this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
|
||||
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
|
||||
// Works with sysDescr such as:
|
||||
//
|
||||
// 'Brocade Communications Systems, Inc. FESX624+2XG, IronWare Version 07.3.00cT3e1 Compiled on Apr 25 2012 at 17:01:00 labeled as SXS07300c'
|
||||
// 'Brocade Communication Systems, Inc. TurboIron-X24, IronWare Version 04.2.00b Compiled on Oct 22 2010 at 15:15:36 labeled as TIS04200b'
|
||||
// 'Brocade Communications Systems, Inc. Stacking System ICX7450-48, IronWare Version 08.0.30dT213 Compiled on Nov 3 2015 at 22:16:04 labeled as SPR08030d'
|
||||
// 'Brocade NetIron CES, IronWare Version V5.2.0cT183 Compiled on Oct 28 2011 at 02:58:44 labeled as V5.2.00c'
|
||||
// 'Brocade NetIron MLX (System Mode: MLX), IronWare Version V5.4.0cT163 Compiled on Mar 25 2013 at 17:08:16 labeled as V5.4.00c'
|
||||
// 'Brocade MLXe (System Mode: MLX), IronWare Version V5.7.0dT163 Compiled on Sep 23 2015 at 09:35:50 labeled as V5.7.00db'
|
||||
// 'Brocade VDX Switch, BR-VDX6720-24, Network Operating System Software Version 4.1.3b.'
|
||||
|
||||
if( substr( $sysDescr, 0, 8 ) == 'Brocade ' || substr( $sysDescr, 0, 23 ) == 'Foundry Networks, Inc. ' )
|
||||
{
|
||||
if( preg_match( '/Brocade Communication[s]* Systems, Inc. [(Stacking System)]*(.+),\s([a-zA-Z]+)\sVersion\s(.+)\sCompiled\son\s(([a-zA-Z]+)\s+(\d+)\s(\d+)\s)at\s((\d\d):(\d\d):(\d\d))\slabeled\sas\s(.+)/',
|
||||
$sysDescr, $matches ) )
|
||||
{
|
||||
$this->setVendor( 'Brocade' );
|
||||
$this->setModel( $matches[1] );
|
||||
$this->setOs( $matches[2] );
|
||||
$this->setOsVersion( $matches[3] );
|
||||
$this->setOsDate( new \DateTime( "{$matches[6]}/{$matches[5]}/{$matches[7]}:{$matches[8]} +0000" ) );
|
||||
$this->getOsDate()->setTimezone( new \DateTimeZone( 'UTC' ) );
|
||||
}
|
||||
else if( preg_match( '/Brocade ((NetIron )?[a-zA-Z0-9]+).*IronWare\sVersion\s(.+)\s+Compiled\s+on\s+(([a-zA-Z]+)\s+(\d+)\s+(\d+)\s+)at\s+((\d\d):(\d\d):(\d\d))\s+labeled\s+as\s+(.+)/',
|
||||
$sysDescr, $matches ) )
|
||||
{
|
||||
$this->setVendor( 'Brocade' );
|
||||
$this->setModel( $matches[1] );
|
||||
$this->setOs( 'IronWare' );
|
||||
$this->setOsVersion( $matches[3] );
|
||||
$this->setOsDate( new \DateTime( "{$matches[6]}/{$matches[5]}/{$matches[7]}:{$matches[8]} +0000" ) );
|
||||
$this->getOsDate()->setTimezone( new \DateTimeZone( 'UTC' ) );
|
||||
}
|
||||
// Foundry Networks, Inc. FES12GCF, IronWare Version 04.1.01eTc1 Compiled on Mar 06 2011 at 17:05:36 labeled as FES04101e
|
||||
// Foundry Networks, Inc. BigIron RX, IronWare Version V2.7.2aT143 Compiled on Sep 29 2009 at 17:15:24 labeled as V2.7.02a
|
||||
else if( preg_match( '/^Foundry Networks, Inc\. ([A-Za-z0-9\s]+), IronWare Version ([0-9a-zA-Z\.]+) Compiled on (([a-zA-Z]+) (\d+) (\d+) )at ((\d\d):(\d\d):(\d\d)) labeled as ([A-Za-z0-9\.]+)$/',
|
||||
$sysDescr, $matches ) )
|
||||
{
|
||||
$this->setVendor( 'Foundry Networks' );
|
||||
$this->setModel( $matches[1] );
|
||||
$this->setOs( 'IronWare' );
|
||||
$this->setOsVersion( $matches[2] );
|
||||
$d = new \DateTime( "{$matches[5]}/{$matches[4]}/{$matches[6]}:{$matches[7]} +0000" );
|
||||
$d->setTimezone( new \DateTimeZone( 'UTC' ) );
|
||||
$this->setOsDate( $d );
|
||||
}
|
||||
else if( preg_match( '/Brocade VDX Switch,\s(.+), Network Operating System Software Version\s(.+)\./',
|
||||
$sysDescr, $matches ) )
|
||||
{
|
||||
$this->setVendor( 'Brocade' );
|
||||
$this->setModel( $matches[1] );
|
||||
$this->setOs( 'Network Operating System Software' );
|
||||
$this->setOsVersion( $matches[2] );
|
||||
}
|
||||
|
||||
try {
|
||||
$this->setSerialNumber( $this->getSNMPHost()->useFoundry_Chassis()->serialNumber() );
|
||||
} catch( Exception $e ) {
|
||||
$this->setSerialNumber( '(error)' );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,137 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
Copyright (c) 2012 - 2013, Open Source Solutions Limited, Dublin, Ireland
|
||||
All rights reserved.
|
||||
|
||||
Contact: Barry O'Donovan - barry (at) opensolutions (dot) ie
|
||||
http://www.opensolutions.ie/
|
||||
|
||||
This file is part of the OSS_SNMP package.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of Open Source Solutions Limited nor the
|
||||
names of its contributors may be used to endorse or promote products
|
||||
derived from this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
|
||||
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
if( substr( $sysDescr, 0, 26 ) == 'Cisco IOS Software, IOS-XE' )
|
||||
{
|
||||
// 'Cisco IOS Software, IOS-XE Software, Catalyst 4500 L3 Switch Software (cat4500es8-UNIVERSAL-M), Version 03.08.02.E RELEASE SOFTWARE (fc2)'
|
||||
// 'Cisco IOS Software, IOS-XE Software, Catalyst L3 Switch Software (CAT3K_CAA-UNIVERSALK9-M), Version 03.06.06E RELEASE SOFTWARE (fc1)'
|
||||
|
||||
preg_match( '/Cisco IOS Software, IOS-XE Software,\s([a-zA-Z0-9\s]+[a-zA-Z0-9])\s+Software\s\(([0-9A-Za-z\(\)_\.\-]+)\),\sVersion\s([0-9A-Za-z\.]+)\sRELEASE SOFTWARE.*/',
|
||||
$sysDescr, $matches );
|
||||
|
||||
$this->setVendor( 'Cisco Systems' );
|
||||
$this->setModel( $matches[1]);
|
||||
$this->setOs( 'IOS-XE' );
|
||||
$this->setOsVersion( isset( $matches[3] ) ? $matches[3] : '' );
|
||||
$this->setOsDate( null );
|
||||
|
||||
}
|
||||
else if( substr( $sysDescr, 0, 18 ) == 'Cisco IOS Software' )
|
||||
{
|
||||
// 'Cisco IOS Software, s72033_rp Software (s72033_rp-ADVENTERPRISE_WAN-VM), Version 12.2(33)SXI5, RELEASE SOFTWARE (fc2)'
|
||||
// 'Cisco IOS Software [Everest], Catalyst L3 Switch Software (CAT3K_CAA-UNIVERSALK9-M), Version 16.6.2, RELEASE SOFTWARE (fc2)'
|
||||
|
||||
preg_match( '/Cisco IOS Software(?: \[\w+\])?,\s([\w\s]+)\sSoftware \((.+)\), Version\s([0-9A-Za-z\(\)\.]+), RELEASE SOFTWARE\s\((.+)\)/',
|
||||
$sysDescr, $matches );
|
||||
|
||||
$this->setVendor( 'Cisco Systems' );
|
||||
try {
|
||||
if( $this instanceof \OSS_SNMP\TestPlatform ) {
|
||||
$this->setModel('PHPUnit');
|
||||
} else {
|
||||
$model = $this->getSNMPHost()->useEntity()->physicalName();
|
||||
if( isset( $model[1] ) ) {
|
||||
$this->setModel( $model[ 1 ] );
|
||||
} else {
|
||||
$this->setModel( 'Unknown' );
|
||||
}
|
||||
}
|
||||
} catch( \Exception $e ) {
|
||||
$this->setModel( 'Unknown' );
|
||||
}
|
||||
|
||||
$this->setOs( 'IOS' );
|
||||
$this->setOsVersion( isset( $matches[3] ) ? $matches[3] : '' );
|
||||
$this->setOsDate( null );
|
||||
}
|
||||
else if( substr( $sysDescr, 0, 48 ) == 'Cisco Internetwork Operating System Software IOS' )
|
||||
{
|
||||
// 'Cisco Internetwork Operating System Software IOS (tm) C2950 Software (C2950-I6Q4L2-M), Version 12.1(13)EA1, RELEASE SOFTWARE.*'
|
||||
|
||||
$sysDescr = trim( preg_replace( '/\s+/', ' ', $sysDescr ) );
|
||||
preg_match( '/Cisco(.+)C2950 Software(.+)Version\s([0-9A-Za-z\(\)\.]+),\sRELEASE SOFTWARE.*/',
|
||||
$sysDescr, $matches );
|
||||
|
||||
$this->setVendor( 'Cisco Systems' );
|
||||
$this->setModel( 'C2950' );
|
||||
$this->setOs( 'IOS' );
|
||||
$this->setOsVersion( isset( $matches[3] ) ? $matches[3] : '' );
|
||||
$this->setOsDate( null );
|
||||
}
|
||||
else if( substr( $sysDescr, 0, 21 ) == 'Cisco IOS XR Software' )
|
||||
{
|
||||
// 'Cisco IOS XR Software (Cisco ASR9K Series), Version 4.3.2[Default]\r\nCopyright (c) 2013 by Cisco Systems, Inc., referer: http://10.0.35.20/ixp/switch/add-by-snmp'
|
||||
|
||||
preg_match( '/Cisco IOS XR Software \((.+ Series)\),\s+Version\s([0-9A-Za-z\(\)\.\[\]]+)\s+Copyright \(c\) [0-9]+ by Cisco Systems, Inc.*/',
|
||||
$sysDescr, $matches );
|
||||
$this->setVendor( 'Cisco Systems' );
|
||||
$this->setModel( $matches[1] );
|
||||
$this->setOs( 'IOS XR' );
|
||||
$this->setOsVersion( isset( $matches[2] ) ? $matches[2] : '' );
|
||||
$this->setOsDate( null );
|
||||
}
|
||||
else if( substr( $sysDescr, 0, 11 ) == 'Cisco NX-OS' ) {
|
||||
|
||||
// Cisco NX-OS(tm) n9000, Software (n9000-dk9), Version 6.1(2)I2(2b), RELEASE SOFTWARE Copyright (c) 2002-2013 by Cisco Systems, Inc. Compiled 8/7/2014 15:00:00
|
||||
// Cisco NX-OS(tm) n3500, Software (n3500-uk9), Version 6.0(2)A1(1d), RELEASE SOFTWARE Copyright (c) 2002-2012 by Cisco Systems, Inc. Device Manager Version nms.sro not found, Compiled 1/30/2014 9:00:00
|
||||
// Cisco NX-OS(tm) n3500, Software (n3500-uk9), Version 6.0(2)A6(3), RELEASE SOFTWARE Copyright (c) 2002-2012 by Cisco Systems, Inc. Compiled 7/1/2015 10:00:00
|
||||
// Cisco NX-OS(tm) n3500, Software (n3500-uk9), Version 6.0(2)A1(1d), RELEASE SOFTWARE Copyright (c) 2002-2012 by Cisco Systems, Inc. Device Manager Version nms.sro not found, Compiled 1/30/2014 9:00:00
|
||||
|
||||
if( preg_match( '/^Cisco NX\-OS\(tm\) (n[\d+]+), Software \([a-zA-Z0-9\-]+\), Version ([a-zA-Z0-9\.\(\)]+), RELEASE SOFTWARE Copyright \(c\) (?:\d+)-(?:\d+) by Cisco Systems, Inc\.(?: Device Manager Version nms\.sro not found,)?\s+Compiled (\d+)\/(\d+)\/(\d+) (\d+):(\d+):(\d+)$/',
|
||||
$sysDescr, $matches ) )
|
||||
{
|
||||
$this->setVendor( 'Cisco Systems' );
|
||||
$this->setModel( $matches[1] );
|
||||
$this->setOs( 'NX-OS' );
|
||||
$this->setOsVersion( isset( $matches[2] ) ? $matches[2] : '' );
|
||||
$d = new \DateTime( sprintf( "{$matches[5]}/%02d/%02d {$matches[6]}:{$matches[7]}:{$matches[8]} +0000", $matches[3], $matches[4] ) );
|
||||
$d->setTimezone( new \DateTimeZone( 'UTC' ) );
|
||||
$this->setOsDate( $d );
|
||||
}
|
||||
|
||||
// Cisco NX-OS(tm) nxos.7.0.3.I2.3.bin, Software (nxos), Version 7.0(3)I2(3), RELEASE SOFTWARE Copyright (c) 2002-2013 by Cisco Systems, Inc. Compiled 3/19/2016 22:00:00
|
||||
else if( preg_match( '/^Cisco NX\-OS\(tm\) ([a-zA-Z0-9\.]+), Software \([a-zA-Z0-9\-]+\), Version ([a-zA-Z0-9\.\(\)]+), RELEASE SOFTWARE Copyright \(c\) (?:\d+)-(?:\d+) by Cisco Systems, Inc\.(?: Device Manager Version nms\.sro not found,)?\s+Compiled (\d+)\/(\d+)\/(\d+) (\d+):(\d+):(\d+)$/',
|
||||
$sysDescr, $matches ) )
|
||||
{
|
||||
$this->setVendor( 'Cisco Systems' );
|
||||
$this->setModel( 'nXXXX' );
|
||||
$this->setOs( 'NX-OS' );
|
||||
$this->setOsVersion( isset( $matches[2] ) ? $matches[2] : '' );
|
||||
$d = new \DateTime( sprintf( "{$matches[5]}/%02d/%02d {$matches[6]}:{$matches[7]}:{$matches[8]} +0000", $matches[3], $matches[4] ) );
|
||||
$d->setTimezone( new \DateTimeZone( 'UTC' ) );
|
||||
$this->setOsDate( $d );
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
Copyright (c) 2012 - 2017, Open Source Solutions Limited, Dublin, Ireland
|
||||
All rights reserved.
|
||||
|
||||
Contact: Barry O'Donovan - barry (at) opensolutions (dot) ie
|
||||
http://www.opensolutions.ie/
|
||||
|
||||
This file is part of the OSS_SNMP package.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of Open Source Solutions Limited nor the
|
||||
names of its contributors may be used to endorse or promote products
|
||||
derived from this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
|
||||
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
if( substr( $sysDescr, 0, 7 ) == 'Cumulus' )
|
||||
{
|
||||
$this->setVendor( 'Cumulus Networks' );
|
||||
$this->setOs( 'Cumulus Linux' );
|
||||
$this->setOsDate( null );
|
||||
|
||||
// 'Cumulus Linux 3.4.0 (Linux Kernel 4.1.33-1+cl3u9)'
|
||||
preg_match( '/Cumulus Linux\s+([\d\.]+)\s+/', $sysDescr, $matches );
|
||||
$this->setOsVersion( $matches[1] );
|
||||
|
||||
// 'Edgecore x86_64-accton_as5812_54x-r0 5812-54X-O-AC-F Chassis'
|
||||
// 'Mellanox x86_64-mlnx_x86-r0 MSN2100 Chassis'
|
||||
preg_match( '/^(\S+)\s+.*\s+(\S+)\s+Chassis/',
|
||||
$this->getSNMPHost()->get( '.1.3.6.1.2.1.47.1.1.1.1.2.1' ), $matches );
|
||||
|
||||
$this->setModel( $matches[1]." ".$matches[2] );
|
||||
|
||||
$this->setSerialNumber( $this->getSNMPHost()->get( '.1.3.6.1.2.1.47.1.1.1.1.11.1' ) );
|
||||
}
|
||||
@@ -0,0 +1,62 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
Copyright (c) 2012 - 2015, Open Source Solutions Limited, Dublin, Ireland
|
||||
All rights reserved.
|
||||
|
||||
Contact: Barry O'Donovan - barry (at) opensolutions (dot) ie
|
||||
http://www.opensolutions.ie/
|
||||
|
||||
This file is part of the OSS_SNMP package.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of Open Source Solutions Limited nor the
|
||||
names of its contributors may be used to endorse or promote products
|
||||
derived from this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
|
||||
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
|
||||
// Works with sysDescr such as:
|
||||
//
|
||||
// 'Dell Force10 OS Operating System Version: 1.0 Application Software Version: 8.3.12.1 Series: S4810 Copyright (c) 1999-2012 by Dell Inc. All Rights Reserved. Build Time: Sun Nov 18 11:05:15 2012'
|
||||
// 'Dell Force10 OS Operating System Version: 2.0 Application Software Version: 9.3(0.0) Series: S4810 Copyright (c) 1999-2014 by Dell Inc. All Rights Reserved. Build Time: Thu Jan 2 02:14:08 2014'
|
||||
// 'Dell Networking OS Operating System Version: 2.0 Application Software Version: 9.10(0.1P3) Series: S4810 Copyright (c) 1999-2016 by Dell Inc. All Rights Reserved. Build Time: Tue Jun 14 15:00:23 2016'
|
||||
|
||||
if( substr( $sysDescr, 0, 5 ) == 'Dell ' )
|
||||
{
|
||||
$sysDescr = preg_replace('/\R/',' ', $sysDescr );
|
||||
if( preg_match( '/^Dell (Force10|Networking) OS Operating System Version: ([\d\.]+) Application Software Version:\s([A-Z0-9\(\)\.]+)\sSeries:\s([A-Z0-9]+)\sCopyright \(c\) \d+-\d+ by Dell Inc. All Rights Reserved. Build Time:\s[A-Za-z0-9]+\s(([a-zA-Z]+)\s+(\d+)\s((\d\d):(\d\d):(\d\d))\s(\d+))$/',
|
||||
$sysDescr, $matches ) )
|
||||
{
|
||||
$this->setVendor( "Dell {$matches[1]}" );
|
||||
$this->setModel( $matches[4] );
|
||||
$this->setOs( "FTOS {$matches[2]}" );
|
||||
$this->setOsVersion( $matches[3] );
|
||||
$this->setOsDate( new \DateTime( "{$matches[7]}/{$matches[6]}/{$matches[12]}:{$matches[8]} +0000" ) );
|
||||
$this->getOsDate()->setTimezone( new \DateTimeZone( 'UTC' ) );
|
||||
}
|
||||
|
||||
try {
|
||||
$this->setSerialNumber( $this->getSNMPHost()->get( '.1.3.6.1.2.1.47.1.1.1.1.11.2' ) );
|
||||
} catch( Exception $e ) {
|
||||
$this->setSerialNumber( '(error)' );
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,88 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
Copyright (c) 2012 - 2013, Open Source Solutions Limited, Dublin, Ireland
|
||||
All rights reserved.
|
||||
|
||||
Contact: Barry O'Donovan - barry (at) opensolutions (dot) ie
|
||||
http://www.opensolutions.ie/
|
||||
|
||||
This file is part of the OSS_SNMP package.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of Open Source Solutions Limited nor the
|
||||
names of its contributors may be used to endorse or promote products
|
||||
derived from this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
|
||||
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
|
||||
// Works with sysDescr such as:
|
||||
//
|
||||
// 'ExtremeXOS (X460-48t) version 15.2.2.7 v1522b7-patch1-1 by release-manager on Tue Nov 20 17:14:11 EST 2012'
|
||||
// 'ExtremeXOS (X460-48x) version 15.2.2.7 v1522b7-patch1-6 by release-manager on Thu Jan 31 11:11:52 EST 2013'
|
||||
// 'ExtremeXOS (X670V-48x) version 15.2.2.7 v1522b7-patch1-6 by release-manager on Thu Jan 31 11:11:52 EST 2013'
|
||||
// 'ExtremeXOS version 12.5.3.9 v1253b9 by release-manager on Tue Apr 26 20:36:04 PDT 2011'
|
||||
|
||||
if( substr( $sysDescr, 0, 11 ) == 'ExtremeXOS ' )
|
||||
{
|
||||
$this->setVendor( 'Extreme Networks' );
|
||||
$this->setOs( 'ExtremeXOS' );
|
||||
|
||||
if( substr( $sysDescr, 0, 18 ) == 'ExtremeXOS version' )
|
||||
{
|
||||
preg_match( '/ExtremeXOS\sversion\s([a-zA-Z0-9\.\-]+\s[a-zA-Z0-9\.\-]+)\sby\srelease-manager\son\s([a-zA-Z]+)\s([a-zA-Z]+)\s(\d+)\s((\d\d):(\d\d):(\d\d))\s([a-zA-Z]+)\s(\d\d\d\d)/',
|
||||
$sysDescr, $matches );
|
||||
|
||||
$this->setOsVersion( $matches[1] );
|
||||
$this->setOsDate( new \DateTime( "{$matches[4]}/{$matches[3]}/{$matches[10]}:{$matches[5]} +0000" ) );
|
||||
$this->getOsDate()->setTimezone( new \DateTimeZone( $matches[9] ) );
|
||||
|
||||
// the model is not included in the system description here so we need to pull it out of the entity MIB
|
||||
// this may need to be checked on a model by model basis.
|
||||
// Works for:
|
||||
$this->setModel( $this->getSNMPHost()->get( '.1.3.6.1.2.1.47.1.1.1.1.2.1' ) );
|
||||
}
|
||||
else if( substr( $sysDescr, 0, 12 ) == 'ExtremeXOS (' )
|
||||
{
|
||||
preg_match( '/ExtremeXOS\s\((.+)\)\sversion\s([a-zA-Z0-9\.\-]+\s[a-zA-Z0-9\.\-]+)\sby\srelease-manager\son\s([a-zA-Z]+)\s([a-zA-Z]+)\s(\d+)\s((\d\d):(\d\d):(\d\d))\s([a-zA-Z]+)\s(\d\d\d\d)/',
|
||||
$sysDescr, $matches );
|
||||
|
||||
$this->setModel( $matches[1] );
|
||||
$this->setOsVersion( $matches[2] );
|
||||
$this->setOsDate( new \DateTime( "{$matches[5]}/{$matches[4]}/{$matches[11]}:{$matches[6]} +0000" ) );
|
||||
$this->getOsDate()->setTimezone( new \DateTimeZone( $matches[10] ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->setModel( 'Unknown' );
|
||||
$this->setOsVersion( 'Unknown' );
|
||||
$this->setOsDate( null );
|
||||
}
|
||||
|
||||
try {
|
||||
$this->setSerialNumber( $this->getSNMPHost()->useExtreme_Chassis()->systemID() );
|
||||
} catch( Exception $e ) {
|
||||
$this->setSerialNumber( '(error)' );
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,46 @@
|
||||
<?php
|
||||
|
||||
if( substr( $sysDescr, 0, 20 ) == 'H3C Comware software' )
|
||||
{
|
||||
|
||||
//H3C Comware software. H3C S9512E Product Version S9500E-CMW520-R1238P08. Copyright (c) 2004-2010 Hangzhou H3C Tech. Co., Ltd. All rights reserved.
|
||||
//H3C Switch E528 Software Version 5.20, Release 1103P01 Copyright(c) 2004-2010 Hangzhou H3C Tech. Co., Ltd. All rights reserved.
|
||||
//H3C Comware Platform Software, Software Version 5.20 Release 2202P06 H3C S5120-28C-EI Copyright (c) 2004-2010 Hangzhou H3C Tech. Co., Ltd. All rights reserved.
|
||||
|
||||
preg_match( '/H3C Comware software. (.+) Product Version\s(.+)\. Copyright/',
|
||||
$sysDescr, $matches );
|
||||
|
||||
$this->setVendor( 'H3C' );
|
||||
try {
|
||||
$this->setModel( $this->getSNMPHost()->useEntity()->physicalName()[1] );
|
||||
} catch( \OSS_SNMP\Exception $e ) {
|
||||
$this->setModel( 'Unknown' );
|
||||
}
|
||||
$this->setOs( 'Comware' );
|
||||
$this->setOsVersion( $matches[2] );
|
||||
$this->setOsDate( null );
|
||||
}
|
||||
else if( substr( $sysDescr, 0, 10 ) == 'H3C Switch' )
|
||||
{
|
||||
$sysDescr = trim( preg_replace( '/\s+/', ' ', $sysDescr ) );
|
||||
preg_match( '/H3C Switch (.+) Software Version (.+)Copyright/',
|
||||
$sysDescr, $matches );
|
||||
|
||||
$this->setVendor( 'H3C' );
|
||||
$this->setModel( $matches[1] );
|
||||
$this->setOs( null );
|
||||
$this->setOsVersion( $matches[2] );
|
||||
$this->setOsDate( null );
|
||||
}
|
||||
else if( substr( $sysDescr, 0, 29 ) == 'H3C Comware Platform Software' )
|
||||
{
|
||||
$sysDescr = trim( preg_replace( '/\s+/', ' ', $sysDescr ) );
|
||||
preg_match( '/H3C Comware Platform Software, Software Version (.+) H3C (.+)Copyright/',
|
||||
$sysDescr, $matches );
|
||||
|
||||
$this->setVendor( 'H3C' );
|
||||
$this->setModel( $matches[2] );
|
||||
$this->setOs( 'Comware' );
|
||||
$this->setOsVersion( $matches[1] );
|
||||
$this->setOsDate( null );
|
||||
}
|
||||
@@ -0,0 +1,59 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
Copyright (c) 2012 - 2014, Open Source Solutions Limited, Dublin, Ireland
|
||||
All rights reserved.
|
||||
|
||||
Contact: Barry O'Donovan - barry (at) opensolutions (dot) ie
|
||||
http://www.opensolutions.ie/
|
||||
|
||||
This file is part of the OSS_SNMP package.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of Open Source Solutions Limited nor the
|
||||
names of its contributors may be used to endorse or promote products
|
||||
derived from this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
|
||||
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
|
||||
// Works with sysDescr such as:
|
||||
//
|
||||
// 'ProCurve J4903A Switch 2824, revision I.08.98, ROM I.08.07 (/sw/code/build/mako(ts_08_5))'
|
||||
|
||||
if( substr( $sysDescr, 0, 9 ) == 'ProCurve ' )
|
||||
{
|
||||
if( preg_match( '/ProCurve (\w+) Switch (\w+).*, revision ([A-Z0-9\.]+), ROM ([A-Z0-9\.]+ .*)/',
|
||||
$sysDescr, $matches ) )
|
||||
{
|
||||
$this->setVendor( 'Hewlett-Packard' );
|
||||
$this->setModel( "Procurve Switch {$matches[2]} ({$matches[1]})" );
|
||||
$this->setOs( 'ProCurve' );
|
||||
$this->setOsVersion( $matches[3] );
|
||||
$this->setOsDate( null );
|
||||
//$this->getOsDate()->setTimezone( new \DateTimeZone( 'UTC' ) );
|
||||
}
|
||||
|
||||
try {
|
||||
$this->setSerialNumber( $this->getSNMPHost()->useHP_ProCurve_Chassis()->serialNumber() );
|
||||
} catch( Exception $e ) {
|
||||
$this->setSerialNumber( '(error)' );
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
<?php
|
||||
|
||||
// Works with sysDescr such as:
|
||||
//
|
||||
// 'Huawei Integrated Access Software'
|
||||
// 'HUAWEI TECH. INC. SNMP AGENT FOR MA5300'
|
||||
|
||||
if( substr( strtolower($sysDescr), 0, 6 ) == 'huawei' )
|
||||
{
|
||||
$this->setVendor( 'Huawei' );
|
||||
|
||||
switch( $sysObjectId )
|
||||
{
|
||||
case '.1.3.6.1.4.1.2011.2.123':
|
||||
$this->setModel( "MA5603T" );
|
||||
break;
|
||||
case '.1.3.6.1.4.1.2011.2.169':
|
||||
$this->setModel( "MA5616" );
|
||||
break;
|
||||
case '.1.3.6.1.4.1.2011.2.80.8':
|
||||
$this->setModel( "MA5600T" );
|
||||
break;
|
||||
case '.1.3.6.1.4.1.2011.2.6.6.1':
|
||||
$this->setModel( "MA5300V1" );
|
||||
break;
|
||||
default:
|
||||
$this->setModel( null );
|
||||
}
|
||||
|
||||
$this->setOs( null );
|
||||
if( $this instanceof \OSS_SNMP\TestPlatform ) {
|
||||
$this->setOsVersion('PHPUnit');
|
||||
} else {
|
||||
$this->setOsVersion($this->getSNMPHost()->useHuawei_System()->softwareVersion());
|
||||
}
|
||||
$this->setOsDate( null );
|
||||
|
||||
}
|
||||
|
||||
// 'S6720-30C-EI-24S-AC Huawei Versatile Routing Platform Software VRP (R) software,Version 5.160 (S6720 V200R009C00SPC500) Copyright (C) 2007 Huawei Technologies Co., Ltd.'
|
||||
// https://github.com/opensolutions/OSS_SNMP/issues/41
|
||||
else if( preg_match( '/^S\d+\-[A-Z0-9\-]+ Huawei Versatile Routing Platform Software VRP \(R\) software,Version ([0-9\.]+) \((S[0-9]+) [A-Z0-9]+\) Copyright \(C\) 2007 Huawei Technologies.*$/',
|
||||
$sysDescr, $matches ) ) {
|
||||
|
||||
$this->setVendor( 'Huawei' );
|
||||
$this->setModel( $matches[2] );
|
||||
$this->setOs( 'Huawei Versatile Routing Platform Software VRP' );
|
||||
$this->setOsVersion( $matches[1] );
|
||||
$this->setOsDate( null );
|
||||
}
|
||||
|
||||
@@ -0,0 +1,49 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
This file is part of the OSS_SNMP package.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of Open Source Solutions Limited nor the
|
||||
names of its contributors may be used to endorse or promote products
|
||||
derived from this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
|
||||
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
// Verified against SRX- and EX- series devices
|
||||
//
|
||||
// Sample sysDescr:
|
||||
// "Juniper Networks, Inc. ex4500-40f Ethernet Switch, kernel JUNOS 12.3R3.4, Build date: 2013-06-14 01:37:19 UTC Copyright (c) 1996-2013 Juniper Networks, Inc."
|
||||
|
||||
if( substr( $sysDescr, 0, 22 ) == 'Juniper Networks, Inc.' )
|
||||
{
|
||||
preg_match( '/(Juniper Networks), Inc. ([^\s]+) .* kernel ([^\s]+) ([^\s,]+)/', $sysDescr, $matches );
|
||||
$this->setVendor( $matches[1] );
|
||||
$this->setModel( $matches[2] );
|
||||
$this->setOs( $matches[3] );
|
||||
$this->setOsVersion( $matches[4] );
|
||||
|
||||
if( preg_match( '/Build date: (\d\d\d\d-\d\d-\d\d) (\d\d:\d\d:\d\d) ([A-Za-z]+)/', $sysDescr, $d ) )
|
||||
{
|
||||
$this->setOsDate( new \DateTime( "{$d[1]} {$d[2]} +00:00") );
|
||||
$this->getOsDate()->setTimezone( new \DateTimeZone( $d[3] ) );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,66 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
Copyright (c) 2012 - 2013, Open Source Solutions Limited, Dublin, Ireland
|
||||
All rights reserved.
|
||||
|
||||
Contact: Barry O'Donovan - barry (at) opensolutions (dot) ie
|
||||
http://www.opensolutions.ie/
|
||||
|
||||
This file is part of the OSS_SNMP package.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of Open Source Solutions Limited nor the
|
||||
names of its contributors may be used to endorse or promote products
|
||||
derived from this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
|
||||
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
// Works with sysDescr such as:
|
||||
|
||||
// Cumulus
|
||||
// Linux switch.ixleeds.net 3.2.46-1+deb7u1+cl1 #3.2.46-1+deb7u1+cl1 SMP Fri Feb 7 13:15:34 PST 2014 ppc
|
||||
|
||||
// Ubuntu
|
||||
// Linux ixleeds1 3.11.0-23-generic #40-Ubuntu SMP Wed Jun 4 21:05:23 UTC 2014 x86_64
|
||||
|
||||
if( substr( $sysDescr, 0, 6 ) == 'Linux ' )
|
||||
{
|
||||
if( preg_match( '/Linux ([^ ]+) ([^ ]+)\+([^ ]+) #([^ ]+) SMP ([^ ]+) ([^ ]+) ([^ ]+) ([^ ]+) ([^ ]+) ([^ ]+) ([^ ]+)/',
|
||||
$sysDescr, $matches ) )
|
||||
{
|
||||
$this->setVendor( 'Cumulus Networks' );
|
||||
$this->setModel( 'Generic' );
|
||||
$this->setOs( 'Linux' );
|
||||
$this->setOsVersion( $matches[2] );
|
||||
$this->setOsDate( new \DateTime( "{$matches[7]}/{$matches[6]}/{$matches[10]}:{$matches[8]} +0000" ) );
|
||||
$this->getOsDate()->setTimezone( new \DateTimeZone( $matches[9] ));
|
||||
}
|
||||
else if( preg_match( '/Linux ([^ ]+) ([^ ]+)-([^ ]+) #[^ ]+-([^ ]+) SMP ([^ ]+) ([^ ]+) ([^ ]+) ([^ ]+) ([^ ]+) ([^ ]+) (.*)/',
|
||||
$sysDescr, $matches ) )
|
||||
{
|
||||
$this->setVendor( $matches[4] );
|
||||
$this->setModel( 'Generic' );
|
||||
$this->setOs( 'Linux' );
|
||||
$this->setOsVersion( $matches[2] );
|
||||
$this->setOsDate( new \DateTime( "{$matches[7]}/{$matches[6]}/{$matches[10]}:{$matches[8]} +0000" ) );
|
||||
$this->getOsDate()->setTimezone( new \DateTimeZone( $matches[9] ));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
Copyright (c) 2012 - 2013, Open Source Solutions Limited, Dublin, Ireland
|
||||
All rights reserved.
|
||||
|
||||
Contact: Barry O'Donovan - barry (at) opensolutions (dot) ie
|
||||
http://www.opensolutions.ie/
|
||||
|
||||
This file is part of the OSS_SNMP package.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of Open Source Solutions Limited nor the
|
||||
names of its contributors may be used to endorse or promote products
|
||||
derived from this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
|
||||
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
// Following block works with sysDescr such as:
|
||||
//
|
||||
// 'LX Console Manager, s/w version=5.3.2'
|
||||
|
||||
if( substr( $sysDescr, 0, 18 ) == 'LX Console Manager' )
|
||||
{
|
||||
preg_match( '/LX Console Manager,\ss\/w\sversion=([0-9a-zA-Z\.]+)$/',
|
||||
$sysDescr, $matches );
|
||||
|
||||
$this->setVendor( 'MRV' );
|
||||
$this->setModel( $this->getSNMPHost()->useMRV_System()->model() );
|
||||
$this->setOs( $this->getSNMPHost()->useMRV_System()->osImage() );
|
||||
$this->setOsVersion( $matches[1] );
|
||||
$this->setOsDate( null );
|
||||
}
|
||||
|
||||
@@ -0,0 +1,55 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
Copyright (c) 2012 - 2013, Open Source Solutions Limited, Dublin, Ireland
|
||||
All rights reserved.
|
||||
|
||||
Contact: Barry O'Donovan - barry (at) opensolutions (dot) ie
|
||||
http://www.opensolutions.ie/
|
||||
|
||||
This file is part of the OSS_SNMP package.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of Open Source Solutions Limited nor the
|
||||
names of its contributors may be used to endorse or promote products
|
||||
derived from this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
|
||||
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
// Following block works with sysDescr such as:
|
||||
//
|
||||
// 'FS728TP'
|
||||
|
||||
// THIS IS JUST FOR TESTING AGAINST A SHITE SWITCH IN THE OFFICE
|
||||
//
|
||||
// DO NOT USE THIS AS A TEMPLATE!!!
|
||||
|
||||
if( $sysDescr == 'FS728TP' )
|
||||
{
|
||||
preg_match( '/LX Console Manager,\ss\/w\sversion=([0-9a-zA-Z\.]+)$/',
|
||||
$sysDescr, $matches );
|
||||
|
||||
$this->setVendor( 'Netgear' );
|
||||
$this->setModel( $sysDescr );
|
||||
$this->setOs( 'Netgear' );
|
||||
$this->setOsVersion( $this->getSNMPHost()->get( '.1.3.6.1.4.1.4526.17.2.4.0' ) );
|
||||
$this->setOsDate( null );
|
||||
}
|
||||
|
||||
@@ -0,0 +1,51 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
Copyright (c) 2012 - 2015, Open Source Solutions Limited, Dublin, Ireland
|
||||
All rights reserved.
|
||||
|
||||
Contact: Barry O'Donovan - barry (at) opensolutions (dot) ie
|
||||
http://www.opensolutions.ie/
|
||||
|
||||
This file is part of the OSS_SNMP package.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of Open Source Solutions Limited nor the
|
||||
names of its contributors may be used to endorse or promote products
|
||||
derived from this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
|
||||
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
// From: https://github.com/inex/IXP-Manager/issues/210 - very limited information
|
||||
|
||||
if( strtolower( substr( $sysDescr, 0, 18 ) ) == 'fastpath switching' )
|
||||
{
|
||||
$this->setVendor( 'Quanta' );
|
||||
$this->setModel( "Quanta" );
|
||||
$this->setOs( 'VxWorks' );
|
||||
$this->setOsVersion( null );
|
||||
$this->setOsDate( null );
|
||||
|
||||
try {
|
||||
$this->setSerialNumber( $this->getSNMPHost()->get( '.1.3.6.1.2.1.47.1.1.1.1.11.1' ) );
|
||||
} catch( Exception $e ) {
|
||||
$this->setSerialNumber( '(error)' );
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user