1 | <?php |
||
2 | |||
3 | $temps = snmp_walk($device, '.1.3.6.1.4.1.674.10895.5000.2.6132.1.1.43.1.8.1.5', '-Osqn'); |
||
4 | //This will return at least 4 OIDs (multiplied by the number of switches if stacked) and associated values for various temperatures |
||
5 | |||
6 | $counter = 0; |
||
7 | |||
8 | foreach (explode("\n", $temps) as $i => $t) { |
||
9 | $t = explode(' ', $t); |
||
10 | $oid = $t[0]; |
||
11 | $val = $t[1]; |
||
12 | |||
13 | if (substr($oid, -1) == '1') { |
||
14 | // This code will only pull CPU temp for each stack member, but there is no reason why the additional values couldn't be graphed |
||
15 | $counter = $counter + 1; |
||
16 | discover_sensor($valid['sensor'], 'temperature', $device, $oid, $counter, 'dnos', 'Unit ' . $counter . ' CPU temperature', '1', '1', null, null, null, null, $val); |
||
17 | } |
||
18 | } |
||
19 | |||
20 | // Force10 S-Series |
||
21 | // F10-S-SERIES-CHASSIS-MIB::chStackUnitTemp.1 = Gauge32: 47 |
||
22 | // F10-S-SERIES-CHASSIS-MIB::chStackUnitModelID.1 = STRING: S25-01-GE-24V |
||
23 | echo 'FTOS C-Series '; |
||
24 | |||
25 | $oids = snmpwalk_cache_oid($device, 'chStackUnitTemp', [], 'F10-S-SERIES-CHASSIS-MIB', 'ftos'); |
||
26 | $oids = snmpwalk_cache_oid($device, 'chStackUnitSysType', $oids, 'F10-S-SERIES-CHASSIS-MIB', 'ftos'); |
||
27 | |||
28 | if (is_array($oids)) { |
||
0 ignored issues
–
show
introduced
by
Loading history...
|
|||
29 | foreach ($oids as $index => $entry) { |
||
30 | $descr = 'Unit ' . $index . ' ' . $entry['chStackUnitSysType']; |
||
31 | $oid = '.1.3.6.1.4.1.6027.3.10.1.2.2.1.14.' . $index; |
||
32 | $current = $entry['chStackUnitTemp']; |
||
33 | discover_sensor($valid['sensor'], 'temperature', $device, $oid, $index, 'ftos-sseries', $descr, '1', '1', null, null, null, null, $current); |
||
34 | } |
||
35 | } |
||
36 |