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

Fix os additional information for some that were broke #9466

Merged
merged 2 commits into from Nov 28, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion includes/polling/os/cnpilote.inc.php
Expand Up @@ -10,7 +10,7 @@
*/


$version = $poll_device['sysDescr'];
$version = $device['sysDescr'];
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

$poll_device is set in core.inc.php so should be available to all modules - although I can now see it's unset in that file so the fix really should be to remove it from that unset.

$device here is from the DB (or at least it used to be) so that means this will take 2 polls to get this data

Copy link
Member Author

@murrant murrant Nov 22, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@laf $poll_device is unset in core.inc.php but all the values are updated into the $device array before that.

If you notice I added version and hardware in the draytek test data... They were broke before this.

$cnpilot_data = snmp_get_multi_oid($device, 'cambiumAPSerialNum.0 cambiumAPHWType.0', '-OUQs', 'CAMBIUM-MIB');

$hardware = $cnpilot_data['cambiumAPHWType.0'];
Expand Down
2 changes: 1 addition & 1 deletion includes/polling/os/draytek.inc.php
Expand Up @@ -3,7 +3,7 @@
* draytek.inc.php
* @author Jason Cheng <sanyu3u@gmail.com>
*/
preg_match('/Router Model: ([\w ]+), Version: ([\w\.]+)/', $poll_device['sysDescr'], $tmp_draytek);
preg_match('/Router Model: ([\w ]+), Version: ([\w\.]+)/', $device['sysDescr'], $tmp_draytek);
$hardware = $tmp_draytek[1];
$version = $tmp_draytek[2];
unset($tmp_draytek);
2 changes: 1 addition & 1 deletion includes/polling/os/ironware.inc.php
Expand Up @@ -12,7 +12,7 @@
} else {
// Brocade NetIron CER, Extended route scalability, IronWare Version V5.6.0fT183 Compiled on Mar 27 2015 at 02:13:25 labeled as V5.6.00fb
// Brocade MLXe (System Mode: XMR), IronWare Version V5.6.0gT163 Compiled on Aug 27 2015 at 23:23:54 labeled as V5.6.00g
preg_match('/IronWare Version (.*) Compiled on/', $poll_device['sysDescr'], $regexp_result);
preg_match('/IronWare Version (.*) Compiled on/', $device['sysDescr'], $regexp_result);
$version = $regexp_result[1];
$version = str_replace('V', '', $version);
}
Expand Down
2 changes: 1 addition & 1 deletion includes/polling/os/ptp500.inc.php
Expand Up @@ -2,6 +2,6 @@

use LibreNMS\RRD\RrdDefinition;

$version = $poll_device['sysDescr'];
$version = $device['sysDescr'];
$masterSlaveMode = ucfirst(snmp_get($device, 'masterSlaveMode.0', '-Oqv', "CAMBIUM-PTP500-V2-MIB"));
$hardware = 'PTP 500 '. $masterSlaveMode;
2 changes: 1 addition & 1 deletion includes/polling/os/ptp600.inc.php
Expand Up @@ -24,6 +24,6 @@
*/
use LibreNMS\RRD\RrdDefinition;

$version = $poll_device['sysDescr'];
$version = $device['sysDescr'];
$masterSlaveMode = ucfirst(snmp_get($device, 'masterSlaveMode.0', '-Oqv', "CANOPY-SYS-MIB"));
$hardware = 'PTP 600 '.$masterSlaveMode;
2 changes: 1 addition & 1 deletion includes/polling/os/ptp800.inc.php
Expand Up @@ -24,5 +24,5 @@
*/
use LibreNMS\RRD\RrdDefinition;

$version = $poll_device['sysDescr'];
$version = $device['sysDescr'];
$hardware = 'PTP 800';
4 changes: 2 additions & 2 deletions tests/data/draytek.json
Expand Up @@ -25,8 +25,8 @@
"sysObjectID": ".1.3.6.1.4.1.7367",
"sysDescr": "DrayTek Corporation, Router Model: Vigor2920 Series, Version: 3.8.8.2, Build Date/Time:May 21 2018 16:45:55",
"sysContact": "<private>",
"version": null,
"hardware": null,
"version": "3.8.8.2",
"hardware": "Vigor2920 Series",
"features": null,
"location": "<private>",
"os": "draytek",
Expand Down