Code Monkey home page Code Monkey logo

zabbix-template-converter's People

Contributors

cavaliercoder avatar jangaraj avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

zabbix-template-converter's Issues

Zabbix 3.4 Templates

Please add support for Zabbix 3.4 Templates. So it can converted from 3.4 to 3.2 and so on

Python3 support

The print statement must be changed to the Python3 version.

Getting error when trying to convert 2.1 template to 3.0

Here is the command I'm trying to run: zabbix-template-converter -o 3.0 template-pfsense21.xml > template-pfsense3.xml

This is the error I'm getting:

Traceback (most recent call last):
File "/bin/zabbix-template-converter", line 343, in
main()
File "/bin/zabbix-template-converter", line 322, in main
doc = ET.parse(args.file)
File "/usr/lib64/python2.7/xml/etree/ElementTree.py", line 1182, in parse
tree.parse(source, parser)
File "/usr/lib64/python2.7/xml/etree/ElementTree.py", line 656, in parse
parser.feed(data)
File "/usr/lib64/python2.7/xml/etree/ElementTree.py", line 1642, in feed
self._raiseerror(v)
File "/usr/lib64/python2.7/xml/etree/ElementTree.py", line 1506, in _raiseerror
raise err
xml.etree.ElementTree.ParseError: not well-formed (invalid token): line 42, column 91

I've also attached the template I'm trying to convert

Not compatible with python 3.6.8

Symptom

After the instalation process

[11:56:43] nsvcadm@DESKTOP-ABF8GII:2.BEEGOL_V4 $ pip3 install zabbix-template-converter
Defaulting to user installation because normal site-packages is not writeable
Collecting zabbix-template-converter
  Downloading zabbix-template-converter-1.1.0.tar.gz (5.1 kB)
  Preparing metadata (setup.py) ... done
Building wheels for collected packages: zabbix-template-converter
  Building wheel for zabbix-template-converter (setup.py) ... done
  Created wheel for zabbix-template-converter: filename=zabbix_template_converter-1.1.0-py3-none-any.whl size=5396 sha256=9906875d1bb749e17cb598cacbc901014f34c8ee2bdca3319218f95c3d6b838f
  Stored in directory: /home/nsvcadm/.cache/pip/wheels/03/5c/a8/589ab4c1562f49e5265ed7c9de614c8b6f17d33690c17ecb55
Successfully built zabbix-template-converter
Installing collected packages: zabbix-template-converter
Successfully installed zabbix-template-converter-1.1.0

Is not possible to execute any command from the script since it has an sintax error.

[11:56:51] nsvcadm@DESKTOP-ABF8GII:2.BEEGOL_V4 $ zabbix-template-converter -h
  File "/home/nsvcadm/.local/bin/zabbix-template-converter", line 339
    print '<?xml version="1.0" encoding="UTF-8"?>'
                                                 ^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print('<?xml version="1.0" encoding="UTF-8"?>')?

Possible problems:

  • It need some other python module/script in their requirement, so it could understant this sintax:
  • There is a literal sintax error in the script

Related

#7

Environment:

OS:

[11:47:09] nsvcadm@DESKTOP-ABF8GII:2.BEEGOL_V4 $ cat /etc/*release*
Oracle Linux Server release 8.5
NAME="Oracle Linux Server"
VERSION="8.5"
ID="ol"
ID_LIKE="fedora"
VARIANT="Server"
VARIANT_ID="server"
VERSION_ID="8.5"
PLATFORM_ID="platform:el8"
PRETTY_NAME="Oracle Linux Server 8.5"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:oracle:linux:8:5:server"
HOME_URL="https://linux.oracle.com/"
BUG_REPORT_URL="https://bugzilla.oracle.com/"

ORACLE_BUGZILLA_PRODUCT="Oracle Linux 8"
ORACLE_BUGZILLA_PRODUCT_VERSION=8.5
ORACLE_SUPPORT_PRODUCT="Oracle Linux"
ORACLE_SUPPORT_PRODUCT_VERSION=8.5
Red Hat Enterprise Linux release 8.5 (Ootpa)
Oracle Linux Server release 8.5
cpe:/o:oracle:linux:8:5:server
[11:47:27] nsvcadm@DESKTOP-ABF8GII:2.BEEGOL_V4 $ uname -a
Linux DESKTOP-ABF8GII 5.10.60.1-microsoft-standard-WSL2 #1 SMP Wed Aug 25 23:20:18 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux

Python3 version:

[11:47:41] nsvcadm@DESKTOP-ABF8GII:2.BEEGOL_V4 $ python3
Python 3.6.8 (default, Nov 10 2021, 06:50:23)
[GCC 8.5.0 20210514 (Red Hat 8.5.0-3.0.2)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> sys.version
'3.6.8 (default, Nov 10 2021, 06:50:23) \n[GCC 8.5.0 20210514 (Red Hat 8.5.0-3.0.2)]'
>>> quit()
[11:52:31] nsvcadm@DESKTOP-ABF8GII:2.BEEGOL_V4 $ pip3 --version
pip 21.3.1 from /usr/local/lib/python3.6/site-packages/pip (python 3.6)

Installed Python packages/modules

[11:52:43] nsvcadm@DESKTOP-ABF8GII:2.BEEGOL_V4 $ pip3 list
Package              Version
-------------------- -------
ansible              2.9.4
argon2-cffi          21.3.0
argon2-cffi-bindings 21.2.0
async-generator      1.10
attrs                21.4.0
backcall             0.1.0
bleach               4.1.0
cffi                 1.15.0
cryptography         36.0.1
dataclasses          0.8
dbus-python          1.2.4
decorator            4.2.1
defusedxml           0.7.1
entrypoints          0.4
gpg                  1.13.1
importlib-metadata   4.8.3
iniconfig            1.1.1
ipykernel            5.5.6
ipython              7.16.1
ipython-genutils     0.2.0
ipywidgets           7.6.5
isc                  2.0
jedi                 0.15.1
Jinja2               3.0.3
jsonschema           3.2.0
jupyter              1.0.0
jupyter-client       7.1.2
jupyter-console      6.4.0
jupyter-core         4.9.1
jupyterlab-pygments  0.1.2
jupyterlab-widgets   1.0.2
libcomps             0.1.16
MarkupSafe           2.0.1
mistune              0.8.4
nbclient             0.5.9
nbconvert            6.0.7
nbformat             5.1.3
nest-asyncio         1.5.4
notebook             6.4.8
packaging            21.3
pandocfilters        1.5.0
parso                0.5.1
pexpect              4.3.1
pickleshare          0.7.5
pip                  21.3.1
pluggy               1.0.0
ply                  3.9
prometheus-client    0.13.1
prompt-toolkit       3.0.5
ptyprocess           0.5.2
py                   1.11.0
pycparser            2.21
Pygments             2.11.2
pyparsing            3.0.7
pyrsistent           0.18.0
pytest               7.0.1
python-dateutil      2.6.1
PyYAML               6.0
pyzmq                22.3.0
qtconsole            5.2.2
QtPy                 2.0.1
rpm                  4.14.3
Send2Trash           1.8.0
setuptools           39.2.0
six                  1.11.0
terminado            0.12.1
testpath             0.5.0
tomli                1.2.3
tornado              6.1
traitlets            4.3.3
typing_extensions    4.0.1
wcwidth              0.2.5
webencodings         0.5.1
wheel                0.37.1
widgetsnbextension   3.5.2
zipp                 3.6.0

XSLT was made for this job

I'm aware you cannot do everything, but a whole lot. Generate DTD schemas per version, run a diff and build your XLST based on that. Will save you a whole lot hassle instead of going case by case.

Zabbix template compatibility issue.

Hello Team,

We are using zabbix version 4.0.7 and want to monitor our postgresql DB over zabbix.
We followed the link Postgresql monitoring using zabbix

But when we are trying to import the template we are getting error
Invalid tag "/zabbix_export/version": unsupported version number.
Then i changed the zabbix version manually in template and replace 4.2 with 4.0 the i got below error:

Invalid tag "/zabbix_export/templates/template(1)": unexpected tag "tags".

When we tried to convert this template into zabbix version 4.0.7 using zabbix-template-converter we are getting error:

Traceback (most recent call last):
  File "/usr/local/bin/zabbix-template-converter", line 343, in <module>
    __main__()
  File "/usr/local/bin/zabbix-template-converter", line 333, in __main__
    rule.apply()
  File "/usr/local/bin/zabbiYpx-template-converter", line 82, in apply
    raise ValueError('Unsupported output version: %s' % self.version)
ValueError: Unsupported output version: 4.0.7

You can download the template for version 4.2 from below link
db template 4.2
Can you please help me how we can convert zabbix 4.2 template into zabbix 4.0?
Or any other way to monitor postgresql using zabbix?
Any help will be appreciated.

Thanks.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.