Install Zabbix 5 and Monitor TrueNAS 12

Brezlord

Contributor
Joined
Jan 7, 2017
Messages
189
Hi all, a forum user asked me for some info on how I setup Zabbix to monitor TrueNAS 12 and I thought that it was best to start a new post as this would not be related to the original post that was about an SNMP bug. Mods feel free to move this post if it's not in the right location.

The easiest way to get Zabbix up and running is to download the Appliance here and for the installation instructions read the manual for Zabbix 5 appliance here.
Chose your method of install, i used the ISO and installed Zabbix in a VM hosted on XCP-ng (Xen Server). Once installed and initial setup is complete import the attached template. The template is linked to some generic templates that off memory are included in the default Zabbix install, if not let me know and I'll attache them to this post.

Once you have imported the template create a new host and add templates 'Template SNMP TrueNAS 12' & 'Template Module ICMP Ping' to the host set the IP address of the TrueNAS server and save the host config. Wait a few minutes for Zabbix to connect to TrueNAS and discover everything, SNMP will be green when Zabbix is connected to TrueNAS. To speed up things click on Discovery Rules and select all of them and then click on Execute Now.

You can remove the section that is for Zabbix Agent as you will only be using SNMP, see below.

Screenshot-20210116101005-1151x693.png


Screenshot-20210116100929-963x346.png


Screenshot-20210116104817-1873x596.png


You can test that Zabbix can read the OIDs from TrueNAS by using snmpwalk command from the Zabbix VM shell.
To check TrueNAS ARC allocation.

Code:
[root@zabbix ~]# snmpwalk -v 2c -c public 192.168.40.40 .1.3.6.1.4.1.50536.1.4.1.0
SNMPv2-SMI::enterprises.50536.1.4.1.0 = Gauge32: 114888105


You can see that there is 114.8GB of RAM allocated to ARC

To find the Zabbix Server version run the following from the shell.
zabbix_server --version

If you need to edit any of Zabbix server settings they are located in /etc/zabbix/zabbix_server.conf you can leave everything default for a home lab install.

If you need anything else just ask
 

Attachments

  • Template_SNMP_TrueNAS_12.zip
    5.6 KB · Views: 2,725

Blackraz0r

Cadet
Joined
Dec 15, 2020
Messages
3
Thank you for the detailed Instructions Mate. it is really helping me!
So with this solution i don't need to copy over the MIB to Zabbix VM?
 

jinu

Dabbler
Joined
Feb 11, 2021
Messages
15
Hi When i try to import the template, Zabbix throws the following error. Any idea how to fix this
  • Cannot import template "Template SNMP TrueNAS 12", linked templates "Template SNMP Generic, Template SNMP Interfaces, Template SNMP Processors" do not exist.

EDIT: Resolved the issue by downloading the missing templates from share.zabbix.com
 
Last edited:

Rajstopy

Dabbler
Joined
Dec 27, 2020
Messages
25
Hi!

Many thanks for this very useful tuto. Quite new to TrueNAS, I can now monitor my new NAS, even better than I was used to with my Syno :cool:

Cheers
 

d7volker

Cadet
Joined
Aug 31, 2020
Messages
3
Hi!

Thank you for this! Is there also a solution to fetch the alerts from TrueNAS? That would be really of help for us.

Best Regards
 

jpcapone

Dabbler
Joined
Feb 1, 2021
Messages
23
I just wanted to express my appreciation for the effort put into this post. Its been very helpful, THANKS!
 

Fred974

Contributor
Joined
Jul 2, 2016
Messages
190
@Brezlord Thank you very much for sharing the template. I have a few question.. My Zabbix server is outside of my network so I set the TrueNAS IP to my office public IP.
1.What port do I need to open/NAT? For my servers I use 10500 but not sure what the SNMP port is?
2. In TrueNAS I went to 'Services' -> SNMP and filled the location and email field and then enabled it. Is that all there is to it? Will your template work with SNMP v3?

Thank you in advance
 

Nimue

Cadet
Joined
Jul 26, 2021
Messages
1
Hi. I have a problem with the discovery of network interfaces and processors. With the network interfaces it says "snmp_parse_oid(): cannot parse OID "IF-MIB::ifDescr"" and with processors it says "snmp_parse_oid(): cannot parse OID "HOST-RESOURCES-MIB::hrPeocessorLoad"". What did I miss?
Thanks in advance.
 

Fibergeek

Cadet
Joined
Jan 10, 2019
Messages
6
Hi. I have a problem with the discovery of network interfaces and processors. With the network interfaces it says "snmp_parse_oid(): cannot parse OID "IF-MIB::ifDescr"" and with processors it says "snmp_parse_oid(): cannot parse OID "HOST-RESOURCES-MIB::hrPeocessorLoad"". What did I miss?
Thanks in advance.

I'm also having the same issue and can't figure out what is wrong.

1628294131865.png
 

JP Powers

Cadet
Joined
Jul 6, 2017
Messages
5
Hi folks.

share.zabbix.com has changed, and the official SNMP Generic and SNMP Processors templates are no longer available. Is it possible someone can export theirs and attach it here?


Thanks!

Edit: Nevermind, I did some direct googling and found the templates. Thanks random people making forks of stuff on github. Since this is the only recent resource I can find on TrueNAS w/ Zabbix, here they are for anyone else looking to do what I did. I can't attach so I'll code tag 'em.

Template_SNMP_Generic.xml:
Code:
<?xml version="1.0" encoding="UTF-8"?>
<zabbix_export>
    <version>3.0</version>
    <date>2017-10-14T02:14:34Z</date>
    <groups>
        <group>
            <name>Templates</name>
        </group>
    </groups>
    <templates>
        <template>
            <template>Template SNMP Generic</template>
            <name>Template SNMP Generic</name>
            <description/>
            <groups>
                <group>
                    <name>Templates</name>
                </group>
            </groups>
            <applications>
                <application>
                    <name>General</name>
                </application>
            </applications>
            <items>
                <item>
                    <name>Device contact details</name>
                    <type>4</type>
                    <snmp_community>{$SNMP_COMMUNITY}</snmp_community>
                    <multiplier>0</multiplier>
                    <snmp_oid>SNMPv2-MIB::sysContact.0</snmp_oid>
                    <key>sysContact</key>
                    <delay>3600</delay>
                    <history>7</history>
                    <trends>0</trends>
                    <status>0</status>
                    <value_type>1</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>The textual identification of the contact person for this managed node, together with information on how to contact this person.  If no contact information is known, the value is the zero-length string.</description>
                    <inventory_link>23</inventory_link>
                    <applications>
                        <application>
                            <name>General</name>
                        </application>
                    </applications>
                    <valuemap/>
                    <logtimefmt/>
                </item>
                <item>
                    <name>Device description</name>
                    <type>4</type>
                    <snmp_community>{$SNMP_COMMUNITY}</snmp_community>
                    <multiplier>0</multiplier>
                    <snmp_oid>SNMPv2-MIB::sysDescr.0</snmp_oid>
                    <key>sysDescr</key>
                    <delay>3600</delay>
                    <history>7</history>
                    <trends>0</trends>
                    <status>0</status>
                    <value_type>1</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>A textual description of the entity.  This value should include the full name and version identification of the system's hardware type, software operating-system, and networking software.</description>
                    <inventory_link>14</inventory_link>
                    <applications>
                        <application>
                            <name>General</name>
                        </application>
                    </applications>
                    <valuemap/>
                    <logtimefmt/>
                </item>
                <item>
                    <name>Device location</name>
                    <type>4</type>
                    <snmp_community>{$SNMP_COMMUNITY}</snmp_community>
                    <multiplier>0</multiplier>
                    <snmp_oid>SNMPv2-MIB::sysLocation.0</snmp_oid>
                    <key>sysLocation</key>
                    <delay>3600</delay>
                    <history>7</history>
                    <trends>0</trends>
                    <status>0</status>
                    <value_type>1</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>The physical location of this node (e.g., `telephone closet, 3rd floor').  If the location is unknown, the value is the zero-length string.</description>
                    <inventory_link>24</inventory_link>
                    <applications>
                        <application>
                            <name>General</name>
                        </application>
                    </applications>
                    <valuemap/>
                    <logtimefmt/>
                </item>
                <item>
                    <name>Device name</name>
                    <type>4</type>
                    <snmp_community>{$SNMP_COMMUNITY}</snmp_community>
                    <multiplier>0</multiplier>
                    <snmp_oid>SNMPv2-MIB::sysName.0</snmp_oid>
                    <key>sysName</key>
                    <delay>3600</delay>
                    <history>7</history>
                    <trends>0</trends>
                    <status>0</status>
                    <value_type>1</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>An administratively-assigned name for this managed node. By convention, this is the node's fully-qualified domain name.  If the name is unknown, the value is the zero-length string.</description>
                    <inventory_link>3</inventory_link>
                    <applications>
                        <application>
                            <name>General</name>
                        </application>
                    </applications>
                    <valuemap/>
                    <logtimefmt/>
                </item>
                <item>
                    <name>Device uptime</name>
                    <type>4</type>
                    <snmp_community>{$SNMP_COMMUNITY}</snmp_community>
                    <multiplier>1</multiplier>
                    <snmp_oid>SNMPv2-MIB::sysUpTime.0</snmp_oid>
                    <key>sysUpTime</key>
                    <delay>3600</delay>
                    <history>7</history>
                    <trends>365</trends>
                    <status>0</status>
                    <value_type>3</value_type>
                    <allowed_hosts/>
                    <units>uptime</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>0.01</formula>
                    <delay_flex/>
                    <params/>
                    <ipmi_sensor/>
                    <data_type>0</data_type>
                    <authtype>0</authtype>
                    <username/>
                    <password/>
                    <publickey/>
                    <privatekey/>
                    <port/>
                    <description>The time since the network management portion of the system was last re-initialized.</description>
                    <inventory_link>0</inventory_link>
                    <applications>
                        <application>
                            <name>General</name>
                        </application>
                    </applications>
                    <valuemap/>
                    <logtimefmt/>
                </item>
            </items>
            <discovery_rules/>
            <macros/>
            <templates/>
            <screens/>
        </template>
    </templates>
</zabbix_export>


Template_SNMP_Processors.xml:
Code:
<?xml version="1.0" encoding="UTF-8"?>
<zabbix_export>
    <version>2.0</version>
    <date>2015-11-30T12:03:31Z</date>
    <groups>
        <group>
            <name>Templates</name>
        </group>
    </groups>
    <templates>
        <template>
            <template>Template SNMP Processors</template>
            <name>Template SNMP Processors</name>
            <description/>
            <groups>
                <group>
                    <name>Templates</name>
                </group>
            </groups>
            <applications>
                <application>
                    <name>Processors</name>
                </application>
            </applications>
            <items/>
            <discovery_rules>
                <discovery_rule>
                    <name>Processors</name>
                    <type>4</type>
                    <snmp_community>{$SNMP_COMMUNITY}</snmp_community>
                    <snmp_oid>HOST-RESOURCES-MIB::hrProcessorLoad</snmp_oid>
                    <key>hrProcessorLoad</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>
                        <evaltype>0</evaltype>
                        <formula/>
                        <conditions/>
                    </filter>
                    <lifetime>30</lifetime>
                    <description>{$SNMP_COMMUNITY} is a global macro.</description>
                    <item_prototypes>
                        <item_prototype>
                            <name>Processor usage #$1</name>
                            <type>4</type>
                            <snmp_community>{$SNMP_COMMUNITY}</snmp_community>
                            <multiplier>0</multiplier>
                            <snmp_oid>HOST-RESOURCES-MIB::hrProcessorLoad.{#SNMPINDEX}</snmp_oid>
                            <key>hrProcessorLoad[{#SNMPINDEX}]</key>
                            <delay>60</delay>
                            <history>7</history>
                            <trends>365</trends>
                            <status>0</status>
                            <value_type>3</value_type>
                            <allowed_hosts/>
                            <units>%</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>The average, over the last minute, of the percentage of time this processor was not idle. Implementations can approach this leveling period this minute if necessary.</description>
                            <inventory_link>0</inventory_link>
                            <applications>
                                <application>
                                    <name>Processors</name>
                                </application>
                            </applications>
                            <valuemap/>
                            <logtimefmt/>
                        </item_prototype>
                    </item_prototypes>
                    <trigger_prototypes/>
                    <graph_prototypes/>
                    <host_prototypes/>
                </discovery_rule>
            </discovery_rules>
            <macros/>
            <templates/>
            <screens/>
        </template>
    </templates>
</zabbix_export>
 
Last edited:

Archer36

Cadet
Joined
Mar 15, 2022
Messages
1
Thanks for this guide - as others have noted I wasn't able to find the generic templates either, JP's post helped me get 2/3 but I had to dig a little to find the 3rd (Template SNMP Interfaces.xml). I found it here: https://github.com/loveqx/zabbix-do...ix-template-SNMP/Template SNMP Interfaces.xml

Code:
<?xml version="1.0" encoding="UTF-8"?>
<zabbix_export>
    <version>3.0</version>
    <date>2017-10-14T02:15:09Z</date>
    <groups>
        <group>
            <name>Templates</name>
        </group>
    </groups>
    <templates>
        <template>
            <template>Template SNMP Interfaces</template>
            <name>Template SNMP Interfaces</name>
            <description/>
            <groups>
                <group>
                    <name>Templates</name>
                </group>
            </groups>
            <applications>
                <application>
                    <name>Interfaces</name>
                </application>
            </applications>
            <items>
                <item>
                    <name>Number of network interfaces</name>
                    <type>4</type>
                    <snmp_community>{$SNMP_COMMUNITY}</snmp_community>
                    <multiplier>0</multiplier>
                    <snmp_oid>IF-MIB::ifNumber.0</snmp_oid>
                    <key>ifNumber</key>
                    <delay>3600</delay>
                    <history>7</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>The number of network interfaces (regardless of their current state) present on this system.</description>
                    <inventory_link>0</inventory_link>
                    <applications>
                        <application>
                            <name>Interfaces</name>
                        </application>
                    </applications>
                    <valuemap/>
                    <logtimefmt/>
                </item>
            </items>
            <discovery_rules>
                <discovery_rule>
                    <name>Network interfaces</name>
                    <type>4</type>
                    <snmp_community>{$SNMP_COMMUNITY}</snmp_community>
                    <snmp_oid>discovery[{#SNMPVALUE},IF-MIB::ifDescr]</snmp_oid>
                    <key>ifDescr</key>
                    <delay>60</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>
                        <evaltype>0</evaltype>
                        <formula/>
                        <conditions>
                            <condition>
                                <macro>{#SNMPVALUE}</macro>
                                <value>@Switcher interface filter</value>
                                <operator>8</operator>
                                <formulaid>A</formulaid>
                            </condition>
                        </conditions>
                    </filter>
                    <lifetime>30</lifetime>
                    <description>You may also consider using IF-MIB::ifType or IF-MIB::ifAlias for discovery depending on your filtering needs.&#13;
&#13;
{$SNMP_COMMUNITY} is a global macro.</description>
                    <item_prototypes>
                        <item_prototype>
                            <name>Admin status of interface $1</name>
                            <type>4</type>
                            <snmp_community>{$SNMP_COMMUNITY}</snmp_community>
                            <multiplier>0</multiplier>
                            <snmp_oid>IF-MIB::ifAdminStatus.{#SNMPINDEX}</snmp_oid>
                            <key>ifAdminStatus[{#SNMPVALUE}]</key>
                            <delay>300</delay>
                            <history>7</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>The desired state of the interface.</description>
                            <inventory_link>0</inventory_link>
                            <applications>
                                <application>
                                    <name>Interfaces</name>
                                </application>
                            </applications>
                            <valuemap>
                                <name>SNMP interface status (ifAdminStatus)</name>
                            </valuemap>
                            <logtimefmt/>
                            <application_prototypes/>
                        </item_prototype>
                        <item_prototype>
                            <name>Description of interface $1</name>
                            <type>4</type>
                            <snmp_community>{$SNMP_COMMUNITY}</snmp_community>
                            <multiplier>0</multiplier>
                            <snmp_oid>IF-MIB::ifDescr.{#SNMPINDEX}</snmp_oid>
                            <key>ifDescr[{#SNMPVALUE}]</key>
                            <delay>300</delay>
                            <history>7</history>
                            <trends>0</trends>
                            <status>0</status>
                            <value_type>1</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>A textual string containing information about the interface.  This string should include the name of the manufacturer, the product name and the version of the interface hardware/software.</description>
                            <inventory_link>0</inventory_link>
                            <applications>
                                <application>
                                    <name>Interfaces</name>
                                </application>
                            </applications>
                            <valuemap/>
                            <logtimefmt/>
                            <application_prototypes/>
                        </item_prototype>
                        <item_prototype>
                            <name>Incoming traffic on interface $1</name>
                            <type>4</type>
                            <snmp_community>{$SNMP_COMMUNITY}</snmp_community>
                            <multiplier>1</multiplier>
                            <snmp_oid>IF-MIB::ifHCInOctets.{#SNMPINDEX}</snmp_oid>
                            <key>ifInOctets[{#SNMPVALUE}]</key>
                            <delay>300</delay>
                            <history>7</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>The number of octets in valid MAC frames received on this interface, including the MAC header and FCS.</description>
                            <inventory_link>0</inventory_link>
                            <applications>
                                <application>
                                    <name>Interfaces</name>
                                </application>
                            </applications>
                            <valuemap/>
                            <logtimefmt/>
                            <application_prototypes/>
                        </item_prototype>
                        <item_prototype>
                            <name>Operational status of interface $1</name>
                            <type>4</type>
                            <snmp_community>{$SNMP_COMMUNITY}</snmp_community>
                            <multiplier>0</multiplier>
                            <snmp_oid>IF-MIB::ifOperStatus.{#SNMPINDEX}</snmp_oid>
                            <key>ifOperStatus[{#SNMPVALUE}]</key>
                            <delay>300</delay>
                            <history>7</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>The current operational state of the interface.</description>
                            <inventory_link>0</inventory_link>
                            <applications>
                                <application>
                                    <name>Interfaces</name>
                                </application>
                            </applications>
                            <valuemap>
                                <name>SNMP interface status (ifOperStatus)</name>
                            </valuemap>
                            <logtimefmt/>
                            <application_prototypes/>
                        </item_prototype>
                        <item_prototype>
                            <name>Outgoing traffic on interface $1</name>
                            <type>4</type>
                            <snmp_community>{$SNMP_COMMUNITY}</snmp_community>
                            <multiplier>1</multiplier>
                            <snmp_oid>IF-MIB::ifHCOutOctets.{#SNMPINDEX}</snmp_oid>
                            <key>ifOutOctets[{#SNMPVALUE}]</key>
                            <delay>300</delay>
                            <history>7</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>The number of octets transmitted in MAC frames on this interface, including the MAC header and FCS.</description>
                            <inventory_link>0</inventory_link>
                            <applications>
                                <application>
                                    <name>Interfaces</name>
                                </application>
                            </applications>
                            <valuemap/>
                            <logtimefmt/>
                            <application_prototypes/>
                        </item_prototype>
                        <item_prototype>
                            <name>Speed on interface $1</name>
                            <type>4</type>
                            <snmp_community>{$SNMP_COMMUNITY}</snmp_community>
                            <multiplier>0</multiplier>
                            <snmp_oid>IF-MIB::ifHighSpeed.{#SNMPINDEX}</snmp_oid>
                            <key>ifSpeed[{#SNMPVALUE}]</key>
                            <delay>300</delay>
                            <history>7</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>
                                <application>
                                    <name>Interfaces</name>
                                </application>
                            </applications>
                            <valuemap/>
                            <logtimefmt/>
                            <application_prototypes/>
                        </item_prototype>
                    </item_prototypes>
                    <trigger_prototypes>
                        <trigger_prototype>
                            <expression>{Template SNMP Interfaces:ifInOctets[{#SNMPVALUE}].count(#3,80000000,&quot;gt&quot;)}&gt;1 and {Template SNMP Interfaces:ifSpeed[{#SNMPVALUE}].last(0)}=100 and {Template SNMP Interfaces:ifInOctets[{#SNMPVALUE}].last(0)}&lt;100000000</expression>
                            <name>{HOST.NAME}上100Mbps端口的交换机入流量持续1分钟超过80Mbps</name>
                            <url/>
                            <status>0</status>
                            <priority>2</priority>
                            <description/>
                            <type>0</type>
                            <dependencies/>
                        </trigger_prototype>
                        <trigger_prototype>
                            <expression>{Template SNMP Interfaces:ifOutOctets[{#SNMPVALUE}].count(#3,80000000,&quot;gt&quot;)}&gt;1 and {Template SNMP Interfaces:ifSpeed[{#SNMPVALUE}].last(0)}=100 and {Template SNMP Interfaces:ifOutOctets[{#SNMPVALUE}].last(0)}&lt;100000000</expression>
                            <name>{HOST.NAME}上100Mbps端口的交换机出流量持续1分钟超过80Mbps</name>
                            <url/>
                            <status>0</status>
                            <priority>2</priority>
                            <description>count(#2,80000000,&quot;gt&quot;)&gt;2</description>
                            <type>1</type>
                            <dependencies/>
                        </trigger_prototype>
                        <trigger_prototype>
                            <expression>{Template SNMP Interfaces:ifInOctets[{#SNMPVALUE}].count(#3,800000000,&quot;gt&quot;)}&gt;1 and {Template SNMP Interfaces:ifSpeed[{#SNMPVALUE}].last(0)}=1000 and {Template SNMP Interfaces:ifInOctets[{#SNMPVALUE}].last(0)}&lt;1000000000</expression>
                            <name>{HOST.NAME}上1000Mbps端口的交换机入流量持续1分钟超过800Mbps</name>
                            <url/>
                            <status>0</status>
                            <priority>2</priority>
                            <description/>
                            <type>0</type>
                            <dependencies/>
                        </trigger_prototype>
                        <trigger_prototype>
                            <expression>{Template SNMP Interfaces:ifOutOctets[{#SNMPVALUE}].count(#3,800000000,&quot;gt&quot;)}&gt;1 and {Template SNMP Interfaces:ifSpeed[{#SNMPVALUE}].last(0)}=1000 and {Template SNMP Interfaces:ifOutOctets[{#SNMPVALUE}].last(0)}&lt;1000000000</expression>
                            <name>{HOST.NAME}上1000Mbps端口的交换机出流量持续1分钟超过800Mbps</name>
                            <url/>
                            <status>0</status>
                            <priority>2</priority>
                            <description/>
                            <type>0</type>
                            <dependencies/>
                        </trigger_prototype>
                        <trigger_prototype>
                            <expression>{Template SNMP Interfaces:ifInOctets[{#SNMPVALUE}].count(#3,8000000000,&quot;gt&quot;)}&gt;1 and {Template SNMP Interfaces:ifSpeed[{#SNMPVALUE}].last(0)}=10000 and {Template SNMP Interfaces:ifInOctets[{#SNMPVALUE}].last(0)}&lt;10000000000</expression>
                            <name>{HOST.NAME}上10000Mbps端口的交换机入流量持续1分钟超过8000Mbps</name>
                            <url/>
                            <status>0</status>
                            <priority>2</priority>
                            <description/>
                            <type>0</type>
                            <dependencies/>
                        </trigger_prototype>
                        <trigger_prototype>
                            <expression>{Template SNMP Interfaces:ifOutOctets[{#SNMPVALUE}].count(#3,8000000000,&quot;gt&quot;)}&gt;1 and {Template SNMP Interfaces:ifSpeed[{#SNMPVALUE}].last(0)}=10000 and {Template SNMP Interfaces:ifOutOctets[{#SNMPVALUE}].last(0)}&lt;10000000000</expression>
                            <name>{HOST.NAME}上10000Mbps端口的交换机出流量持续1分钟超过8000Mbps</name>
                            <url/>
                            <status>0</status>
                            <priority>2</priority>
                            <description/>
                            <type>0</type>
                            <dependencies/>
                        </trigger_prototype>
                        <trigger_prototype>
                            <expression>{Template SNMP Interfaces:ifOperStatus[{#SNMPVALUE}].change(0)}&gt;0 and {Template SNMP Interfaces:ifOperStatus[{#SNMPVALUE}].last(0)}=2</expression>
                            <name>{HOST.NAME}上的接口{#SNMPVALUE}已down掉,请注意查看!</name>
                            <url/>
                            <status>0</status>
                            <priority>3</priority>
                            <description/>
                            <type>0</type>
                            <dependencies/>
                        </trigger_prototype>
                        <trigger_prototype>
                            <expression>{Template SNMP Interfaces:ifDescr[{#SNMPVALUE}].str(&quot;GigabitEthernet&quot;)}=1 and {Template SNMP Interfaces:ifSpeed[{#SNMPVALUE}].change(0)}&lt;0</expression>
                            <name>{HOST.NAME}交换机端口 {#SNMPVALUE}由千兆转换成百兆</name>
                            <url/>
                            <status>0</status>
                            <priority>2</priority>
                            <description/>
                            <type>0</type>
                            <dependencies/>
                        </trigger_prototype>
                    </trigger_prototypes>
                    <graph_prototypes>
                        <graph_prototype>
                            <name>Traffic on interface {#SNMPVALUE}</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>0</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>00AA00</color>
                                    <yaxisside>0</yaxisside>
                                    <calc_fnc>2</calc_fnc>
                                    <type>0</type>
                                    <item>
                                        <host>Template SNMP Interfaces</host>
                                        <key>ifInOctets[{#SNMPVALUE}]</key>
                                    </item>
                                </graph_item>
                                <graph_item>
                                    <sortorder>1</sortorder>
                                    <drawtype>5</drawtype>
                                    <color>3333FF</color>
                                    <yaxisside>0</yaxisside>
                                    <calc_fnc>2</calc_fnc>
                                    <type>0</type>
                                    <item>
                                        <host>Template SNMP Interfaces</host>
                                        <key>ifOutOctets[{#SNMPVALUE}]</key>
                                    </item>
                                </graph_item>
                            </graph_items>
                        </graph_prototype>
                    </graph_prototypes>
                    <host_prototypes/>
                </discovery_rule>
            </discovery_rules>
            <macros/>
            <templates/>
            <screens/>
        </template>
    </templates>
    <value_maps>
        <value_map>
            <name>SNMP interface status (ifAdminStatus)</name>
            <mappings>
                <mapping>
                    <value>1</value>
                    <newvalue>up</newvalue>
                </mapping>
                <mapping>
                    <value>2</value>
                    <newvalue>down</newvalue>
                </mapping>
                <mapping>
                    <value>3</value>
                    <newvalue>testing</newvalue>
                </mapping>
            </mappings>
        </value_map>
        <value_map>
            <name>SNMP interface status (ifOperStatus)</name>
            <mappings>
                <mapping>
                    <value>1</value>
                    <newvalue>up</newvalue>
                </mapping>
                <mapping>
                    <value>2</value>
                    <newvalue>down</newvalue>
                </mapping>
                <mapping>
                    <value>3</value>
                    <newvalue>testing</newvalue>
                </mapping>
                <mapping>
                    <value>4</value>
                    <newvalue>unknown</newvalue>
                </mapping>
                <mapping>
                    <value>5</value>
                    <newvalue>dormant</newvalue>
                </mapping>
                <mapping>
                    <value>6</value>
                    <newvalue>notPresent</newvalue>
                </mapping>
                <mapping>
                    <value>7</value>
                    <newvalue>lowerLayerDown</newvalue>
                </mapping>
            </mappings>
        </value_map>
    </value_maps>
</zabbix_export>
 

JP Powers

Cadet
Joined
Jul 6, 2017
Messages
5
Ah, sorry Archer36, I had that one already from another template I used for something different. Should have included it for completeness. Thanks, though!
 

fmontebaur

Cadet
Joined
Apr 21, 2022
Messages
1
Managed to get it working in Zabbix 6.0
but all the Memory Item give me Errors like:

snmp_parse_oid(): cannot parse OID "UCD-SNMP-MIB::memAvailReal.0".

Did I have to install or copy some MIBs?
Or is it more like an error in the Template for Zabbix?
 
Top