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: Detection blank or unknown device types and update #5412 #5414

Merged
merged 2 commits into from Jan 13, 2017

Conversation

Projects
None yet
5 participants
@laf
Copy link
Member

commented Jan 12, 2017

DO NOT DELETE THIS TEXT

Please note

Please read this information carefully. You can run ./scripts/pre-commit.php to check your code before submitting.

Fixes: #5412

@mention-bot

This comment has been minimized.

Copy link

commented Jan 12, 2017

Thank you for submitting a PR @laf! We have found the following @murrant, @paulgear and @BarbarossaTM based on the history of these files to review this PR.

@LibreNMS-CI

This comment has been minimized.

Copy link

commented Jan 12, 2017

Auto-Deploy finished, Test PR at http://5414.ci.librenms.org or https://5414.ci.librenms.org

@@ -1527,9 +1527,12 @@ function load_os(&$device)
);
// Set type to a predefined type for the OS if it's not already set
if ($device['type'] == 'unknown' || $device['type'] == '') {
if ($device['type'] == 'unknown' || $device['type'] == '' || $config['os'][$device['os']]['type'] != $device['type']) {

This comment has been minimized.

Copy link
@murrant

murrant Jan 13, 2017

Member

It feels like this should be, I'm not somewhere where I can test it right now...

    // Set type to a predefined type for the OS if it's not already set
    if ($config['os'][$device['os']]['type'] && $config['os'][$device['os']]['type'] != $device['type']) {
        $device['type'] = $config['os'][$device['os']]['type'];
        $sql = dbUpdate(array('type' => $device['type']), 'devices', 'device_id=?', array($device['device_id']));
        log_event('Device type changed '.$device['type'].' => '.$config['os'][$device['os']]['type'], $device, 'system');
        echo "Changed Type! : ".$device['type'].PHP_EOL;
    }
@LibreNMS-CI

This comment has been minimized.

Copy link

commented Jan 13, 2017

Auto-Deploy finished, Test PR at http://5414.ci.librenms.org or https://5414.ci.librenms.org

@scrutinizer-notifier

This comment has been minimized.

Copy link

commented Jan 13, 2017

The inspection completed: 1 updated code elements

@murrant murrant merged commit 6ff3ae8 into librenms:master Jan 13, 2017

2 checks passed

Auto-Deploy Build finished.
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details

@laf laf deleted the laf:issue-5412 branch Jan 13, 2017

@lock lock bot locked as resolved and limited conversation to collaborators Jan 20, 2019

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
You can’t perform that action at this time.