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

Port API returns status=ok for invalid names #15964

Open
salfers opened this issue Apr 22, 2024 · 0 comments
Open

Port API returns status=ok for invalid names #15964

salfers opened this issue Apr 22, 2024 · 0 comments

Comments

@salfers
Copy link

salfers commented Apr 22, 2024

The problem

Example API response with a device and port that doesn't exist:

// curl 'https://librenms.internal/api/v0/devices/bbbbb/ports/aasdasdsad' -H "X-Auth-Token: ..." -H "Accept: application/json"
{
    "status": "ok",
    "port": {
        "in_rate": "0 bps",
        "out_rate": "0 bps",
        "in_perc": 0,
        "out_perc": 0,
        "in_pps": "0 ",
        "out_pps": "0 "
    },
    "count": 6
}

While the output looks very different for a valid port (many more fields), I think it's still incorrect that LibreNMS replies with "status": "ok" here.
I would expect for example this:

{
    "status": "error",
    "port": {},
    "count": 0
}

Output of ./validate.php

===========================================
Component | Version
--------- | -------
LibreNMS  | 24.4.1 (2024-04-20T16:26:51+02:00)
DB Schema | 2024_04_10_093513_remove_device_perf (291)
PHP       | 8.2.18
Python    | 3.6.8
Database  | MariaDB 10.11.7-MariaDB
RRDTool   | 1.7.0
SNMP      | 5.8
===========================================

[OK]    Composer Version: 2.7.3
[OK]    Dependencies up-to-date.
[OK]    Database connection successful
[OK]    Database Schema is current
[OK]    SQL Server meets minimum requirements
[OK]    lower_case_table_names is enabled
[OK]    MySQL engine is optimal
[OK]    Database and column collations are correct
[OK]    Database schema correct
[OK]    MySQL and PHP time match
[OK]    Active pollers found
[OK]    Dispatcher Service not detected
[OK]    Locks are functional
[OK]    Python poller wrapper is polling
[OK]    Redis is functional
[OK]    rrdtool version ok
[OK]    Connected to rrdcached

What was the last working version of LibreNMS?

No response

Anything in the logs that might be useful for us?

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant