Groups based in IP addresses

i will try 172.16.[1-9].@
thanks

1 Like

nope :frowning: still listing the 172.16.0.x net and 172.16.10.x net and 172.16.20.x net

They really need to work more in grouping and managing groups, I have a network with more than 500 customers plus my router and servers infrastructure and its kinda hard to groups with libre :frowning:

JC

I can group based on :
%devices.status = “ignored” &&
%devices.hardware = “Ubiquiti AirGrid M5” || %devices.hardware = “Ubiquiti PowerBeam M5” || %devices.hardware = “Ubiquiti AirGrid M2” || %devices.os ~ “Engenius” &&

Your idea of 172.16.[1-9].@ is exactly what I need but its not working.

I think grouping with ipv4_addresses.ipv4_address is not working for some reason’s maybe me :blush: and I need It urgently!.

jc

this how it shows in the Database. I guess just matter figuring out the right query for groups.

I think it should work with " ipv4_addresess.ipv4-address " but in the real world for some reason is not working with grouping devices. I do not have a lot of experience with MariaDB but 172.16.[1-9].@ is what I need and should do the job but it’s not

try this image

hey sorry, I was on launch break :

devices.ip is a binary field I think, I will try but not sure that will do the job

thanks you
JC

you are right im just trying to find something that would work. :frowning:

lol yeah I understand I really appreciated your help, will figure out I’m sure something is no done right. I did a query to the DB just to make sure those fields are there and yes they are there, don’t get it


1 Like

Hey:

I’m not sure if we can filter that Field (ipv4_address )
I tried :slight_smile:
MariaDB [librenms]> SELECT ipv4_address FROM ipv4_addresses WHERE ipv4_address=“172.16.0.4”;

±-------------+
| ipv4_address |
±-------------+
| 172.16.0.4 |
±-------------+
1 row in set (0.00 sec)

Now the % is used as the “everything” wildcard, so if we query:slight_smile:

$ MariaDB [librenms]> SELECT ipv4_address FROM ipv4_addresses WHERE ipv4_address=“172.16.0.%”;

Should the filter output all the devices on that net?

well the output is : Empty set (0.00 sec)

So not sure we can filter that TYPE OF VALUE= varchar(32) , I was thinking IP addresses should be store as INT UNSIGNED or converted to 


jc

This works for me:

1 Like

can you please write for me the last Pattern and value I want to try it?

regards and thank you
JC

Not working here :frowning:

thank you
JC

Going to run ./validate maybe something is wrong with Maria


jc

Saying not working but not showing what you’ve tried doesn’t help.

If you look at the post you will see that I did say it lol, I asked you to explain your rule but looking at it I realized your rule may list all the devices on 192.168.5.X right?

here :
rule

output : (no results)

real :

real rule

the rule is not grouping those devices, the closer I got was with this rule :

but still listing devices that I don’t need like 172.16.0.X or 172.16.10.X or 172.20.X.X y only need to list in that group this addresses 172.16.1-9.X-254 .

regards and thanks
JC

The first, out of curiosity you’ve not resaved the rule have you. The webui doesn’t support this type of detail right now so once you’ve created it you can’t edit it.

For the second example this is because you only have one single full stop . before the *. It needs to be \..*

Use mysql to do the same testing:

MariaDB [librenms]> select '172.16.5.1' REGEXP '172\.16\.5[0-1]\..*';
+-------------------------------------------+
| '172.16.5.1' REGEXP '172\.16\.5[0-1]\..*' |
+-------------------------------------------+
|                                         0 |
+-------------------------------------------+
1 row in set (0.00 sec)

MariaDB [librenms]> select '172.16.50.1' REGEXP '172\.16\.5[0-1]\..*';
+--------------------------------------------+
| '172.16.50.1' REGEXP '172\.16\.5[0-1]\..*' |
+--------------------------------------------+
|                                          1 |
+--------------------------------------------+

I have been creating new rules and removing the old one just to be sure, so Not I do not resave any rule.
I did try your rules with .* and with 
*

rule with .* = list devices that I don’t need like 172.16.0.X or 172.16.10.X or 172.20.X.X y only need to list in that group this addresses 172.16.1-9.X-254

Same rule but with 
* = list NO RESULTS.

Here is an example using REGEXP


MariaDB [librenms]> Select ipv4_address from ipv4_addresses where ipv4_address REGEXP ‘^172.[1-9]
*’;



±--------------+
| ipv4_address |
±--------------+
| 172.16.0. |
| 172.16.10. |
| 172.20.11. |
| 172.20.21. |
| 172.20.31. |
| 172.20.41. |
| 172.17.13. |
| 172.17.17. |
| 172.20.11. |
| 172.20.11. |
| 172.16.1. |
| 172.20.31. |
| 172.20.11. |
| 172.20.31. |
| 172.20.31. |
| 172.16.11. |
| 172.20.1. |
| 172.16.0. |
| 172.17.0. |
| 172.20.31. |
| 172.20.31. |
| 172.20.31. |
| 172.20.31. |
| 172.16.10. |
| 172.16.7. |
| 172.20.41. |
| 172.16.10. |
| 172.20.41. |
| 172.16.9. |
| 172.16.10. |
| 172.20.41. |
| 172.16.10. |
| 172.20.21. |
| 172.16.10. |
| 172.20.21. |
| 172.16.6. |
| 172.20.6. |
| 172.20.21. |
| 172.20.21. |
| 172.20.21. |
| 172.16.8. |
| 172.17.8. |
| 172.20.21. |
| 172.20.21. |
| 172.20.21. |
| 172.16.4. |
| 172.20.31. |
| 172.20.11. |
| 172.17.14. |
| 172.20.21. |
| 172.16.0. |
| 172.20.11. |
| 172.16.10. |
| 172.16.2. |
| 172.17.2. |
| 172.20.31. |
| 172.16.5. |
| 172.20.21. |
| 172.16.10. |
| 172.20.41. |
| 172.21.11. |
| 172.20.41. |
| 172.20.31. |
| 172.20.31. |
| 172.20.31. |
| 172.18.1. |
| 172.21.11. |
| 172.16.3. |
| 172.20.11. |
| 172.16.254. |
| 172.20.21. |
| 172.20.21. |
| 172.20.21. |
| 172.16.0. |
| 172.16.0. |
| 172.20.31. |
| 172.16.9. |
| 172.16.9. |
| 172.16.9. |
| 172.16.2. |
| 172.16.2. |
| 172.16.9. |
| 172.16.2. |
| 172.16.7. |
| 172.16.7. |
| 172.16.11.|
| 172.16.7. |
| 172.16.7. |
| 172.16.1. |
| 172.16.7. |
| 172.16.1. |
| 172.16.1. |
| 172.16.8. |
| 172.16.4. |
| 172.16.4. |
| 172.16.5. |
| 172.16.9. |
| 172.16.3. |
| 172.16.6. |
| 172.16.6. |
| 172.16.11.|
±--------------+
Still listing devices I don’t want in that group.

regards and thank you.
JC

This is just a thought, I suspect it’s doing that because those devices have those IP’s attached to them either by association or VLAN or port.

Why not group the devices by name or location?