Port search query based on ifAlias, using global search


I’m trying to query libreNMS ports based on ifAlias, because i’ve a sale order number linked with odoo contained in it.

In the API, i’ve found nothing for writing search queries. The global search input does the job, but relies on “ajax_search.php?search=%QUERY&type=ports”, and is not authorized through api token.

Any suggestion? I could register in my ruby code with username and password and but it’s a bit dirty…

Thank you

Wibaut PH

This would need to be added to the api.

Ok, for now it’s locking me a bit.
I’m not expert in PHP and Slim. I’ll give it a try.
I observe that ajax_search check session authentication. Api is based on token.

I propose this implementation:

But I don’t have the environment to test it. Please could you confirm the design choices?
Any idea of the time you need to integrate it?


Wibaut PH

It’s extremely difficult to see what you’ve changed, if you’ve updated these files in your local git install then provide the output of git diff

Git diff added to gist.

Do you have suggestion? I’ll try to test it, but I have to setup a dev vm first.

In the same idea, making data polling for real-time JS graph would be a good feature too.
Even better, it would be great to be able to access RRD data and plot graph directly from that.

I can negotiate time with my customer to bring that feature, if it seems interesting for you.

For the search, you should put a pull request in on github so people can review what you are proposing.

With regards to the graphs being JS. We are doing that in V2 of the WebUI github.com/librenms/librenmsv2


I finally wrote it, and pull request it. I never work with PHP and all the framework and stuffs involved in librenms, so don’t expect an old-time contributer quality work :slight_smile:
The pull request on github