All Projects → Prototype-X → Zabbix-Network-Weathermap

Prototype-X / Zabbix-Network-Weathermap

Licence: GPL-3.0 license
Network weathermap for Zabbix

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Zabbix-Network-Weathermap

zbxdb
Zabbix database monitoring, the easy and extendable way
Stars: ✭ 87 (+4.82%)
Mutual labels:  zabbix
zabbix-pgsql-partitioning
Partitioning scripts for Zabbix on PostgreSQL
Stars: ✭ 26 (-68.67%)
Mutual labels:  zabbix
KSC
Kaspersky Security Center monitoring helper
Stars: ✭ 13 (-84.34%)
Mutual labels:  zabbix
zabbix-mini-IPMI
Disk and CPU temperature monitoring for Linux, FreeBSD and Windows. LLD, trapper.
Stars: ✭ 82 (-1.2%)
Mutual labels:  zabbix
zapish
zapish - Zabbix API SHell binding
Stars: ✭ 28 (-66.27%)
Mutual labels:  zabbix
libzbxmodbus
Loadable module to integrate Modbus (RTU, TCP and encapsulated) into Zabbix. Bulk data collection included.
Stars: ✭ 44 (-46.99%)
Mutual labels:  zabbix
Kubernetes Zabbix
📦 Kubernetes Zabbix/Grafana cluster (bare metal, Google Computer Engine - GCE, Google Container Engine - GKE)
Stars: ✭ 244 (+193.98%)
Mutual labels:  zabbix
effluence
Zabbix loadable module for real-time export of history to InfluxDB
Stars: ✭ 26 (-68.67%)
Mutual labels:  zabbix
helm-zabbix
Helm Chart For Zabbix
Stars: ✭ 56 (-32.53%)
Mutual labels:  zabbix
community.zabbix
Zabbix Ansible modules
Stars: ✭ 224 (+169.88%)
Mutual labels:  zabbix
zabbix-module-python
Embedded Python interpreter module for Zabbix
Stars: ✭ 32 (-61.45%)
Mutual labels:  zabbix
Email-Graph-ZABBIX Python
No description or website provided.
Stars: ✭ 16 (-80.72%)
Mutual labels:  zabbix
grafana-weathermap-panel
plugin weathermap for Grafana. This project is still in development.
Stars: ✭ 27 (-67.47%)
Mutual labels:  network-weathermap
zabbix-cachet
Python script which sync Zabbix IT Services with Cachet
Stars: ✭ 78 (-6.02%)
Mutual labels:  zabbix
Elasticsearch-zabbix-monitor
Elasticsearch zabbix 监控
Stars: ✭ 16 (-80.72%)
Mutual labels:  zabbix
Golang Stats Api Handler
Golang cpu, memory, gc, etc information api handler.
Stars: ✭ 247 (+197.59%)
Mutual labels:  zabbix
zabbix-discord
Alertscript for zabbix to enable discord notifications
Stars: ✭ 27 (-67.47%)
Mutual labels:  zabbix
zabbix 44x next
Zabbix Next: Continued development of Zabbix version 4.4.x (unofficial)
Stars: ✭ 12 (-85.54%)
Mutual labels:  zabbix
zabbix-templates
Zabbix templates
Stars: ✭ 104 (+25.3%)
Mutual labels:  zabbix
Zabbix-Extensions
Some plugins for using Zabbix
Stars: ✭ 15 (-81.93%)
Mutual labels:  zabbix

Zabbix-Network-Weathermap

Join the chat at https://gitter.im/Prototype-X/Zabbix-Network-Weathermap Code Health

Network weathermap for Zabbix like Network Weathermap

Screenshot

map screenshot

Features

  • Get source data from Zabbix
  • Generate YAML config from Zabbix map
  • Create image with map in PNG format
  • Upload image to Zabbix
  • Support for map elements with the type: host, map, image

Requrements

  • Zabbix 3.4 (I dont check backward compability with Zabbix 3.0 - 3.2)
  • Python 3.4.3 and above
  • libs: Pillow, py-zabbix, ruamel.yaml

Install

    sudo apt-get install python3-pip python-pip python3-pil
    sudo pip3 install py-zabbix
    sudo pip3 install ruamel.yaml==0.14.12
    unzip Zabbix-Network-Weathermap.zip -d /opt
    chown -R zabbix:zabbix /opt/Zabbix-Network-Weathermap/*
    chmod a+x /opt/Zabbix-Network-Weathermap/starter.py
    chmod a+x /opt/Zabbix-Network-Weathermap/weathermap.py
    cp /opt/Zabbix-Network-Weathermap/template/userparameter_weathermap.conf /etc/zabbix/zabbix_agentd.d/
  • Copy /template/userparemeter_weathermap.conf to /etc/zabbix/zabbix_agentd.d/ and reload zabbix-agent

  • Import template /template/weathermap.xml to zabbix

  • Add Template Weathermap to host where use zabbix agent (for example use host zabbix server)

  • Create new user with permissions Zabbix Admin

  • User must have read-only or read-write access to hosts and hosts groups present in map

  • Go to Zabbix -> Configuration -> Template Weathermap -> Macros:

    {$SCANFILE} - When map config exist. If you change map remove host or change position host, configuration will be updated in accordance with changes on the map.

    {$SCANMAP} - First time scan map, config file not exist. Create file with map configuration.

    {$UPDATE} - Only create image, like old style Network Weathermap.

    {$UPLOAD} - Create and upload image to Zabbix.

  • Check Zabbix -> Configuration -> Hosts -> Host with Weathermap template -> Applications -> Weathermap -> Items -> Status

  • Create file with map configuration:

      weathermap.py -s mapname1 mapnameN -z http://zabbix.example.com -l admin -p admin
    

    OR

    Zabbix -> Template Weathermap -> Macros -> {$SCANMAP} -> Value

  • Open file /opt/Zabbix-Network-Weathermap/mapcfgs/mapname1.yaml and set hostname and itemin, itemout. If you set visible name, then use visible name instead hostname.

         link-1:
           node1: node-Router
           node2: node-Switch
           name1: R1
           name2: SW1
           width: 15
           hostname: Router
           #itemin/itemout = item key
           itemin: ifHCInOctets[ge-0/0/0]
           itemout: ifHCOutOctets[ge-0/0/0]
  • Create map image and upload it to Zabbix:

      weathermap.py -m mapname1.yaml -u  
    

    OR

    Zabbix -> Template Weathermap -> Macros -> {$UPLOAD} -> Value

  • Set Zabbix -> Monitoring -> Maps -> mapname1 -> Properties -> Background image -> mapname1

Scripts note

Default path:

/opt/Zabbix-Network-Weathermap/mapcfgs - map config dir

/opt/Zabbix-Network-Weathermap/mapimgs - map images dir

/opt/Zabbix-Network-Weathermap/icons - map icons dir

usage: weathermap.py [-v] [-h] [-d] [-m MAP [MAP ...]] [-i IMG] [-u] [-c CFG] [-s SCAN [SCAN ...]] [-f]
                     [-z ZABBIX] [-l LOGIN] [-p PWD]

Network weathermap for Zabbix

optional arguments:
-v, --version                             show version
-h, --help                                show help
-d, --debug                               Enable debug mode
-m MAP [MAP ..], --map MAP [MAP ..]       Config file names
-i IMG, --img IMG                         Image path
-u, --upload                              Image upload to zabbix
-c CFG, --cfg CFG                         Config path
-s SCAN [SCAN ..], --scan SCAN [SCAN ..]  Map names in Zabbix
-f, --file                                Zabbix authentication from map config file
-z ZABBIX, --zabbix ZABBIX                Zabbix server url
-l LOGIN, --login LOGIN                   Login
-p PWD, --pwd PWD                         Password

# Examples:
# When map config exist. If you change map remove host or change position host, 
# configuration will be updated in accordance with changes on the map.
weathermap.py -s mapname1 mapnameN -f

# First time scan map, config file not exist. Create file with map configuration.
weathermap.py -s mapname1 mapnameN -z http://zabbix.example.ru -l login -p password

# Only create image, like old style Network Weathermap.
weathermap.py -m mapname1.yaml mapnameN.yaml -i /var/www/weather

# Create and upload image to Zabbix.
weathermap.py -m mapname1.yaml mapnameN.yaml -u

starter.py run weathermap.py and return execution time.

For auto update image or rescan map you can use cron, systemd or Template Weathermap.

Map config

    %YAML 1.2
    ---
    map:
      name: mapname1
      bgcolor: ''           #background RGB color, default transparent
      fontsize: 10
      width: 1200
      height: 800
    zabbix:
      url: http://zabbix.example.com
      login: admin
      password: admin
    table:                  # show legend and date time
      show: true
      x: 1100
      y: 100
    palette:                # RGB color arrow
    - '#908C8C'
    - '#FFFFFF'
    - '#8000FF'
    - '#0000FF'
    - '#00EAEA'
    - '#00FF00'
    - '#FFFF00'
    - '#FF9933'
    - '#FF0000'
    link:                   # default settings link
      bandwidth: 100        # in Mbits/s
      width: 10             # width arrow in pixels
    node-Router:
      name: Символы         # Get from Zabbix
      label: R1             # For old style Network Weathermap, draw label
      icon: Router64.png    # For old style Network Weathermap, draw icon, if path not exist, use defaults
      x: 625
      y: 225
    node-Router2:
      name: ''
      label: R2
      icon: Router64.png
      x: 625
      y: 225
    node-Switch:
      name: ''
      label: SW1
      icon: Switch64.png
      x: 75
      y: 375
    node-Switch2:
      name: ''
      label: SW2
      icon: Switch64.png
      x: 75
      y: 375
    link-1:
      node1: node-Router
      node2: node-Switch
      name1: ''             # For human readability, get from zabbix
      name2: ''             # For human readability, get from zabbix
      width: 15             # Override default settings in link
      hostname: Router
      itemin: ifHCInOctets[ge-0/0/0]
      itemout: ifHCOutOctets[ge-0/0/0]
    link-2:
      node1: node-Router2
      node2: node-Switch2
      name1: ''
      name2: ''
      bandwidth: 1000        # Override default settings in link
      hostname: Router2
      itemin: ifHCInOctets[ge-0/0/1]
      itemout: ifHCOutOctets[ge-0/0/1]
    ...

Option copy type bool, copy link and nodes in new config, when link and nodes not exist in zabbix map

    link-lyonlz7x:
      node1: node-nridx7c0
      node2: node-uwf443jw
      name1: net1
      name2: net2
      copy: true
      hostname: R10
      itemin: ifHCOutOctets[1/6]
      itemout: ifHCInOctets[1/6]

Notice

Zabbix 3.4.x do not refresh background image on map. FIX!

Zabbix API performance is low. Zabbix agent run weathermap.py. Weathermap.py can be terminated by timeout, set in zabbix_agentd.conf.

Decision:

  1. Increase the timeout for example: zabbix_agentd.conf set Timeout=10

  2. One item to one map in Template Weathermap

  3. Use cron to run the scripts

If you need convert from old style config to YAML format, use converter.py

user@pc:~$ converter.py /path-to-old-style-cfg/map.cfg
user@pc:~$ ls /path-to-old-style-cfg
map.cfg
map.yaml

For a better look of map, set the link type a dot and color like background.

Gitter

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].