mirror of
				https://github.com/librenms/librenms.git
				synced 2024-10-07 16:52:45 +00:00 
			
		
		
		
	Initial commit for ServerIron support
This commit is contained in:
		@@ -483,6 +483,19 @@ $config['os'][$os]['over'][2]['graph'] = 'device_mempool';
 | 
			
		||||
$config['os'][$os]['over'][2]['text']  = 'Memory Usage';
 | 
			
		||||
$config['os'][$os]['icon']             = 'brocade';
 | 
			
		||||
 | 
			
		||||
// Brocade/Foundry ServerIron
 | 
			
		||||
$os = 'serveriron';
 | 
			
		||||
$config['os'][$os]['text']             = 'Brocade ServerIron';
 | 
			
		||||
$config['os'][$os]['type']             = 'network';
 | 
			
		||||
$config['os'][$os]['ifname']           = 1;
 | 
			
		||||
$config['os'][$os]['over'][0]['graph'] = 'device_bits';
 | 
			
		||||
$config['os'][$os]['over'][0]['text']  = 'Device Traffic';
 | 
			
		||||
$config['os'][$os]['over'][1]['graph'] = 'device_processor';
 | 
			
		||||
$config['os'][$os]['over'][1]['text']  = 'CPU Usage';
 | 
			
		||||
$config['os'][$os]['over'][2]['graph'] = 'device_mempool';
 | 
			
		||||
$config['os'][$os]['over'][2]['text']  = 'Memory Usage';
 | 
			
		||||
$config['os'][$os]['icon']             = 'brocade';
 | 
			
		||||
 | 
			
		||||
// Cisco Small Business
 | 
			
		||||
$os = 'ciscosb';
 | 
			
		||||
$config['os'][$os]['group']            = 'cisco';
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										15
									
								
								includes/discovery/mempools/serveriron.inc.php
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										15
									
								
								includes/discovery/mempools/serveriron.inc.php
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,15 @@
 | 
			
		||||
<?php
 | 
			
		||||
 | 
			
		||||
if ($device['os'] == "serveriron") {
 | 
			
		||||
    echo("nos: ");
 | 
			
		||||
 | 
			
		||||
    $used 	= snmp_get($device, "1.3.6.1.4.1.1588.2.1.1.1.26.6.0", "-Ovq");
 | 
			
		||||
    $total 	= "100";
 | 
			
		||||
    $free		= ($total - $used);
 | 
			
		||||
 | 
			
		||||
    $percent	= $used; 
 | 
			
		||||
 | 
			
		||||
    if (is_numeric($used)) {
 | 
			
		||||
        discover_mempool($valid_mempool, $device, 0, "serveriron", "Memory", "1", NULL, NULL);
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										7
									
								
								includes/discovery/os/serveriron.inc.php
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										7
									
								
								includes/discovery/os/serveriron.inc.php
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,7 @@
 | 
			
		||||
<?php
 | 
			
		||||
 | 
			
		||||
if (!$os) {
 | 
			
		||||
    if (preg_match('/ServerIron/', $sysDescr)) {
 | 
			
		||||
        $os = 'serveriron';
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										14
									
								
								includes/discovery/processors/serveriron.inc.php
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										14
									
								
								includes/discovery/processors/serveriron.inc.php
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,14 @@
 | 
			
		||||
<?php
 | 
			
		||||
 | 
			
		||||
if ($device['os'] == "serveriron") {
 | 
			
		||||
    echo("serveriron : ");
 | 
			
		||||
 | 
			
		||||
    $descr = "CPU";
 | 
			
		||||
    $usage = snmp_get($device, "1.3.6.1.4.1.1588.2.1.1.1.26.1.0", "-Ovq");
 | 
			
		||||
 | 
			
		||||
    if (is_numeric($usage)) {
 | 
			
		||||
        discover_processor($valid['processor'], $device, "1.3.6.1.4.1.1588.2.1.1.1.26.1", "0", "serveriron", $descr, "1", $usage, NULL, NULL);
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
unset ($processors_array);
 | 
			
		||||
							
								
								
									
										7
									
								
								includes/polling/mempools/serveriron.inc.php
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										7
									
								
								includes/polling/mempools/serveriron.inc.php
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,7 @@
 | 
			
		||||
<?php
 | 
			
		||||
 | 
			
		||||
// Somewhat of an uggly hack since Server doesn't support fetching total memory of the device over SNMP
 | 
			
		||||
// Given OID returns usage in percent so we set total to 100 in order to get a proper graph
 | 
			
		||||
$mempool['total'] 	= "100";
 | 
			
		||||
$mempool['used'] 	= snmp_get($device, "1.3.6.1.4.1.1588.2.1.1.1.26.6.0", "-Ovq");
 | 
			
		||||
$mempool['free'] 	= ($mempool['total'] - $mempool['used']); 
 | 
			
		||||
							
								
								
									
										5
									
								
								includes/polling/os/serveriron.inc.php
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										5
									
								
								includes/polling/os/serveriron.inc.php
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,5 @@
 | 
			
		||||
<?php
 | 
			
		||||
 | 
			
		||||
$version      = trim(snmp_get($device, "1.3.6.1.4.1.1588.2.1.1.1.1.6.0", "-Ovq"),'"');
 | 
			
		||||
$hardware     = trim(snmp_get($device, "ENTITY-MIB::entPhysicalDescr.1", "-Ovq"),'"');
 | 
			
		||||
$serial       = trim(snmp_get($device, "1.3.6.1.2.1.47.1.1.1.1.11.1", "-Ovq"),'"');
 | 
			
		||||
							
								
								
									
										3
									
								
								includes/polling/processors/serveriron.inc.php
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										3
									
								
								includes/polling/processors/serveriron.inc.php
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,3 @@
 | 
			
		||||
<?php
 | 
			
		||||
 | 
			
		||||
$proc = trim(snmp_get($device, "1.3.6.1.4.1.1588.2.1.1.1.26.1.0", "-Ovq"),'"');
 | 
			
		||||
		Reference in New Issue
	
	Block a user