Skip to content

Commit

Permalink
Merge pull request zabbix#119 from BarryCui/main
Browse files Browse the repository at this point in the history
update template
  • Loading branch information
oscar120584 authored Jul 14, 2022
2 parents 03f3962 + a6ff645 commit 165f0d6
Show file tree
Hide file tree
Showing 2 changed files with 105 additions and 160 deletions.
122 changes: 69 additions & 53 deletions Network_Devices/H3C/template_h3c_wx3510h_discovery/6.0/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,34 +4,30 @@

**Description**
---------------
Testing environment:
- Ubuntu 22.04 LTS
- Zabbix 6.0.6
- AC WX3510H(ComwareV7)


I've created this template for the H3C Access Controller Model WX3510H.


For now, I've tested only the AC model WX3510H with the software version ComwareV7 and the AP model WA4320i-ACN on zabbix version 3.4.x and 4.4.x.


The templates of version 3.4.x and 4.4.x are the same one.



I've updated and tested this template in the above environment.


**Prerequisites**
-----------------

Before using this template, you must complete the steps below:

Before you can use this template, you must complete the steps below:


1. Download the MIB files from the H3C website: http://download.h3c.com.cn/download.do?id=5087748 or get it from my github template subfolders.
1. Set up snmp configuarions on WX3510H device:
Example:
snmp-agent sys-info version all
snmp-agent community read public
snmp-agent community write private

2. Download MIB files from H3C website: https://download.h3c.com/app/cn/download.do?id=7378345

2. Unzip the .zip file and copy all the files under the subfolder "Comware MIB-20200713\H3C New Style Private MIB\" into the snmp mib folder(normally /usr/share/snmp/mibs/) on your zabbix server(Note: If you're running a dockerized zabbix, you need to copy the mib files into the container run by the zabbix/zabbix-server-mysql:alpine image).
Unzip and copy all the files under the subfolder "H3C Public MIB/" and "H3C New Style Private MIB/" into the snmp MIB folder(normally /usr/share/snmp/mibs/) on your zabbix server.


3. Restart zabbix to take effect.
3. Restart Zabbix to take effect.



Expand All @@ -41,42 +37,40 @@ Before you can use this template, you must complete the steps below:
------------


- Automatically discovers and adds items of the number of the currently associated stations for each AP.
- Automatically discovers APs with some of their properties(number of clients, channel number, channel usage, CPU usage, etc.).


- Links to the template "Template Module ICMP Ping" in order to do ping tests for AC.
- This template is linked to "Template Module ICMP Ping" in order to do ping tests for AC.





**Usage**
**How to use it**
---------


1. Import the template file.


2. Add a host of H3C WX3510H AC.


3. Link the AC host with this template.
2. Add a host of H3C WX3510H AC, and set the macro {$SNMP\_COMMUNITY} to the value of your own
under host config(not template config).


4. Set the macro {$SNMP\_COMMUNITY} to the value of your own under host level.
3. Link the AC host to this template.


5. Wait for discovery.
4. Wait for discovery.





**Advanced Usage**
**Visualize your APs**
------------------


You can make a real-time AP location map showing the current stations for each AP by the following steps:
You can make a real-time AP location map showing the current statistics for each AP by the following steps:


1. Create a topology map.
Expand All @@ -85,51 +79,67 @@ You can make a real-time AP location map showing the current stations for each A
2. Import your own location map picture as background.


3. Add an element as each of your AP:
3. Add an element as Access point device:

Below is an example, the label is an expression macro, the pattern is like this: {?last(/ac ip/item key)}

- type: host
- type: Host

- Label:
Name: ap01
Number of Clients: {?last(/10.1.1.1/numOfClients[ap01])}
2.4G channel number: {?last(/10.1.1.1/hh3cDot11APRadioEntry.5.c2.[ap01])}
2.4G channel usage: {?last(/10.1.1.1/hh3cDot11APRadioEntry.26.c2.[ap01])}
5.8G channel number: {?last(/10.1.1.1/hh3cDot11APRadioEntry.5.c1.[ap01])}
5.8G channel usage: {?last(/10.1.1.1/hh3cDot11APRadioEntry.26.c1.[ap01])}
CPU Usage: {?last(/10.0.200.253/hh3cDot11APSysInfoByAPIDEntry.2[ap01])}

- tag:{the IP address of AC:hh3cDot11ApStationCurAssocSum[the name of ap, you can get it from the names of items].last(0)}
- Host: (choose your AC device from list)

Through this way I'm able to dynamicly show all the APs with their statistics.

Note:

- host: choose your AC from list
Since Zabbix6.0, expression macros are written in a new way. You can find useful information here:





**Note**
--------


To be clear, here's an example of the content of my tag:
https://www.zabbix.com/documentation/6.0/de/manual/introduction/whatsnew600#new-macros
https://www.zabbix.com/documentation/5.4/en/manual/introduction/whatsnew540


AP39


Current stations: {10.0.200.253:hh3cDot11ApStationCurAssocSum[ap39].last(0)}
**How to customize this template**
------------------


As you may want to customize or expand the functionality of this template, here's what I do for the development routine:


#From the first line, AP39 is one of my AP names. I added it by hand.
1. In the unzipped folder, you may find a .txt file named "Quick reference of H3C new style MIB objects description". Open it and filter the keyword "DOT11" or more specifically "HH3C-DOT11-APMT-MIB", because the latter one is the only MIB I care about.

2. In the .txt file, you can see lots of blocks of OIDs: an OBJECT-TYPE followed by "-- FROM" keyword.
Say, I find the OBJECT-TYPE hh3cDot11ApStationCurAssocSum followed by the string "-- FROM HH3C-DOT11-APMT-MIB" on the second line.
You can use snmpwalk to retrieve data based on that format. The command should be like:
pattern: snmpwalk -v 2c -c <community name> <device ip> <OID>
example: snmpwalk -v 2c -c public 10.1.1.1 HH3C-DOT11-APMT-MIB::hh3cDot11ApStationCurAssocSum

#The second line shows dynamic statistics of the current stations of ap39, in which 10.0.200.253 is the IP address of my AC; The second part you can copy from item key names; last(0) means to get the latest data. You can just replace the IP of AC and the name 'ap39' in [] with your own values.
You see what I'm doing? Yes, just put the MIB string(HH3C-DOT11-APMT-MIB) after device ip, and then followed by two colons followed by the OBJECT-TYPE(hh3cDot11ApStationCurAssocSum in this case).

There you are. You've successfully retrieved data.

3. Copy the snippet of OID in snmpwalk command into Zabbix to make your template macro.
A simple example of the usage of it in discovery rule:
discovery[{#NUMOFCLIENTS},HH3C-DOT11-APMT-MIB::hh3cDot11ApStationCurAssocSum]
The first parameter is a macro name, the second one is the OID you used before.


An example of the usage in item prototypes:
HH3C-DOT11-APMT-MIB::hh3cDot11ApStationCurAssocSum.{#SNMPINDEX}
The parameter is the OID you used, and it is followed by a dot and a built-in macro {#SNMPINDEX}.



## Author

Barry Cui
Barry Cui
Email: [email protected]; [email protected]

## Macros used

Expand All @@ -146,14 +156,20 @@ There are no macros links in this template.

|Name|Description|Type|Key and additional info|
|----|-----------|----|----|
|AP Discovery|<p>-</p>|`SNMP agent`|hh3cDot11CurrAPTemplateName<p>Update: 1m</p>|
|AP Discovery|<p>-</p>|`SNMP agent`|ap.discovery<p>Update: 1m</p>|


## Items collected

|Name|Description|Type|Key and additional info|
|----|-----------|----|----|
|number of current associations on $1|<p>-</p>|`SNMP agent`|hh3cDot11ApStationCurAssocSum[{#APNAME}]<p>Update: 60s</p><p>LLD</p>|
|number of current clients on {#APNAME}|<p>-</p>|`SNMP agent`|HH3C-DOT11-APMT-MIB::hh3cDot11ApStationCurAssocSum.{#SNMPINDEX}<p>Update: 60s</p><p>LLD</p>|
|2.4G Channel Number on {#APNAME}|<p>-</p>|`SNMP agent`|hh3cDot11APRadioEntry.5.c2.[{#APNAME}]<p>Update: 60s</p><p>LLD</p>|
|2.4G Channel Usage on {#APNAME}|<p>-</p>|`SNMP agent`|hh3cDot11APRadioEntry.26.c2.[{#APNAME}]<p>Update: 60s</p><p>LLD</p>|
|5.8G Channel Number on {#APNAME}|<p>-</p>|`SNMP agent`|hh3cDot11APRadioEntry.5.c1.[{#APNAME}]<p>Update: 60s</p><p>LLD</p>|
|5.8G Channel Usage on {#APNAME}|<p>-</p>|`SNMP agent`|hh3cDot11APRadioEntry.26.c1.[{#APNAME}]<p>Update: 60s</p><p>LLD</p>|
|CPU Utilization of {#APNAME}|<p>-</p>|`SNMP agent`|hh3cDot11APSysInfoByAPIDEntry.2[{#APNAME}]<p>Update: 60s</p><p>LLD</p>|



## Triggers
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
zabbix_export:
version: '6.0'
date: '2021-11-25T12:38:51Z'
date: '2022-07-12T09:45:41Z'
groups:
-
uuid: 49e5ba9892ce4b549316c9aca16306c0
name: H3C
-
uuid: 57b7ae836ca64446ba2c296389c009b7
name: Templates/Modules
templates:
-
uuid: a6272303388442519ca5722eec23ae53
Expand All @@ -24,15 +21,45 @@ zabbix_export:
uuid: 5ba4261a83014e8ca2e5cb5e2d26098a
name: 'AP Discovery'
type: SNMP_AGENT
snmp_oid: 'discovery[{#APNAME},HH3C-DOT11-APMT-MIB::hh3cDot11CurrAPTemplateName,{#CLIENTNUMBER},HH3C-DOT11-APMT-MIB::hh3cDot11ApStationCurAssocSum]'
key: hh3cDot11CurrAPTemplateName
snmp_oid: 'discovery[{#APNAME},HH3C-DOT11-APMT-MIB::hh3cDot11CurrAPTemplateName,{#NUMOFCLIENTS},HH3C-DOT11-APMT-MIB::hh3cDot11ApStationCurAssocSum,{#CPUUSAGE},HH3C-DOT11-APMT-MIB::hh3cDot11APSysInfoByAPIDEntry.2,{#CHANNELNUMBER},HH3C-DOT11-APMT-MIB::hh3cDot11APRadioEntry.5,{#CHANNELUSAGE},HH3C-DOT11-APMT-MIB::hh3cDot11APRadioEntry.26,{#SSID},HH3C-DOT11-APMT-MIB::hh3cDot11SSID]'
key: ap.discovery
item_prototypes:
-
uuid: c284412dcc2e434bb166566f959799e8
name: '5.8G Channel Number on {#APNAME}'
type: SNMP_AGENT
snmp_oid: 'HH3C-DOT11-APMT-MIB::hh3cDot11Channel.{#SNMPINDEX}.1'
key: 'hh3cDot11APRadioEntry.5.c1.[{#APNAME}]'
-
uuid: 98eb886ac15b4f5086177ac43f77b98d
name: '2.4G Channel Number on {#APNAME}'
type: SNMP_AGENT
snmp_oid: 'HH3C-DOT11-APMT-MIB::hh3cDot11Channel.{#SNMPINDEX}.2'
key: 'hh3cDot11APRadioEntry.5.c2.[{#APNAME}]'
-
uuid: 406c86bd36d54fc7967881d671c7b0a5
name: '5.8G Channel Usage on {#APNAME}'
type: SNMP_AGENT
snmp_oid: 'HH3C-DOT11-APMT-MIB::hh3cDot11AirPrimChnlBusy.{#SNMPINDEX}.1'
key: 'hh3cDot11APRadioEntry.26.c1.[{#APNAME}]'
-
uuid: e15f29bfc9ff4b26b6f1b9092527c56a
name: '2.4G Channel Usage on {#APNAME}'
type: SNMP_AGENT
snmp_oid: 'HH3C-DOT11-APMT-MIB::hh3cDot11AirPrimChnlBusy.{#SNMPINDEX}.2'
key: 'hh3cDot11APRadioEntry.26.c2.[{#APNAME}]'
-
uuid: 307ec2f0f94b45d5beaec0918e338ebc
name: 'CPU Utilization of {#APNAME}'
type: SNMP_AGENT
snmp_oid: 'HH3C-DOT11-APMT-MIB::hh3cDot11APCPURTUsage2.{#SNMPINDEX}'
key: 'hh3cDot11APSysInfoByAPIDEntry.2[{#APNAME}]'
-
uuid: 8a2313b503f64c28a29c613810a4761f
name: 'number of current associations on $1'
name: 'number of current clients on {#APNAME}'
type: SNMP_AGENT
snmp_oid: 'HH3C-DOT11-APMT-MIB::hh3cDot11ApStationCurAssocSum.{#SNMPINDEX}'
key: 'hh3cDot11ApStationCurAssocSum[{#APNAME}]'
key: 'numOfClients[{#APNAME}]'
delay: 60s
graph_prototypes:
-
Expand All @@ -43,102 +70,4 @@ zabbix_export:
color: 1A7C11
item:
host: H3C_WX3510H
key: 'hh3cDot11ApStationCurAssocSum[{#APNAME}]'
-
uuid: 37e5eb5606bc4abba66c8b20381a1e8a
template: 'Template Module ICMP Ping'
name: 'Template Module ICMP Ping'
description: 'Template Module ICMP Ping version: 0.12'
groups:
-
name: Templates/Modules
items:
-
uuid: db5a94f6cea14deba957202b2f014469
name: 'ICMP ping'
type: SIMPLE
key: icmpping
delay: '60'
history: 1w
valuemap:
name: 'Service state'
tags:
-
tag: Application
value: Status
triggers:
-
uuid: b030876299434f3ba43e11c584104a81
expression: 'max(/Template Module ICMP Ping/icmpping,#3)=0'
name: 'Unavailable by ICMP ping'
priority: HIGH
description: |
Last value: {ITEM.LASTVALUE1}.
Last three attempts returned timeout. Please check device connectivity.
-
uuid: 04b21adaf422473a88df2c52786474ed
name: 'ICMP loss'
type: SIMPLE
key: icmppingloss
delay: '60'
history: 1w
value_type: FLOAT
units: '%'
tags:
-
tag: Application
value: Status
triggers:
-
uuid: 42c4b0310aaf4b9c8cb502542b7dea90
expression: 'min(/Template Module ICMP Ping/icmppingloss,5m)>{$ICMP_LOSS_WARN} and min(/Template Module ICMP Ping/icmppingloss,5m)<100'
name: 'High ICMP ping loss'
priority: WARNING
dependencies:
-
name: 'Unavailable by ICMP ping'
expression: 'max(/Template Module ICMP Ping/icmpping,#3)=0'
-
uuid: a79e33e5fd264725b934f603fa071555
name: 'ICMP response time'
type: SIMPLE
key: icmppingsec
delay: '60'
history: 1w
value_type: FLOAT
units: s
tags:
-
tag: Application
value: Status
triggers:
-
uuid: 32b4d8f3eba34bd380803410111d4b7f
expression: 'avg(/Template Module ICMP Ping/icmppingsec,5m)>{$ICMP_RESPONSE_TIME_WARN}'
name: 'High ICMP ping response time'
priority: WARNING
dependencies:
-
name: 'High ICMP ping loss'
expression: 'min(/Template Module ICMP Ping/icmppingloss,5m)>{$ICMP_LOSS_WARN} and min(/Template Module ICMP Ping/icmppingloss,5m)<100'
-
name: 'Unavailable by ICMP ping'
expression: 'max(/Template Module ICMP Ping/icmpping,#3)=0'
macros:
-
macro: '{$ICMP_LOSS_WARN}'
value: '20'
-
macro: '{$ICMP_RESPONSE_TIME_WARN}'
value: '0.15'
valuemaps:
-
uuid: bdb5d65d925542eaa61c302dc40fbfe8
name: 'Service state'
mappings:
-
value: '0'
newvalue: Down
-
value: '1'
newvalue: Up
key: 'numOfClients[{#APNAME}]'

0 comments on commit 165f0d6

Please sign in to comment.