File: storage.inc.php

package info (click to toggle)
jffnms 0.8.3dfsg.1-2.1etch1
  • links: PTS
  • area: main
  • in suites: etch
  • size: 4,928 kB
  • ctags: 5,050
  • sloc: php: 19,981; sh: 266; makefile: 91; perl: 52
file content (26 lines) | stat: -rw-r--r-- 867 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
<?
/* This file is part of JFFNMS
 * Copyright (C) <2006> Javier Szyszlican <javier@szysz.com>
 * This program is licensed under the GNU GPL, full terms in the LICENSE file
 */

    function storage_interface_parse_description ($descr) {

	$label_hex = strpos($descr,"Hex");
	if ($label_hex!==FALSE)   // UCD-SNMP 4.2.4 fix
	    $descr = substr($descr,0,$label_hex-1);
		    
	$descr  = str_replace("\"","",$descr); // UCD-SNMP 4.2.4 fix
	$descr  = str_replace("\\","",$descr); // Windows Hack for C:\ breaking the DB

	//Windows XP Disk Label Hack
	$label_pos = strpos($descr,"Label");
	if ($label_pos!==false) {  
	    $interface = substr($descr,0, $label_pos - 1); //strip the \ and the space
	    $description = substr($descr,$label_pos, strlen($descr) - $label_pos);
	} else 
	    $interface = $descr;
    	    
	return array($interface, $description);
    }
?>