Device Grouping By IP Inconsistant

I am trying to group devices by subnet, but I get odd results.

  • Group 1: %ipv4_addresses.ipv4_address ~ “10.6.10.@” ||
    This group does not find any devices, I have 69 devices under the 10.6.10.0/24 subnet

  • Group 2: %ipv4_addresses.ipv4_address ~ “10.6.0.@” ||
    This group finds 63/69 devices that it should under the 10.6.0.0/24

I have tried a bunch of different combinations of this and can’t seem to get it to do what I want.

Here is the validate.php
====================================

Component Version
LibreNMS 1.37
DB Schema 240
PHP 7.0.28-0ubuntu0.16.04.1
MySQL 10.0.34-MariaDB-0ubuntu0.16.04.1
RRDTool 1.5.5
SNMP NET-SNMP 5.7.3

====================================

[OK] Database connection successful
[WARN] Your schema (240) is newer than than expected (237). If you just switch to the stable release from the daily release, your database is in between releases and this will be resolved with the next release.
[OK] Database schema correct
[WARN] Some devices have not been polled in the last 5 minutes. You may have performance issues.
[FIX] Check your poll log and see: http://docs.librenms.org/Support/Performance/
Devices:
10.6.10.86
10.6.0.40
10.6.0.96
10.6.0.97
10.6.0.61
10.6.0.91
10.6.0.92
10.6.10.72

try it like this

image

and

image

  • Group 1: %ipv4_addresses.ipv4_address ~ “10.6.10.” &&
    No devices show up

  • Group 2: %ipv4_addresses.ipv4_address ~ “10.6.0.” &&
    Same amount of devices show up

It does not appear to have made a change.

It is actually using a regex so . matches any character

put back slashes in front of periods like this:
10\.6\.10\.

Tried that with group 1 and it didn’t work.

%ipv4_addresses.ipv4_address ~ "10\.6\.10\." ||

post a screenshot of the device group so we can make sure everything is getting typed in correctly.

on the first one you are missing the dot at the end of 10

Still no luck with the dot added

hmm im stomped :frowning:
worked on my system

image

Group 2 seems to work, except for 6 devices, so I can’t make sense of it. I have tried matching on sysname and I get similar weirdness, one group will match the name on almost every device that it should and the other will match against 0, when it should match against 69.

If it was me i would just do it by sysname or hostname or location or os etc. anything but IP. Ip for device group has always been kinda wonky for me. just my 2 cents.

1 Like

Yeah, that actually is working for me with both groups. This should work long term for me ok, I’ll just have a few groups with some extra rules to match for.