Ad Widget

Collapse

I can not create a duplicate discovery rule with extra filter

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • frater
    Senior Member
    • Oct 2010
    • 340

    #1

    I can not create a duplicate discovery rule with extra filter

    I'm using net.if.discovery to discover my interfaces.
    This will give me all the interfaces of my device, which is good.

    I now want to create a discovery for physical interfaces, because I would like to make an item for Ethernet Speed.
    I do not want this info for the VLANS as they would be the same as the physical interface.

    So I cloned my discovery rule with net.if.discovery I added a filter which removes the interfaces with an embedded dot, renamed the description...
    And then I found out I can't save it, because I already used net.if.discovery

    Click image for larger version  Name:	image.png Views:	0 Size:	5.9 KB ID:	462268

    What is the most elegant way to solve this?
    Zabbix agents on Linux, FreeBSD, Windows, AVM-Fritz!box, DD-WRT and QNAP
  • frater
    Senior Member
    • Oct 2010
    • 340

    #2
    I think I found the answer here...

    https://www.zabbix.com/forum/zabbix-...iscovery-items

    It was a bit unexpected that I needed to define the alias on the agent

    Alias=physif_discovery:net.if.discovery

    Click image for larger version  Name:	image.png Views:	1 Size:	7.1 KB ID:	462272


    Click image for larger version  Name:	image.png Views:	1 Size:	18.4 KB ID:	462271


    The most important item was this one


    Click image for larger version

Name:	image.png
Views:	174
Size:	12.7 KB
ID:	462273



    Alias=physif_discovery:net.if.discovery
    UserParameter=net.if.info[*], ifconfig $1 | grep -i $2 | grep -o ':.*' | cut -b3-​





    Last edited by frater; 31-03-2023, 21:39.
    Zabbix agents on Linux, FreeBSD, Windows, AVM-Fritz!box, DD-WRT and QNAP

    Comment

    • cyber
      Senior Member
      Zabbix Certified SpecialistZabbix Certified Professional
      • Dec 2006
      • 4807

      #3
      you can also do
      Code:
      Alias=net.if.discovery[*]:net.if.discovery​
      and add somekind of description in item config to each of them, making sure they are unique.... net.if.discovery[ifs], net.if.disovery[physical] etc.

      But you should also be able to use overrides for creating all at once and ignore what you don't need there.. create some items/trigger for one type and not for others etc..

      and using $1, $2 etc in item (and prototype) names has been deprecated for a long time...


      Comment

      Working...