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

Serial number and more robust OS version for Netgear switches #10164

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

Always

Just for now

@@ -3,3 +3,5 @@
// sysDescr.0 = XS712T ProSafe 12-Port 10 Gigabit Ethernet (10GbE) Smart Switch, 6.1.0.12, B6.1.0.1
list($hardware, ) = explode(' ', $device['sysDescr']);
list(,$version, ) = explode(',', $device['sysDescr']);
if(!$version) $version = trim(snmp_get($device, 'entPhysicalSoftwareRev.1', '-OQv', 'ENTITY-MIB', ''), '"');

Check notice on line 6 in includes/polling/os/netgear.inc.php

Scrutinizer / Inspection

includes/polling/os/netgear.inc.php#L6

It seems like ``snmp_get($device, 'entPhysicalSoftwareRev.1', '-OQv', 'ENTITY-MIB', '')`` can also be of type ``false``; however, parameter ``$str`` of ``trim()`` does only seem to accept ``string``, maybe add an additional type check?
$serial = trim(snmp_get($device, 'entPhysicalSerialNum.1', '-OQv', 'ENTITY-MIB', ''), '"');
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.