I have been struggling for some time to get my head around a problem I’m having getting oxidized to interface with Librenms.
Validate is good, curl to oxidized works. No firewall installed. Librenms works perfectly, oxidized gets the switch config and stores it in a git repository. I can read the repository and confirm that the switch configuration is correct. I haven’t tried versioning yet though.
The problem is, I open the switch device in Librenms, I now have a ‘Config’ tab but it comes back with an error:“We couldn’t retrieve the device information from Oxidized”. The only thing that looks wrong to me is I can’t get the Librenms YAML checker to work. My config is good on other YAML checkers. My config file always has the error: Tags support is not enabled. Enable the
“Yaml::PARSE_CUSTOM_TAGS” flag to use “!ruby/regexp” at line 13 (near “prompt: !ruby/regexp /^([\w.@-]+[#>]\s?)$/”). I tried other configurations I found in searches and they also return the same error. I’m guessing it isn’t my oxidized config file that is the issue, but something else. My installation is based on the Ubuntu 18.04 OVA VM and updated to 1.67.
librenms@librenms:~$ ./validate.php
====================================
Component | Version
--------- | -------
LibreNMS | 1.67-8-g661a518de
DB Schema | 2020_08_28_212054_drop_uptime_column_outages (173)
I’m reviewing your config and…maybe I missed it but in your config.php I do not see any settings to enable oxidized, yet if you’re getting an oxidized tab in the web interface, it’s obviously turned on. I would have expected to see something like:
this configuration is saying that it’s using /home/oxidized/.config/oxidized/router.db as the source file for a list of devices to back up.
Your configuration should look something like this:
source:
default: http
debug: false
http:
url: http://127.0.0.1/api/v0/oxidized#if oxidized is on another machine the url would reflect that
map:
name: hostname
model: os
group: group
username: default_username
password: default_password
headers:
X-Auth-Token: ‘your_api_token’
Hi Killo
Thanks for your responses.
I did have the source setup for Librenms via http, but after I couldn’t get it to work, I tried using the router.db, which did work, at least to the point that it would pull the switch configuration, but Librenms still couldn’t show the config in the tab. I’ll change the source back and post some outputs.
Re the security, this is a test vm, using my own switch, so any revealed passwords are only short lived.
OK, I setup source as http.
See below, curl works, though I am not sure about one thing. It only works with the librenms user token. I also have a user called oxidized, but using that token fails curl.
librenms@librenms:~$ curl -H ‘X-Auth-Token: My-librenms-user-Token’ http://127.0.0.1/api/v0/oxidized
[
{
“hostname”: “localhost”,
“os”: “linux”,
“ip”: “127.0.0.1”
},
{
“hostname”: “192.168.1.1”,
“os”: “draytek”,
“ip”: “”
},
{
“hostname”: “hp2920”,
“os”: “procurve”,
“ip”: “192.168.1.24”
}
What about the fact that my YAML doesn’t pass? Is that a known issue? Like I said in a previous post, I get the same error with any ‘known’ working config that I’ve dug up via searches, but using online YAML checkers, it passes.
lastly, re the hard oxidized configuration the in librenms.conf file, I don’t believe it is necessary because I have control over all of those settings from with the Librenms GUI. Am I right? If I set them in the config file, they are grayed out in the GUI.
I have never used the YAML checker. I cannot speak to how good or bad it is.
+I created an oxidized user in librenms with global read permissions and assigned an API key for this user.
+I run oxidized and librenms on the same machine, I think that you do also but if you do not please let me know.
+from the librenms server, run curl command using the oxidized user api key to ensure it’s functioning correctly. If not, we have to figure out why. If you are trying to curl from your PC, I would guess it’s not working due to security, possibly firewall or web server configuration. This should not be a problem as far as I know and can tell – in most configuration librenms and oxidized are on the same machine so they are talking to themselves via 127.0.0.1/api/v0/oxidized - there’s no reason for any external systems to use the librenms api unless you are doing some separate integration.
+once you verify that the librenms api key is working via shell on librenms server, put the key into your oxidized configuration file.
+I moved from observium to librenms, i mostly use the /opt/librenms/config.php file to make changes instead of the gui. Because I think that not all of the options are available in the GUI.
Do you have mostly procurve / hp / aruba switches? We do also. I have a working config that should work for you if we can get through a few things.
Problem solved. The oxidized config was encoded to ANSI, not UTF-8. I copied a config from a web page, and as a result, the YAML checker was objecting to everything. I still had a hell of a time changing it. I used notepad++ to change the encoding, but I still had issues. I ended up editing an original config file .