Unable to add new Oxidized group map

I’m trying to add arubaos-cx devices to Oxidized using the following command: lnms config:set oxidized.maps.os.os.+ '{"match": "arubaos-cx", "value": "aoscx"}' However, this produces the following error:

The value.group.os.0 contains invalid keys: group. Valid keys: match,regex,value
The value.group.os.1 contains invalid keys: group. Valid keys: match,regex,value
The value.group.os.2 contains invalid keys: group. Valid keys: match,regex,value
The value.group.os.3 contains invalid keys: group. Valid keys: match,regex,value
The value.group.os.4 contains invalid keys: group. Valid keys: match,regex,value
The value.group.os.5 contains invalid keys: group. Valid keys: match,regex,value
The value.group.os.6 contains invalid keys: group. Valid keys: match,regex,value
The value.group.os.7 contains invalid keys: group. Valid keys: match,regex,value
The value.group.os.0.value field is required.
The value.group.os.1.value field is required.
The value.group.os.2.value field is required.
The value.group.os.3.value field is required.
The value.group.os.4.value field is required.
The value.group.os.5.value field is required.
The value.group.os.6.value field is required.
The value.group.os.7.value field is required.

I’ve tried many variations of this command, such as setting oxidized.maps.group.os, and it always produces this error. As far as I know, no one has ever changed the mapping on my install from default values. I’m not able to edit the mappings via the web GUI either. How can I resolve this?

Below is me checking the standard oxidized mappings, adding yours then checking again. It looks like you most likely have something set incorrectly so run lnms config:get oxidized.maps.os.os to see.

librenms@utils:~$ lnms config:get oxidized.maps.os.os
[
    {
        "match": "airos-af-ltu",
        "value": "airfiber"
    },
    {
        "match": "airos-af",
        "value": "airfiber"
    },
    {
        "match": "arista_eos",
        "value": "eos"
    },
    {
        "match": "ciscosb",
        "value": "ciscosmb"
    },
    {
        "match": "f5",
        "value": "tmos"
    },
    {
        "match": "fireware",
        "value": "firewareos"
    },
    {
        "match": "fortigate",
        "value": "fortios"
    },
    {
        "match": "fortiswitch",
        "value": "fortios"
    },
    {
        "match": "vyos",
        "value": "vyatta"
    },
    {
        "match": "slms",
        "value": "zhoneolt"
    },
    {
        "match": "oneaccess",
        "value": "oneos"
    }
]
librenms@utils:~$  lnms config:set oxidized.maps.os.os.+ '{"match": "arubaos-cx", "value": "aoscx"}'
librenms@utils:~$ lnms config:get oxidized.maps.os.os
[
    {
        "match": "airos-af-ltu",
        "value": "airfiber"
    },
    {
        "match": "airos-af",
        "value": "airfiber"
    },
    {
        "match": "arista_eos",
        "value": "eos"
    },
    {
        "match": "ciscosb",
        "value": "ciscosmb"
    },
    {
        "match": "f5",
        "value": "tmos"
    },
    {
        "match": "fireware",
        "value": "firewareos"
    },
    {
        "match": "fortigate",
        "value": "fortios"
    },
    {
        "match": "fortiswitch",
        "value": "fortios"
    },
    {
        "match": "vyos",
        "value": "vyatta"
    },
    {
        "match": "slms",
        "value": "zhoneolt"
    },
    {
        "match": "oneaccess",
        "value": "oneos"
    },
    {
        "match": "arubaos-cx",
        "value": "aoscx"
    }
]
librenms@utils:~$ 

Hi @laf, thank you for taking the time to look into this. Here is my oxidized map config:

librenms@librenms:~$ lnms config:get oxidized.maps
{
    "os": {
        "os": [
            {
                "match": "airos-af-ltu",
                "value": "airfiber"
            },
            {
                "match": "airos-af",
                "value": "airfiber"
            },
            {
                "match": "arista_eos",
                "value": "eos"
            },
            {
                "match": "ciscosb",
                "value": "ciscosmb"
            },
            {
                "match": "f5",
                "value": "tmos"
            },
            {
                "match": "fireware",
                "value": "firewareos"
            },
            {
                "match": "fortigate",
                "value": "fortios"
            },
            {
                "match": "vyos",
                "value": "vyatta"
            },
            {
                "match": "slms",
                "value": "zhoneolt"
            },
            {
                "match": "oneaccess",
                "value": "oneos"
            }
        ]
    },
    "group": {
        "os": [
            {
                "match": "procurve",
                "group": "procurve"
            },
            {
                "match": "ios",
                "group": "ios"
            },
            {
                "match": "eos",
                "group": "eos"
            },
            {
                "match": "nxos",
                "group": "nxos"
            },
            {
                "match": "panos",
                "group": "panos"
            },
            {
                "match": "junos",
                "group": "junos"
            },
            {
                "match": "comware",
                "group": "comware"
            }
        ]
    }
}
librenms@librenms:~$

My oxidized.maps.os.os looks more or less identical to yours except for the absence of fortiswitch, so I’m not sure what the problem is.

I’ve just noticed this was about group.os and not os.os anyway.

The issue is you’ve got group: x in your group.os when it should be value: x:

lnms config:set oxidized.maps.group.os.+ '{"match": "edgeos", "value": "wireless"}'

Thanks @laf, that makes sense. However, running config:sets like the one you suggested still results in the error mentioned in my original post. I’m also unable to remove entries using i.e. lnms config:set oxidized.maps.group.os.- '{"match": "comware", "group": "comware"}'. How should I change these entries from group to value?

You’ll have to override all of the bad values, I expect this will work but you’d need to expand out to include all of the required existing values:

lnms config:set oxidized.maps.group.os '{"match": "edgeos", "value": "wireless"}'

That will remove all existing matches and just add edgeos, be warned.

I tried running your suggested command, but still receive the same error with no changes made to the actual setting:

librenms@librenms:~$ lnms config:set oxidized.maps.value.os '[{"match": "procurve", "value": "procurve"}, {"match": "ios", "value": "ios"}, {"match": "eos", "value": "eos"}, {"match": "nxos", "value": "nxos"}, {"match": "panos", "value": "panos"}, {"match": "junos", "value": "junos"}, {"match": "comware", "value": "comware"}]'
The value.group.os.0 contains invalid keys: group. Valid keys: match,regex,value 
The value.group.os.1 contains invalid keys: group. Valid keys: match,regex,value 
The value.group.os.2 contains invalid keys: group. Valid keys: match,regex,value 
The value.group.os.3 contains invalid keys: group. Valid keys: match,regex,value 
The value.group.os.4 contains invalid keys: group. Valid keys: match,regex,value 
The value.group.os.5 contains invalid keys: group. Valid keys: match,regex,value 
The value.group.os.6 contains invalid keys: group. Valid keys: match,regex,value 
The value.group.os.0.value field is required. 
The value.group.os.1.value field is required. 
The value.group.os.2.value field is required. 
The value.group.os.3.value field is required. 
The value.group.os.4.value field is required. 
The value.group.os.5.value field is required. 
The value.group.os.6.value field is required.
librenms@librenms:~$ lnms config:get oxidized.maps.group.os
[
    {
        "match": "procurve",
        "group": "procurve"
    },
    {
        "match": "ios",
        "group": "ios"
    },
    {
        "match": "eos",
        "group": "eos"
    },
    {
        "match": "nxos",
        "group": "nxos"
    },
    {
        "match": "panos",
        "group": "panos"
    },
    {
        "match": "junos",
        "group": "junos"
    },
    {
        "match": "comware",
        "group": "comware"
    }
]
librenms@librenms:~$

This is a tough one!

You are setting oxidized.maps.value.os and not oxidized.maps.group.os (but you are getting the correct one oxidized.maps.group.os).

Thank you for clarifying. I ran lnms config:set oxidized.maps.group.os, but it prepended to the array instead of overwriting. Now I’m not sure how to remove the old, broken entries.

librenms@librenms:~$ lnms config:set oxidized.maps.group.os '[{"match": "procurve", "value": "procurve"}, {"match": "ios", "value": "ios"}, {"match": "eos", "value": "eos"}, {"match": "nxos", "value": "nxos"}, {"match": "panos", "value": "panos"}, {"match": "junos", "value": "junos"}, {"match": "comware", "value": "comware"}]'
librenms@librenms:~$ lnms config:get oxidized.maps.group.os
[
    {
        "match": "procurve",
        "value": "procurve"
    },
    {
        "match": "ios",
        "value": "ios"
    },
    {
        "match": "eos",
        "value": "eos"
    },
    {
        "match": "nxos",
        "value": "nxos"
    },
    {
        "match": "panos",
        "value": "panos"
    },
    {
        "match": "junos",
        "value": "junos"
    },
    {
        "match": "comware",
        "value": "comware"
    },
    {
        "match": "procurve",
        "group": "procurve"
    },
    {
        "match": "ios",
        "group": "ios"
    },
    {
        "match": "eos",
        "group": "eos"
    },
    {
        "match": "nxos",
        "group": "nxos"
    },
    {
        "match": "panos",
        "group": "panos"
    },
    {
        "match": "junos",
        "group": "junos"
    },
    {
        "match": "comware",
        "group": "comware"
    }
]
librenms@librenms:~$ lnms config:set oxidized.maps.group.os.- '{"match": "comware", "group": "comware"}'
The value.group.os.7 contains invalid keys: group. Valid keys: match,regex,value 
The value.group.os.8 contains invalid keys: group. Valid keys: match,regex,value 
The value.group.os.9 contains invalid keys: group. Valid keys: match,regex,value 
The value.group.os.10 contains invalid keys: group. Valid keys: match,regex,value 
The value.group.os.11 contains invalid keys: group. Valid keys: match,regex,value 
The value.group.os.12 contains invalid keys: group. Valid keys: match,regex,value 
The value.group.os.13 contains invalid keys: group. Valid keys: match,regex,value 
The value.group.os.- contains invalid keys: group. Valid keys: match,regex,value 
The value.group.os.7.value field is required. 
The value.group.os.8.value field is required. 
The value.group.os.9.value field is required. 
The value.group.os.10.value field is required. 
The value.group.os.11.value field is required. 
The value.group.os.12.value field is required. 
The value.group.os.13.value field is required. 
The value.group.os.-.value field is required.

Now that the corrected entries are in place, how do I remove the broken entries?