Zabbix-Network-Weathermap icon indicating copy to clipboard operation
Zabbix-Network-Weathermap copied to clipboard

Error when Create file with map configuration

Open tuananh9496 opened this issue 7 years ago • 7 comments
trafficstars

Hi Prototype-X, I am new to use Zabbix. I install it on VMware Workstation (OS: CentOS 7). I installed it as follows:

  1. Create map in zabbix with two hosts and one link:

image

  1. Save map
  2. Scan map with the following command: python3.6 weathermap.py -s newmap -z http://20.0.0.120/zabbix -l admin -p zabbix

and I have an error:

Traceback (most recent call last): File "weathermap.py", line 121, in main() File "weathermap.py", line 118, in main WeathermapCLI() File "weathermap.py", line 55, in init self._map_scan() File "weathermap.py", line 69, in _map_scan scan_map.create() File "/opt/Zabbix-Network-Weathermap/config.py", line 252, in create nodename = self.dict_callint(node['elementtype']) KeyError: 'elements'

Can you help me solve this problem? Sorry about my English. Thank you!

tuananh9496 avatar Feb 22 '18 04:02 tuananh9496

Hi, What version of zabbix are you using?

Prototype-X avatar Feb 22 '18 07:02 Prototype-X

Hi, I use Zabbix 3.0.14.

tuananh9496 avatar Feb 22 '18 10:02 tuananh9496

Ok, the last version 1.1.5 support Zabbix 3.4 - only, use previous version 1.1.3

Prototype-X avatar Feb 22 '18 11:02 Prototype-X

I installed Zabbix 1.1.3 and it works. Thank you. But I have another question. What does "hostname", "itemin" and "itemout" mean? This is my map:

1

and this is my config file:

2

Is that right?

tuananh9496 avatar Feb 23 '18 05:02 tuananh9496

For example: hostname - zabbix -> configuration -> hosts -> Zabbix server -> Host name itemin/itemout - traffic counters zabbix -> configuration -> hosts -> Zabbix server -> items -> column key -> net.if.in[eth0] and net.if.out[eth0] Yes, that right.

Prototype-X avatar Feb 23 '18 07:02 Prototype-X

Thank you. I understood. I drew this map manually. Is there a way to draw network maps automatically with zabbix?

tuananh9496 avatar Feb 23 '18 08:02 tuananh9496

Hi, +1 to the question of @tuananh9496 Problem: if we have 50+ links, it's obvious that we need something, that will get a values of "hostname:", "itemin:", "itemout:" and "bandwidth:" from zabbix, because to add it into yaml config manually after changes in map.. it's a hell )

How to implement: we can use the fields "Label" of Map elements, and add there required info. So the Host, IN, OUT, Link in the values of Label can be used as a marker for parser. Example:

Link: {sw20v:net.if.speed[ifHighSpeed.10202].last(0)} IN: {sw20v:net.if.in[ifHCInOctets.10202].last(0)} OUT: {sw20v-13e0:net.if.out[ifHCOutOctets.10202].last(0)}

I think it's should be easy to parse such data, and we have all required information for yaml! Also there can be add mapping with multiplier (baseNmult where base=2.5, N=bandwidth in Gbps, mult=0.5) like:

  • 1 Gbps -> Width: 2.5x1x0.5 (1.25), Bandwidth: 1000
  • 2 Gbps -> Width: 2.5, Bandwidth: 2000
  • 3 Gbps -> Width: 3.75, Bandwidth: 2000
  • ...
  • 10 Gbps -> Width: 12.5, Bandwidth: 10000

For 40 and 100 Gbps links custom multiplier can be used.

Weather map will still looks good: image

@Prototype-X how do you think?

igloo777 avatar May 18 '18 06:05 igloo777