Ad Widget

Collapse

Low level discovery - anyone doing anything interesting beyond the basics?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • gnuday
    Junior Member
    • Feb 2013
    • 1

    #16
    Interface and interface description in graph title?

    ericgearhart or any other expert out there,

    Can you elaborate on how you did:

    "Right now, as yet another hacky thing I have a LLD item that uses "{#SNMPINDEX} - {#SNMPVALUE}" and ifName as its base discovery item.

    Then the items in Zabbix in my 'graphs' tab show up like this:

    1 - Gig1/1
    1 - Sample Interface Description #1
    2 - Gig1/2
    2 - Sample Interface Description #2
    3 - Gig1/3
    3 - Sample Interface Description #3
    "

    I'm a zabbix noob. I've already set up 100's of interfaces but really need the interface description as well as interface name on my graphs.

    Many thanks.

    Regards,
    gnuday

    Comment

    • ke_sheng_jie
      Member
      • Aug 2011
      • 40

      #17
      Perfomance Counters

      Originally posted by thiagomz
      I am trying find the better way to monitor disk i/o stats with zabbix 2 and LLD.... any tip ?
      You can use performance counters with LLD for Windows disk I/O.

      Comment

      • ke_sheng_jie
        Member
        • Aug 2011
        • 40

        #18
        Originally posted by gnuday
        ericgearhart or any other expert out there,

        Can you elaborate on how you did:

        "Right now, as yet another hacky thing I have a LLD item that uses "{#SNMPINDEX} - {#SNMPVALUE}" and ifName as its base discovery item.

        Then the items in Zabbix in my 'graphs' tab show up like this:

        1 - Gig1/1
        1 - Sample Interface Description #1
        2 - Gig1/2
        2 - Sample Interface Description #2
        3 - Gig1/3
        3 - Sample Interface Description #3
        "

        I'm a zabbix noob. I've already set up 100's of interfaces but really need the interface description as well as interface name on my graphs.

        Many thanks.

        Regards,
        gnuday
        Basically, it sounds like he has created two graph prototypes for each interface (one for {#SNMPINDEX} and one for the{#SNMPVALUE}) and uses ifName as the LLD item.

        Ultimately, the ability to show item values in graph names will fix this. It appears this will be available in Zabbix 2.1.0.

        Comment

        • gogull
          Junior Member
          • May 2013
          • 1

          #19
          ifAlias in the graph title

          Originally posted by ericgearhart
          I even have the ifAlias (interface description defined in the switch) getting automatically added to the graph title
          Hi

          I'm trying to do exactly this thing.
          Can you tell me how did you did it?

          Comment

          • igloo_kem
            Junior Member
            • Oct 2012
            • 19

            #20
            Hi!
            For me it's interesting to!

            Comment

            • fernando360
              Junior Member
              • Mar 2014
              • 4

              #21
              About filter

              @Netopier
              How you fill the filter at discovery interface item?

              I see you use a macro, but didn´t figure out how fill the filter form at xml template ou gui interface.
              Please copy here like
              Code:
              <discovery_rules>
                              <discovery_rule>
                                  <name>Interfaces</name>
                                  <type>4</type>
                                  <snmp_community>{$SNMP_COMMUNITY}</snmp_community>
                                  <snmp_oid>ifDescr</snmp_oid>
                                  <key>snmp.discovery.rede2</key>
                                  <delay>14400</delay>
                                  <status>0</status>
                                  <allowed_hosts/>
                                  <snmpv3_contextname/>
                                  <snmpv3_securityname/>
                                  <snmpv3_securitylevel>0</snmpv3_securitylevel>
                                  <snmpv3_authprotocol>0</snmpv3_authprotocol>
                                  <snmpv3_authpassphrase/>
                                  <snmpv3_privprotocol>0</snmpv3_privprotocol>
                                  <snmpv3_privpassphrase/>
                                  <delay_flex/>
                                  <params/>
                                  <ipmi_sensor/>
                                  <authtype>0</authtype>
                                  <username/>
                                  <password/>
                                  <publickey/>
                                  <privatekey/>
                                  <port>161</port>
                                  <filter>{#SNMPVALUE}:(-Null|-dwdm|-aal5|-Loopback|-Mgmt|Vlan|Tunnel|Port-channel|TenGigE|GigabitEthernet|Po|BE|Bundle-Ether|bundle-ether)</filter>
                                  <lifetime>10</lifetime>
                                  <description/>
                                  <item_prototypes> ......
              Thanks

              Comment

              • netopier
                Junior Member
                • Mar 2012
                • 16

                #22
                Hello, my discovery rule was llike this. But i figure out my first problem by using external perl script. I will explain in other post.

                Code:
                 <discovery_rule>
                                    <name>SNMP: Discover Interfaces Traffic</name>
                                    <type>4</type>
                                    <snmp_community>##########</snmp_community>
                                    <snmp_oid>1.3.6.1.2.1.31.1.1.1.18</snmp_oid>
                                    <key>snmp.discover.interfaces</key>
                                    <delay>3600</delay>
                                    <status>0</status>
                                    <allowed_hosts/>
                                    <snmpv3_contextname/>
                                    <snmpv3_securityname/>
                                    <snmpv3_securitylevel>0</snmpv3_securitylevel>
                                    <snmpv3_authprotocol>0</snmpv3_authprotocol>
                                    <snmpv3_authpassphrase/>
                                    <snmpv3_privprotocol>0</snmpv3_privprotocol>
                                    <snmpv3_privpassphrase/>
                                    <delay_flex/>
                                    <params/>
                                    <ipmi_sensor/>
                                    <authtype>0</authtype>
                                    <username/>
                                    <password/>
                                    <publickey/>
                                    <privatekey/>
                                    <port/>
                                    <filter>{#SNMPVALUE}:^(.*;.*;M.*;.*;.*;.*)$</filter>
                                    <lifetime>7</lifetime>
                                    <description/>
                                    <item_prototypes>
                                        <item_prototype>
                                            <name>Check: Inetrface Speed {#SNMPINDEX} - {#SNMPVALUE}</name>
                                            <type>4</type>
                                            <snmp_community>#########</snmp_community>
                                            <multiplier>0</multiplier>
                                            <snmp_oid>1.3.6.1.2.1.2.2.1.5.{#SNMPINDEX}</snmp_oid>
                                            <key>ifSpeed.[{#SNMPINDEX}]</key>
                                            <delay>3600</delay>

                Comment

                • netopier
                  Junior Member
                  • Mar 2012
                  • 16

                  #23
                  Hello. As I wrote before, I solved my problem by using external script.

                  Problem description:
                  I want use SNMP LowLevelDiscovery feature, but dont want to monitor all 30k interfaces in our network, but only important (uplink) interfaces.

                  The problem is, that only way, how you can tell to the discovery process that you want monitor only uplinks is using discovery trought SNMP ifAlias (which is interface description in Cisco) and match some regexp.

                  Regexp for me is: ^(.*;.*;M.*;.*;.*;.*)$

                  So I was able discover interfaces which match this regexp, but I was unable to put normal human readable interface name like "GigabitEthernet X/Y" or Gi X/Y" (which are stored in ifName snmp OID) to item/trigger/graphs in same discovery. Zabbix simply dont make it possible by GUI functions.

                  I solved this by using external script, which is called by zabbix snmp interface LLD job. The output of this script is in JSON format.

                  This is just example, not final version of script.
                  Code:
                  #!/usr/bin/perl
                  
                  
                  my $hostname = $ARGV[0];
                  #my $snmpcommunity = $ARGV[1];
                  #my $snmpversion = $ARGV[2];
                  
                  my $snmpcommunity = "#########";
                  my $snmpversion = "2c";
                  
                  my %snmp;
                  
                  
                  sub get_snmp_value
                  {
                      my $snmp_val = shift;
                  
                          open(F, "/usr/bin/snmpbulkwalk -v $snmpversion -c $snmpcommunity $hostname -Osq $snmp_val |") || die;
                          while(<F>) {
                              /\.(\d+)\s+(.*)$/;
                              $snmp{$1}{$snmp_val} = $2;
                          }
                      close(F);
                  }
                  
                  get_snmp_value('ifDescr');
                  get_snmp_value('ifAlias');
                  
                  print "{\n";
                  print "\t\"data\":[\n\n";
                  
                  my $f;
                  
                  for my $k (keys %snmp) {
                      if ($snmp{$k}{'ifAlias'} =~ /^.*;.*;M.*;.*.;.*;.*$/) {
                          print ",\n" if $f;
                          print "\t{\n";
                          print "\t\t\"{#SNMPJSONINDEX}\":\"$k\",\n";
                          print "\t\t\"{#SNMPJSONDESCR}\":\"$snmp{$k}{'ifDescr'}\"\n";
                          print "\t}";
                          $f = 1;
                      }
                  
                  }
                  
                  
                  print "\n\t]\n";
                  print "}\n";

                  So this script simply walk trought device and print out only interfaces which match regexp /^.*;.*;M.*;.*.;.*;.*$/ in ifAlias value.

                  Zabbix will take this output and create items/triggers/graphs with proper interface names.

                  The output of this script looks like:
                  Code:
                  root@XXXXX:/usr/lib/zabbix/externalscripts# ./snmpbulkwalk.pl switchname
                  {
                  	"data":[
                  
                  	{
                  		"{#SNMPJSONINDEX}":"57",
                  		"{#SNMPJSONDESCR}":"Port-channel1"
                  	},
                  	{
                  		"{#SNMPJSONINDEX}":"49",
                  		"{#SNMPJSONDESCR}":"GigabitEthernet1/48"
                  	},
                  	{
                  		"{#SNMPJSONINDEX}":"48",
                  		"{#SNMPJSONDESCR}":"GigabitEthernet1/47"
                  	}
                  	]
                  }
                  root@XXXXX:/usr/lib/zabbix/externalscripts#
                  My discovery rule looks like this. It will check duplex of interface, it will check errors on interface and create traffic/errors graps.


                  Code:
                  <?xml version="1.0" encoding="UTF-8"?>
                  <zabbix_export>
                      <version>2.0</version>
                      <date>2014-03-18T10:28:11Z</date>
                      <groups>
                          <group>
                              <name>Templates</name>
                          </group>
                      </groups>
                      <templates>
                          <template>
                              <template>Template SNMP Discover Interfaces JSON</template>
                              <name>Template SNMP Discover Interfaces JSON</name>
                              <groups>
                                  <group>
                                      <name>Templates</name>
                                  </group>
                              </groups>
                              <applications/>
                              <items/>
                              <discovery_rules>
                                  <discovery_rule>
                                      <name>SNMP Interfaces Discovery External</name>
                                      <type>10</type>
                                      <snmp_community/>
                                      <snmp_oid/>
                                      <key>snmpbulkwalk.pl[{HOST.HOST}]</key>
                                      <delay>3600</delay>
                                      <status>0</status>
                                      <allowed_hosts/>
                                      <snmpv3_contextname/>
                                      <snmpv3_securityname/>
                                      <snmpv3_securitylevel>0</snmpv3_securitylevel>
                                      <snmpv3_authprotocol>0</snmpv3_authprotocol>
                                      <snmpv3_authpassphrase/>
                                      <snmpv3_privprotocol>0</snmpv3_privprotocol>
                                      <snmpv3_privpassphrase/>
                                      <delay_flex/>
                                      <params/>
                                      <ipmi_sensor/>
                                      <authtype>0</authtype>
                                      <username/>
                                      <password/>
                                      <publickey/>
                                      <privatekey/>
                                      <port/>
                                      <filter>:</filter>
                                      <lifetime>3</lifetime>
                                      <description/>
                                      <item_prototypes>
                                          <item_prototype>
                                              <name>Check: Inetrface Duplex - {#SNMPJSONDESCR}</name>
                                              <type>4</type>
                                              <snmp_community>#####</snmp_community>
                                              <multiplier>0</multiplier>
                                              <snmp_oid>.1.3.6.1.2.1.10.7.2.1.19.{#SNMPJSONINDEX}</snmp_oid>
                                              <key>dot3StatsDuplexStatus.[{#SNMPJSONINDEX}]</key>
                                              <delay>3600</delay>
                                              <history>90</history>
                                              <trends>365</trends>
                                              <status>0</status>
                                              <value_type>3</value_type>
                                              <allowed_hosts/>
                                              <units>Duplex</units>
                                              <delta>0</delta>
                                              <snmpv3_contextname/>
                                              <snmpv3_securityname/>
                                              <snmpv3_securitylevel>0</snmpv3_securitylevel>
                                              <snmpv3_authprotocol>0</snmpv3_authprotocol>
                                              <snmpv3_authpassphrase/>
                                              <snmpv3_privprotocol>0</snmpv3_privprotocol>
                                              <snmpv3_privpassphrase/>
                                              <formula>1</formula>
                                              <delay_flex/>
                                              <params/>
                                              <ipmi_sensor/>
                                              <data_type>0</data_type>
                                              <authtype>0</authtype>
                                              <username/>
                                              <password/>
                                              <publickey/>
                                              <privatekey/>
                                              <port/>
                                              <description/>
                                              <inventory_link>0</inventory_link>
                                              <applications/>
                                              <valuemap>
                                                  <name>dot3StatsDuplexStatus</name>
                                              </valuemap>
                                          </item_prototype>
                                          <item_prototype>
                                              <name>Check: Inetrface Speed - {#SNMPJSONDESCR}</name>
                                              <type>4</type>
                                              <snmp_community>#####</snmp_community>
                                              <multiplier>0</multiplier>
                                              <snmp_oid>.1.3.6.1.2.1.2.2.1.5.{#SNMPJSONINDEX}</snmp_oid>
                                              <key>IifSpeed.[{#SNMPJSONINDEX}]</key>
                                              <delay>3600</delay>
                                              <history>90</history>
                                              <trends>365</trends>
                                              <status>0</status>
                                              <value_type>3</value_type>
                                              <allowed_hosts/>
                                              <units>Mbits</units>
                                              <delta>0</delta>
                                              <snmpv3_contextname/>
                                              <snmpv3_securityname/>
                                              <snmpv3_securitylevel>0</snmpv3_securitylevel>
                                              <snmpv3_authprotocol>0</snmpv3_authprotocol>
                                              <snmpv3_authpassphrase/>
                                              <snmpv3_privprotocol>0</snmpv3_privprotocol>
                                              <snmpv3_privpassphrase/>
                                              <formula>1</formula>
                                              <delay_flex/>
                                              <params/>
                                              <ipmi_sensor/>
                                              <data_type>0</data_type>
                                              <authtype>0</authtype>
                                              <username/>
                                              <password/>
                                              <publickey/>
                                              <privatekey/>
                                              <port/>
                                              <description/>
                                              <inventory_link>0</inventory_link>
                                              <applications/>
                                              <valuemap/>
                                          </item_prototype>
                                          <item_prototype>
                                              <name>Check: Inetrface Status - {#SNMPJSONDESCR}</name>
                                              <type>4</type>
                                              <snmp_community>#####</snmp_community>
                                              <multiplier>0</multiplier>
                                              <snmp_oid>.1.3.6.1.2.1.2.2.1.8.{#SNMPJSONINDEX}</snmp_oid>
                                              <key>IfOperStatus.[{#SNMPJSONINDEX}]</key>
                                              <delay>300</delay>
                                              <history>90</history>
                                              <trends>365</trends>
                                              <status>0</status>
                                              <value_type>3</value_type>
                                              <allowed_hosts/>
                                              <units/>
                                              <delta>0</delta>
                                              <snmpv3_contextname/>
                                              <snmpv3_securityname/>
                                              <snmpv3_securitylevel>0</snmpv3_securitylevel>
                                              <snmpv3_authprotocol>0</snmpv3_authprotocol>
                                              <snmpv3_authpassphrase/>
                                              <snmpv3_privprotocol>0</snmpv3_privprotocol>
                                              <snmpv3_privpassphrase/>
                                              <formula>1</formula>
                                              <delay_flex/>
                                              <params/>
                                              <ipmi_sensor/>
                                              <data_type>0</data_type>
                                              <authtype>0</authtype>
                                              <username/>
                                              <password/>
                                              <publickey/>
                                              <privatekey/>
                                              <port/>
                                              <description/>
                                              <inventory_link>0</inventory_link>
                                              <applications/>
                                              <valuemap/>
                                          </item_prototype>
                                          <item_prototype>
                                              <name>Usage: Interface Errors IN - {#SNMPJSONDESCR}</name>
                                              <type>4</type>
                                              <snmp_community>#####</snmp_community>
                                              <multiplier>1</multiplier>
                                              <snmp_oid>.1.3.6.1.2.1.2.2.1.14.{#SNMPJSONINDEX}</snmp_oid>
                                              <key>IfInErrors.[{#SNMPJSONINDEX}]</key>
                                              <delay>300</delay>
                                              <history>90</history>
                                              <trends>365</trends>
                                              <status>0</status>
                                              <value_type>3</value_type>
                                              <allowed_hosts/>
                                              <units>E/sec</units>
                                              <delta>1</delta>
                                              <snmpv3_contextname/>
                                              <snmpv3_securityname/>
                                              <snmpv3_securitylevel>0</snmpv3_securitylevel>
                                              <snmpv3_authprotocol>0</snmpv3_authprotocol>
                                              <snmpv3_authpassphrase/>
                                              <snmpv3_privprotocol>0</snmpv3_privprotocol>
                                              <snmpv3_privpassphrase/>
                                              <formula>8</formula>
                                              <delay_flex/>
                                              <params/>
                                              <ipmi_sensor/>
                                              <data_type>0</data_type>
                                              <authtype>0</authtype>
                                              <username/>
                                              <password/>
                                              <publickey/>
                                              <privatekey/>
                                              <port/>
                                              <description/>
                                              <inventory_link>0</inventory_link>
                                              <applications/>
                                              <valuemap/>
                                          </item_prototype>
                                          <item_prototype>
                                              <name>Usage: Interface Errors OUT - {#SNMPJSONDESCR}</name>
                                              <type>4</type>
                                              <snmp_community>#####</snmp_community>
                                              <multiplier>1</multiplier>
                                              <snmp_oid>.1.3.6.1.2.1.2.2.1.20.{#SNMPJSONINDEX}</snmp_oid>
                                              <key>IfOutErrors.[{#SNMPJSONINDEX}]</key>
                                              <delay>300</delay>
                                              <history>90</history>
                                              <trends>365</trends>
                                              <status>0</status>
                                              <value_type>3</value_type>
                                              <allowed_hosts/>
                                              <units>E/sec</units>
                                              <delta>1</delta>
                                              <snmpv3_contextname/>
                                              <snmpv3_securityname/>
                                              <snmpv3_securitylevel>0</snmpv3_securitylevel>
                                              <snmpv3_authprotocol>0</snmpv3_authprotocol>
                                              <snmpv3_authpassphrase/>
                                              <snmpv3_privprotocol>0</snmpv3_privprotocol>
                                              <snmpv3_privpassphrase/>
                                              <formula>8</formula>
                                              <delay_flex/>
                                              <params/>
                                              <ipmi_sensor/>
                                              <data_type>0</data_type>
                                              <authtype>0</authtype>
                                              <username/>
                                              <password/>
                                              <publickey/>
                                              <privatekey/>
                                              <port/>
                                              <description/>
                                              <inventory_link>0</inventory_link>
                                              <applications/>
                                              <valuemap/>
                                          </item_prototype>
                                          <item_prototype>
                                              <name>Usage: Interface Traffic IN - {#SNMPJSONDESCR}</name>
                                              <type>4</type>
                                              <snmp_community>#####</snmp_community>
                                              <multiplier>1</multiplier>
                                              <snmp_oid>.1.3.6.1.2.1.31.1.1.1.6.{#SNMPJSONINDEX}</snmp_oid>
                                              <key>IfHCInOctets.[{#SNMPJSONINDEX}]</key>
                                              <delay>60</delay>
                                              <history>90</history>
                                              <trends>365</trends>
                                              <status>0</status>
                                              <value_type>3</value_type>
                                              <allowed_hosts/>
                                              <units>bps</units>
                                              <delta>1</delta>
                                              <snmpv3_contextname/>
                                              <snmpv3_securityname/>
                                              <snmpv3_securitylevel>0</snmpv3_securitylevel>
                                              <snmpv3_authprotocol>0</snmpv3_authprotocol>
                                              <snmpv3_authpassphrase/>
                                              <snmpv3_privprotocol>0</snmpv3_privprotocol>
                                              <snmpv3_privpassphrase/>
                                              <formula>8</formula>
                                              <delay_flex/>
                                              <params/>
                                              <ipmi_sensor/>
                                              <data_type>0</data_type>
                                              <authtype>0</authtype>
                                              <username/>
                                              <password/>
                                              <publickey/>
                                              <privatekey/>
                                              <port/>
                                              <description/>
                                              <inventory_link>0</inventory_link>
                                              <applications/>
                                              <valuemap/>
                                          </item_prototype>
                                          <item_prototype>
                                              <name>Usage: Interface Traffic OUT - {#SNMPJSONDESCR}</name>
                                              <type>4</type>
                                              <snmp_community>#####</snmp_community>
                                              <multiplier>1</multiplier>
                                              <snmp_oid>.1.3.6.1.2.1.31.1.1.1.10.{#SNMPJSONINDEX}</snmp_oid>
                                              <key>IfHCOutOctets.[{#SNMPJSONINDEX}]</key>
                                              <delay>60</delay>
                                              <history>90</history>
                                              <trends>365</trends>
                                              <status>0</status>
                                              <value_type>3</value_type>
                                              <allowed_hosts/>
                                              <units>bps</units>
                                              <delta>1</delta>
                                              <snmpv3_contextname/>
                                              <snmpv3_securityname/>
                                              <snmpv3_securitylevel>0</snmpv3_securitylevel>
                                              <snmpv3_authprotocol>0</snmpv3_authprotocol>
                                              <snmpv3_authpassphrase/>
                                              <snmpv3_privprotocol>0</snmpv3_privprotocol>
                                              <snmpv3_privpassphrase/>
                                              <formula>8</formula>
                                              <delay_flex/>
                                              <params/>
                                              <ipmi_sensor/>
                                              <data_type>0</data_type>
                                              <authtype>0</authtype>
                                              <username/>
                                              <password/>
                                              <publickey/>
                                              <privatekey/>
                                              <port/>
                                              <description/>
                                              <inventory_link>0</inventory_link>
                                              <applications/>
                                              <valuemap/>
                                          </item_prototype>
                                      </item_prototypes>
                                      <trigger_prototypes>
                                          <trigger_prototype>
                                              <expression>{Template SNMP Discover Interfaces JSON:dot3StatsDuplexStatus.[{#SNMPJSONINDEX}].last(0)}#3</expression>
                                              <name>Check: Inetrface Duplex {#SNMPJSONDESCR}</name>
                                              <url/>
                                              <status>0</status>
                                              <priority>2</priority>
                                              <description/>
                                              <type>0</type>
                                          </trigger_prototype>
                                          <trigger_prototype>
                                              <expression>{Template SNMP Discover Interfaces JSON:IfInErrors.[{#SNMPJSONINDEX}].last(0)}&gt;2 | {Template SNMP Discover Interfaces JSON:IfOutErrors.[{#SNMPJSONINDEX}].last(0)}&gt;2</expression>
                                              <name>Usage: Interface Errors - {#SNMPJSONDESCR}</name>
                                              <url/>
                                              <status>0</status>
                                              <priority>2</priority>
                                              <description/>
                                              <type>0</type>
                                          </trigger_prototype>
                                      </trigger_prototypes>
                                      <graph_prototypes>
                                          <graph_prototype>
                                              <name>Usage: Interface Errors - {#SNMPJSONDESCR}</name>
                                              <width>900</width>
                                              <height>200</height>
                                              <yaxismin>0.0000</yaxismin>
                                              <yaxismax>100.0000</yaxismax>
                                              <show_work_period>1</show_work_period>
                                              <show_triggers>1</show_triggers>
                                              <type>0</type>
                                              <show_legend>1</show_legend>
                                              <show_3d>0</show_3d>
                                              <percent_left>0.0000</percent_left>
                                              <percent_right>0.0000</percent_right>
                                              <ymin_type_1>1</ymin_type_1>
                                              <ymax_type_1>0</ymax_type_1>
                                              <ymin_item_1>0</ymin_item_1>
                                              <ymax_item_1>0</ymax_item_1>
                                              <graph_items>
                                                  <graph_item>
                                                      <sortorder>0</sortorder>
                                                      <drawtype>5</drawtype>
                                                      <color>DD0000</color>
                                                      <yaxisside>0</yaxisside>
                                                      <calc_fnc>2</calc_fnc>
                                                      <type>0</type>
                                                      <item>
                                                          <host>Template SNMP Discover Interfaces JSON</host>
                                                          <key>IfInErrors.[{#SNMPJSONINDEX}]</key>
                                                      </item>
                                                  </graph_item>
                                                  <graph_item>
                                                      <sortorder>1</sortorder>
                                                      <drawtype>5</drawtype>
                                                      <color>0000BB</color>
                                                      <yaxisside>0</yaxisside>
                                                      <calc_fnc>2</calc_fnc>
                                                      <type>0</type>
                                                      <item>
                                                          <host>Template SNMP Discover Interfaces JSON</host>
                                                          <key>IfOutErrors.[{#SNMPJSONINDEX}]</key>
                                                      </item>
                                                  </graph_item>
                                              </graph_items>
                                          </graph_prototype>
                                          <graph_prototype>
                                              <name>Usage: Interface Traffic - {#SNMPJSONDESCR}</name>
                                              <width>900</width>
                                              <height>200</height>
                                              <yaxismin>0.0000</yaxismin>
                                              <yaxismax>100.0000</yaxismax>
                                              <show_work_period>1</show_work_period>
                                              <show_triggers>1</show_triggers>
                                              <type>0</type>
                                              <show_legend>1</show_legend>
                                              <show_3d>0</show_3d>
                                              <percent_left>0.0000</percent_left>
                                              <percent_right>0.0000</percent_right>
                                              <ymin_type_1>1</ymin_type_1>
                                              <ymax_type_1>0</ymax_type_1>
                                              <ymin_item_1>0</ymin_item_1>
                                              <ymax_item_1>0</ymax_item_1>
                                              <graph_items>
                                                  <graph_item>
                                                      <sortorder>0</sortorder>
                                                      <drawtype>5</drawtype>
                                                      <color>00CC00</color>
                                                      <yaxisside>0</yaxisside>
                                                      <calc_fnc>4</calc_fnc>
                                                      <type>0</type>
                                                      <item>
                                                          <host>Template SNMP Discover Interfaces JSON</host>
                                                          <key>IfHCInOctets.[{#SNMPJSONINDEX}]</key>
                                                      </item>
                                                  </graph_item>
                                                  <graph_item>
                                                      <sortorder>1</sortorder>
                                                      <drawtype>5</drawtype>
                                                      <color>0000DD</color>
                                                      <yaxisside>0</yaxisside>
                                                      <calc_fnc>4</calc_fnc>
                                                      <type>0</type>
                                                      <item>
                                                          <host>Template SNMP Discover Interfaces JSON</host>
                                                          <key>IfHCOutOctets.[{#SNMPJSONINDEX}]</key>
                                                      </item>
                                                  </graph_item>
                                              </graph_items>
                                          </graph_prototype>
                                      </graph_prototypes>
                                      <host_prototypes/>
                                  </discovery_rule>
                              </discovery_rules>
                              <macros/>
                              <templates/>
                              <screens/>
                          </template>
                      </templates>
                  </zabbix_export>
                  Last edited by netopier; 18-03-2014, 12:43.

                  Comment

                  • fernando360
                    Junior Member
                    • Mar 2014
                    • 4

                    #24
                    Thanks

                    Thanks a lot!

                    I found some new features from 2.2.x so i made a workaround without external scripts because i didn´t read your last post.
                    But when i get a new server with more resources i will follow your tips.

                    I configure some regular expression item (Admin>General>Regular Expression) with some string to include from description, that i call Decription_IP, mentioned like @Description_IP at discovery rule´s filter. In all my routers i configure this string that i wish to monitor like you also did.

                    Because the ifIndex isn´t my SNMPINDEX, in this case is the interface description, i have to configure a item to check ifName and add to the interfaces trigger to match string "NEVER", that i never will use in descriptions, only to use the itemvalue at the trigger. With this value i can refer trigger names to the interface´s name (ex. Giga0/0) by using {ITEM.VALUE#} macro, {ITEM.VALUE4} in this case because is the 4th item in that trigger. This feature came alive from 2.2.0.


                    I will contribute my template to everybody too.
                    So feel free to use and contribute with improvements.

                    It was as simple as possible but your method can simplify even more.

                    Some strings are in portuguese and some checks are by hour due to my server resources limitation.


                    Remember to create a macro $SNMP_COMMUNITY with your snmp community and a regular expression "Description_IP" (Admin>General>Regular Expression) with strings that you wish to include, and also exclude to permit exceptions because you can add multiple conditions, use the tester to verify.
                    Attached Files
                    Last edited by fernando360; 24-03-2014, 15:43. Reason: Attach template

                    Comment

                    Working...