Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added support for Zmtel greenpacket devices (os: zmtel) #10067

Merged
merged 6 commits into from Apr 29, 2019
Merged
Changes from 3 commits
Commits
File filter...
Filter file types
Jump to…
Jump to file or symbol
Failed to load files and symbols.

Always

Just for now

Binary file not shown.
@@ -0,0 +1,96 @@
mib: ZMTEL-ODU-MIB
modules:
sensors:
snr:
data:
-
oid: sinr
num_oid: '.1.3.6.1.4.1.38595.10.3.15.{{ $index }}'
descr: Signal to Interference
index: 'sinr.{{ $index }}'
-
oid: cinr0
num_oid: '.1.3.6.1.4.1.38595.10.3.16.{{ $index }}'
descr: Carrier to Interference 0
index: 'cinr0.{{ $index }}'
-
oid: cinr1
num_oid: '.1.3.6.1.4.1.38595.10.3.17.{{ $index }}'
descr: Carrier to Interference 1
index: 'cinr1.{{ $index }}'
frequency:
data:
-
oid: dlFrequency
num_oid: '.1.3.6.1.4.1.38595.10.3.8.{{ $index }}'
descr: Download
index: 'dlFrequency.{{ $index }}'
-
oid: ulFrequency
num_oid: '.1.3.6.1.4.1.38595.10.3.9.{{ $index }}'
descr: Upload
index: 'ulFrequency.{{ $index }}'
-
oid: bandwidth
num_oid: '.1.3.6.1.4.1.38595.10.3.10.{{ $index }}'
descr: Bandwidth
index: 'bandwidth.{{ $index }}'
dbm:
data:
-
oid: rsrp0
num_oid: '.1.3.6.1.4.1.38595.10.3.11.{{ $index }}'
descr: RSRP0
index: 'rsrp0.{{ $index }}'
group: Reference Signal Received Power
-
oid: rsrp1
num_oid: '.1.3.6.1.4.1.38595.10.3.12.{{ $index }}'
descr: RSRP1
index: 'rsrp1.{{ $index }}'
group: Reference Signal Received Power
-
oid: rsrq
num_oid: '.1.3.6.1.4.1.38595.10.3.13.{{ $index }}'
descr: Reference Signal Received Quality
index: 'rsrq.{{ $index }}'
-
oid: rssi
num_oid: '.1.3.6.1.4.1.38595.10.3.14.{{ $index }}'
descr: Received Signal Strength Indicator
index: 'rssi.{{ $index }}'
-
oid: txPower
num_oid: '.1.3.6.1.4.1.38595.10.3.18.{{ $index }}'
descr: Tx Power
index: 'txPower.{{ $index }}'
state:
data:
-
oid: wanMode
num_oid: '.1.3.6.1.4.1.38595.10.4.1.{{ $index }}'
index: 'wanMode.{{ $index }}'
descr: WAN Mode
state_name: wanMode
states:
- { value: 0, descr: NAT, graph: 0, generic: 0 }
- { value: 1, descr: Router, graph: 0, generic: 0 }
- { value: 2, descr: Router, graph: 0, generic: 0 }
-
oid: wanType
num_oid: '.1.3.6.1.4.1.38595.10.4.2.{{ $index }}'
index: 'wanType.{{ $index }}'
descr: WAN type
state_name: wanType
states:
- { value: 0, descr: DHCP, graph: 0, generic: 0 }
- { value: 1, descr: Static, graph: 0, generic: 0 }
-
oid: firewall
num_oid: '.1.3.6.1.4.1.38595.10.2.9.{{ $index }}'
index: 'firewall.{{ $index }}'
descr: Firewall Status
state_name: firewall
states:
- { value: 0, descr: disabled, graph: 0, generic: 2 }
- { value: 1, descr: enabled, graph: 0, generic: 0 }
@@ -0,0 +1,9 @@
os: zmtel
text: 'Zmtel Greenpacket'
icon: greenpacket
type: network
mib_dir:
- zmtel
discovery:
- sysObjectID:
- .1.3.6.1.4.1.38595.10
@@ -0,0 +1,18 @@
<?php
$temp_data = snmpwalk_cache_oid($device, 'deviceInfo', [], 'ZMTEL-ODU-MIB', 'zmtel');
This conversation was marked as resolved by spencerbutler

This comment has been minimized.

Copy link
@laf

laf Apr 9, 2019

Member

Can you not just do a multi get here for the 4 values you need rather than working additional data?

This comment has been minimized.

Copy link
@spencerbutler

spencerbutler Apr 9, 2019

Author Contributor

fixed

foreach ($temp_data as $data) {
$oids = 'dlMCS ulMCS eNBID pCID';
$oid_data = array_keys(snmp_getnext_multi($device, $oids, '-OUvq', 'ZMTEL-ODU-MIB'));
$dlmcs = $oid_data[0];
$ulmcs = $oid_data[1];
$enbid = $oid_data[2];
$pcid = $oid_data[3];
$version = $data['softwareVersion'];
$hardware = $data['modelName'] . ' ' . $data['hardwareVersion'];
$serial = $data['SN'];
$features = 'eNodeB: ' . $enbid . ' Physical Cell: ' . $pcid . ' DL Modulation: ' . $dlmcs . ' UL Modulation: ' . $ulmcs . ' bootROM: ' . $data['bootROM'] . ' LTE Band: ' . $data['lteBand'];
}
unset($temp_data);
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.