mirror of
				https://github.com/librenms/librenms.git
				synced 2024-10-07 16:52:45 +00:00 
			
		
		
		
	newdevice: added more support for dasan-nos (#5298)
This commit is contained in:
		
				
					committed by
					
						
						Tony Murray
					
				
			
			
				
	
			
			
			
						parent
						
							81024f0d4e
						
					
				
				
					commit
					1b7d3e0ab8
				
			@@ -6,6 +6,8 @@ mib_dir:
 | 
				
			|||||||
    - dasan
 | 
					    - dasan
 | 
				
			||||||
over:
 | 
					over:
 | 
				
			||||||
    - { graph: device_bits, text: 'Device Traffic' }
 | 
					    - { graph: device_bits, text: 'Device Traffic' }
 | 
				
			||||||
 | 
					    - { graph: device_processor, text: 'CPU Usage' }
 | 
				
			||||||
 | 
					    - { graph: device_mempool, text: 'Memory Usage' }
 | 
				
			||||||
discovery:
 | 
					discovery:
 | 
				
			||||||
    - sysObjectId:
 | 
					    - sysObjectId:
 | 
				
			||||||
        - .1.3.6.1.4.1.6296.1.2.5
 | 
					        - .1.3.6.1.4.1.6296.1.2.5
 | 
				
			||||||
							
								
								
									
										35
									
								
								includes/discovery/mempools/dasan-nos.inc.php
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										35
									
								
								includes/discovery/mempools/dasan-nos.inc.php
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,35 @@
 | 
				
			|||||||
 | 
					<?php
 | 
				
			||||||
 | 
					/**
 | 
				
			||||||
 | 
					 * dasan-nos.inc.php
 | 
				
			||||||
 | 
					 *
 | 
				
			||||||
 | 
					 * LibreNMS mempool discovery module for Dasan NOS
 | 
				
			||||||
 | 
					 *
 | 
				
			||||||
 | 
					 * This program is free software: you can redistribute it and/or modify
 | 
				
			||||||
 | 
					 * it under the terms of the GNU General Public License as published by
 | 
				
			||||||
 | 
					 * the Free Software Foundation, either version 3 of the License, or
 | 
				
			||||||
 | 
					 * (at your option) any later version.
 | 
				
			||||||
 | 
					 *
 | 
				
			||||||
 | 
					 * This program is distributed in the hope that it will be useful,
 | 
				
			||||||
 | 
					 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 | 
				
			||||||
 | 
					 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.See the
 | 
				
			||||||
 | 
					 * GNU General Public License for more details.
 | 
				
			||||||
 | 
					 *
 | 
				
			||||||
 | 
					 * You should have received a copy of the GNU General Public License
 | 
				
			||||||
 | 
					 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 | 
				
			||||||
 | 
					 *
 | 
				
			||||||
 | 
					 * @package    LibreNMS
 | 
				
			||||||
 | 
					 * @link       http://librenms.org
 | 
				
			||||||
 | 
					 * @copyright  2016 Neil Lathwood
 | 
				
			||||||
 | 
					 * @author     Neil Lathwood <neil@lathwood.co.uk>
 | 
				
			||||||
 | 
					 */
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					if ($device['os'] === 'dasan-nos') {
 | 
				
			||||||
 | 
					    echo 'Dasan NOS: ';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    $total = snmp_get($device, 'dsTotalMem.0', '-OvQU', 'DASAN-SWITCH-MIB', 'dasan');
 | 
				
			||||||
 | 
					    $used  = snmp_get($device, 'dsUsedMem.0', '-OvQU', 'DASAN-SWITCH-MIB', 'dasan');
 | 
				
			||||||
 | 
					    $free  = snmp_get($device, 'dsFreeMem.0', '-OvQU', 'DASAN-SWITCH-MIB', 'dasan');
 | 
				
			||||||
 | 
					    if (is_numeric($total) && is_numeric($used) && is_numeric($free)) {
 | 
				
			||||||
 | 
					        discover_mempool($valid_mempool, $device, 0, 'dasan-nos', 'Memory Utilization', '1', null, null);
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
							
								
								
									
										33
									
								
								includes/discovery/processors/dasan-nos.inc.php
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										33
									
								
								includes/discovery/processors/dasan-nos.inc.php
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,33 @@
 | 
				
			|||||||
 | 
					<?php
 | 
				
			||||||
 | 
					/**
 | 
				
			||||||
 | 
					 * dasan-nos.inc.php
 | 
				
			||||||
 | 
					 *
 | 
				
			||||||
 | 
					 * LibreNMS processor discovery module for Dasan NOS
 | 
				
			||||||
 | 
					 *
 | 
				
			||||||
 | 
					 * This program is free software: you can redistribute it and/or modify
 | 
				
			||||||
 | 
					 * it under the terms of the GNU General Public License as published by
 | 
				
			||||||
 | 
					 * the Free Software Foundation, either version 3 of the License, or
 | 
				
			||||||
 | 
					 * (at your option) any later version.
 | 
				
			||||||
 | 
					 *
 | 
				
			||||||
 | 
					 * This program is distributed in the hope that it will be useful,
 | 
				
			||||||
 | 
					 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 | 
				
			||||||
 | 
					 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.See the
 | 
				
			||||||
 | 
					 * GNU General Public License for more details.
 | 
				
			||||||
 | 
					 *
 | 
				
			||||||
 | 
					 * You should have received a copy of the GNU General Public License
 | 
				
			||||||
 | 
					 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 | 
				
			||||||
 | 
					 *
 | 
				
			||||||
 | 
					 * @package    LibreNMS
 | 
				
			||||||
 | 
					 * @link       http://librenms.org
 | 
				
			||||||
 | 
					 * @copyright  2016 Neil Lathwood
 | 
				
			||||||
 | 
					 * @author     Neil Lathwood <neil@lathwood.co.uk>
 | 
				
			||||||
 | 
					 */
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					if ($device['os'] === 'dasan-nos') {
 | 
				
			||||||
 | 
					    echo 'Dasan NOS : ';
 | 
				
			||||||
 | 
					    $descr = 'Processor';
 | 
				
			||||||
 | 
					    $usage = snmp_get($device, 'dsCpuLoad5s.0', '-Ovq', 'DASAN-SWITCH-MIB', 'dasan');
 | 
				
			||||||
 | 
					    if (is_numeric($usage)) {
 | 
				
			||||||
 | 
					        discover_processor($valid['processor'], $device, 'dsCpuLoad5s.0', '0', 'dasan-nos', $descr, '1', $usage);
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
							
								
								
									
										28
									
								
								includes/polling/mempools/dasan-nos.inc.php
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										28
									
								
								includes/polling/mempools/dasan-nos.inc.php
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,28 @@
 | 
				
			|||||||
 | 
					<?php
 | 
				
			||||||
 | 
					/**
 | 
				
			||||||
 | 
					 * dasan-nos.inc.php
 | 
				
			||||||
 | 
					 *
 | 
				
			||||||
 | 
					 * LibreNMS mempool poller module for Dasan NOS
 | 
				
			||||||
 | 
					 *
 | 
				
			||||||
 | 
					 * This program is free software: you can redistribute it and/or modify
 | 
				
			||||||
 | 
					 * it under the terms of the GNU General Public License as published by
 | 
				
			||||||
 | 
					 * the Free Software Foundation, either version 3 of the License, or
 | 
				
			||||||
 | 
					 * (at your option) any later version.
 | 
				
			||||||
 | 
					 *
 | 
				
			||||||
 | 
					 * This program is distributed in the hope that it will be useful,
 | 
				
			||||||
 | 
					 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 | 
				
			||||||
 | 
					 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.See the
 | 
				
			||||||
 | 
					 * GNU General Public License for more details.
 | 
				
			||||||
 | 
					 *
 | 
				
			||||||
 | 
					 * You should have received a copy of the GNU General Public License
 | 
				
			||||||
 | 
					 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 | 
				
			||||||
 | 
					 *
 | 
				
			||||||
 | 
					 * @package    LibreNMS
 | 
				
			||||||
 | 
					 * @link       http://librenms.org
 | 
				
			||||||
 | 
					 * @copyright  2016 Neil Lathwood
 | 
				
			||||||
 | 
					 * @author     Neil Lathwood <neil@lathwood.co.uk>
 | 
				
			||||||
 | 
					 */
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					$mempool['total'] = snmp_get($device, 'dsTotalMem.0', '-OvQU', 'DASAN-SWITCH-MIB');
 | 
				
			||||||
 | 
					$mempool['used']  = snmp_get($device, 'dsUsedMem.0', '-OvQU', 'DASAN-SWITCH-MIB');
 | 
				
			||||||
 | 
					$mempool['free']  = snmp_get($device, 'dsFreeMem.0', '-OvQU', 'DASAN-SWITCH-MIB');
 | 
				
			||||||
@@ -25,4 +25,7 @@
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
list($hardware, $version) = explode(' ', $poll_device['sysDescr'], 2);
 | 
					list($hardware, $version) = explode(' ', $poll_device['sysDescr'], 2);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
$version = preg_replace('/\/(.*)/', '', $version);
 | 
					$tmp = snmp_get_multi_oid($device, 'dsSerialNumber.0 dsFirmwareVersion', '-OQUs', 'DASAN-SWITCH-MIB:DASAN-PRODUCTS-MIB');
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					$serial = $tmp['dsSerialNumber.0'];
 | 
				
			||||||
 | 
					$version = $tmp['dsFirmwareVersion.0'];
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										26
									
								
								includes/polling/processors/dasan-nos.inc.php
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										26
									
								
								includes/polling/processors/dasan-nos.inc.php
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,26 @@
 | 
				
			|||||||
 | 
					<?php
 | 
				
			||||||
 | 
					/**
 | 
				
			||||||
 | 
					 * dasan-nos.inc.php
 | 
				
			||||||
 | 
					 *
 | 
				
			||||||
 | 
					 * LibreNMS processor poller module for Dasan NOS
 | 
				
			||||||
 | 
					 *
 | 
				
			||||||
 | 
					 * This program is free software: you can redistribute it and/or modify
 | 
				
			||||||
 | 
					 * it under the terms of the GNU General Public License as published by
 | 
				
			||||||
 | 
					 * the Free Software Foundation, either version 3 of the License, or
 | 
				
			||||||
 | 
					 * (at your option) any later version.
 | 
				
			||||||
 | 
					 *
 | 
				
			||||||
 | 
					 * This program is distributed in the hope that it will be useful,
 | 
				
			||||||
 | 
					 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 | 
				
			||||||
 | 
					 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.See the
 | 
				
			||||||
 | 
					 * GNU General Public License for more details.
 | 
				
			||||||
 | 
					 *
 | 
				
			||||||
 | 
					 * You should have received a copy of the GNU General Public License
 | 
				
			||||||
 | 
					 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 | 
				
			||||||
 | 
					 *
 | 
				
			||||||
 | 
					 * @package    LibreNMS
 | 
				
			||||||
 | 
					 * @link       http://librenms.org
 | 
				
			||||||
 | 
					 * @copyright  2016 Neil Lathwood
 | 
				
			||||||
 | 
					 * @author     Neil Lathwood <neil@lathwood.co.uk>
 | 
				
			||||||
 | 
					 */
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					$proc = snmp_get($device, 'dsCpuLoad5s.0', '-Ovq', 'DASAN-SWITCH-MIB');
 | 
				
			||||||
@@ -485,7 +485,7 @@ v5924MD         OBJECT IDENTIFIER ::= { v5900 23 }
 | 
				
			|||||||
v5924P          OBJECT IDENTIFIER ::= { v5900 24 }
 | 
					v5924P          OBJECT IDENTIFIER ::= { v5900 24 }
 | 
				
			||||||
v5908P          OBJECT IDENTIFIER ::= { v5900 25 }
 | 
					v5908P          OBJECT IDENTIFIER ::= { v5900 25 }
 | 
				
			||||||
v5924C-R        OBJECT IDENTIFIER ::= { v5900 26 }
 | 
					v5924C-R        OBJECT IDENTIFIER ::= { v5900 26 }
 | 
				
			||||||
smc7824M_VSW    OBJECT IDENTIFIER ::= { v5900 27 }
 | 
					smc7824MVSW    OBJECT IDENTIFIER ::= { v5900 27 }
 | 
				
			||||||
v5924O         OBJECT IDENTIFIER ::= { v5900 28 }  
 | 
					v5924O         OBJECT IDENTIFIER ::= { v5900 28 }  
 | 
				
			||||||
v5908O         OBJECT IDENTIFIER ::= { v5900 29 }  
 | 
					v5908O         OBJECT IDENTIFIER ::= { v5900 29 }  
 | 
				
			||||||
v5904         OBJECT IDENTIFIER ::= { v5900 30 }  
 | 
					v5904         OBJECT IDENTIFIER ::= { v5900 30 }  
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -3266,7 +3266,7 @@
 | 
				
			|||||||
				v30a(15),
 | 
									v30a(15),
 | 
				
			||||||
				v12a997(16),
 | 
									v12a997(16),
 | 
				
			||||||
				v12b997(17),
 | 
									v12b997(17),
 | 
				
			||||||
				v17a_8k(18)
 | 
									v17a8k(18)
 | 
				
			||||||
				}
 | 
									}
 | 
				
			||||||
			MAX-ACCESS read-write
 | 
								MAX-ACCESS read-write
 | 
				
			||||||
			STATUS current
 | 
								STATUS current
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user