forked from poppyred/1.6.x
/
exec.squid.snmp.php
executable file
·45 lines (27 loc) · 1.05 KB
/
exec.squid.snmp.php
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
<?php
$GLOBALS["VERBOSE"]=true;ini_set('display_errors', 1); ini_set('html_errors',0);ini_set('display_errors', 1);ini_set('error_reporting', E_ALL);
include_once(dirname(__FILE__) . '/framework/class.unix.inc');
include_once(dirname(__FILE__) . '/framework/frame.class.inc');
include_once(dirname(__FILE__) . '/framework/class.settings.inc');
include_once(dirname(__FILE__) . '/ressources/class.freeweb.inc');
include_once(dirname(__FILE__) . '/ressources/class.system.network.inc');
function install(){
}
run();
function run(){
if(!extension_loaded('snmp')){install();exit;}
if(!class_exists("SNMP")){exit;}
$session = new SNMP(SNMP::VERSION_1, "127.0.0.1:3401", "public");
$session->valueretrieval = SNMP_VALUE_PLAIN;
$ifDescr = $session->walk(".1.3.6.1.4.1.3495.1.3", TRUE);
$session->valueretrieval = SNMP_VALUE_LIBRARY;
$ifType = $session->walk(".1.3.6.1.4.1.3495.1.3", TRUE);
// 2.2.1.10.5
print_r($ifType);
$result = array();
foreach($ifDescr as $i => $n) {
$result[$n] = $ifType[$i];
}
print_r($result);
}
?>