Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when Create file with map configuration #32

Open
tuananh9496 opened this issue Feb 22, 2018 · 7 comments
Open

Error when Create file with map configuration #32

tuananh9496 opened this issue Feb 22, 2018 · 7 comments

Comments

@tuananh9496
Copy link

tuananh9496 commented Feb 22, 2018

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!

@Prototype-X
Copy link
Owner

Hi,
What version of zabbix are you using?

@tuananh9496
Copy link
Author

Hi, I use Zabbix 3.0.14.

@Prototype-X
Copy link
Owner

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

@tuananh9496
Copy link
Author

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?

@Prototype-X
Copy link
Owner

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.

@tuananh9496
Copy link
Author

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

@igloo777
Copy link

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants