Adding the ability to tag a device


#1

Hey folks,

When using the groups, sometimes I want to create really specific one that can’t be based on pattern/condition. So, a solution would be to be able to create custom groups based on a specified information.

One solution will be to add a new devices_tag table that will include some fields (device_tag_id, device_tag, device_description, device_id).

With this, groups can be constructs using the device_tag_id/device_tag information

Any idea/input?


#2

Sounds good and we have this request which would make use of it (https://github.com/librenms/librenms/issues/1047).

The reason we haven’t done this with device groups is that you can have 1 device belong to many groups, so if you set snmp credentials or location specific info for four devices, how do we know which one to use? Cycling through them is costly.

We have discussed in the past the ability to tag a device to a primary group (either a device group or a new tag system). Then you can define parameters on a group basis like setting snmp credentials, location information + lots more.

In general I think it’s a great idea but we need to flesh it out here.


#3

My thoughts was that we would have Groups and Dynamic Groups. Groups contain specific devices and will not change, Dynamic Groups could change every poll. There would be an option to convert a Dynamic Group to a static group (but not the other way around).

Would could definitely have the option to add groups from the device view, which is like tags. It would be possible to give the groups a precedence order, but it might be tricky to convey correctly tot he user that that determines settings.

FYI, This is very low on my todo list right now :frowning:


#4

I’m not sure to understand what’s the problem with this? Because It’s already possible to create groups that have non matching SNMP settings.

What I propose is to categorise devices with the tag without touching anything else. Folks can use or ignore this without impact on existing groups. Did I miss something?

It’s a great idea, but its need many changes.


#5

Nothing we have at the moment allows you to set snmp details other than directly against a single device. An example of what I mean.

You have three devices, two use the same snmp details the other doesn’t.

Those three devices belong to four groups, each group we have specified a different set of snmp credentials for (and for the sake of keeping things simple) the snmp credentials are removed for the specific devices.

Now when we poll, which credentials do we use for all these devices? The ones from the first group, last group, try them?


#6

Ok, thanks for the explanation. Can we go further with a basic tag support, or do you want to solve other aspects first?


#7

No one else is working on it so be our guest :slight_smile:


#8

Groups would need a priority, maybe not explicitly set, but set by ordering groups in the webui. V2 might be a good place for that…


#9

No sure that will be a part of a basic tag support for groups, but which kind of priority? A predefined popup like “High/Medium/High”, something like 1 to 10, a freeform box?


#10

No limit on the priority (int max). But I wouldn’t make the number specifically visible to the user. Just show them in list and make them draggable.


#11

I have been thinking about tags and did a search first - I was surprised to see this from 2016! :slight_smile:

Having a wholly separate tagging system would be very helpful for grouping disparate devices for alerts. This would allow me to create a group that was “production” that I could then assign my highest priority alerts (wake me up critical) and it could include all the devices that I would have to do a complicated group management role to create (only these servers with only those firewalls, this temp sensor and these two printers… and this thermos). A couple of thoughts:

  1. Allow selection non-contiguously in a list of devices to add lots of devices to a TAG
  2. Allow tagging when editing a device that suggests in the same manner as “This device depends on:”
  3. List tags in the overview screen - maybe under Uptime
  4. Allow TAGS to be a pattern for creating Device Groups
  5. Allow Alert Rules to Map To a TAG
  6. Allow Alert Rules to build against TAGS (i.e. Alert if TAG is .ne. “DevGru”)
  7. Maybe allow tags to be assigned to a Port (less useful for me)
  8. Allow Maintenance schedule to map to a TAG

In some cases I listed its like a TAG would become an alternate group, which would eliminate having to group things by TAG then creating a new Managed Group to work against in a Rule or Maint. Schedule.

Happy to test if someone gets excited about making the change.