Ad Widget

Collapse

Create trigger for interfaces

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • dimebag
    Junior Member
    • Dec 2015
    • 8

    #1

    Create trigger for interfaces

    Hello all
    I was looking for a way to monitor server network interface so if for example the incoming traffic on eth0 become more than 10 megabyte per second i get alert
    I could not find what clearly should be done to add such a trigger
    Little guide is appreciated
    regards
  • Firm
    Senior Member
    • Dec 2009
    • 342

    #2
    Check standard Linux OS template. It has "network traffic" items that represents traffic speed in bits/sec. Create trigger with your condition. It will looks like:
    {host:net.if.in[eth0].last()}>80M

    Comment

    • dimebag
      Junior Member
      • Dec 2015
      • 8

      #3
      Thank you
      I end up using prototype triggers under pre defined Network interface discovery
      in linux template using following

      name : {#IFNAME} incoming traffic is {ITEM.LASTVALUE1}
      expression : {Template OS Linux:net.if.in[{#IFNAME}].last()}>4M

      Comment

      • vchrizz
        Junior Member
        • Jul 2017
        • 18

        #4
        based on this post Edit vfs.fs.size trigger NOT to go off for disk C: i created following workaround which might help in this case:

        using "Template OS Linux" ("Discovery rules" -> "Network interface discovery")

        "Item prototypes" -> Create item prototype
        Code:
        Name: Interface echo name {#IFNAME}
        Type: External check
        Key:  echo["{#FSNAME}"]
        Type of information: Text
        "Trigger prototypes" -> Create trigger prototype
        Code:
        Name: Over 10 MBit/s Incoming Traffic in last 5min on Interface {#IFNAME}
        Expression: {Template OS Linux:net.if.in[{#IFNAME}].last(5m)}>10M and {Template OS Linux:echo["{#IFNAME}"].regexp(^eth0$)}=1
        "Trigger prototypes" -> Create trigger prototype
        Code:
        Name: Over 10 MBit/s Outgoing Traffic in last 5min on Interface {#IFNAME}
        Expression: {Template OS Linux:net.if.out[{#IFNAME}].last(5m)}>10M and {Template OS Linux:echo["{#IFNAME}"].regexp(^eth0$)}=1
        have in mind that this creates triggers for *every* discovered interface, if you monitor devices with many interfaces, you might want to exclude unneeded interfaces from discovery in Administration->General->Regular expressions->Network interfaces for discovery

        tested on zabbix 3.2.7.

        Comment

        • vchrizz
          Junior Member
          • Jul 2017
          • 18

          #5
          as my previous approach created many items and triggers, and i didnt much like it, i changed that approach to following:

          add userparameter to zabbix-agent:
          Code:
          UserParameter=user.net.in,awk "/ eth0:/ {print \$2}" /proc/net/dev
          UserParameter=user.net.out,awk "/ eth0:/ {print \$10}" /proc/net/dev
          add items:
          Code:
          Name: User download traffic
          Type: Zabbix agent
          Key: user.net.in
          Type of information: Numeric (unsigned)
          Data type: Decimal
          Units: bps
          Use custom multiplier: 8
          Store value: Delta (speed per second)
          Code:
          Name: User upload traffic
          Type: Zabbix agent
          Key: user.net.out
          Type of information: Numeric (unsigned)
          Data type: Decimal
          Units: bps
          Use custom multiplier: 8
          Store value: Delta (speed per second)
          added triggers:
          Code:
          Name: User Download Traffic over 10 MBit/s in last 5min
          Severity: Information
          Expression: {Template OS Linux:user.net.in.last(5m)}>10M
          Code:
          Name: User Upload Traffic over 10 MBit/s in last 5min
          Severity: Information
          Expression: {Template OS Linux:user.net.out.last(5m)}>10M
          i also added triggers for higher bandwidth with dependencies.

          Comment

          Working...