Giter VIP home page Giter VIP logo

zabbix-gnomes's People

Contributors

i-ky avatar q1x avatar rschaten 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  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 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

zabbix-gnomes's Issues

The period of zgetgraph.py is not set.

Hi Raymond,

I gave you the following options.
Option : -t 1575417600 -t 86400
However, only the graph of the last one hour is checked.
I need your help.

Zabbix version : Zabbix Server 4.0

zgetinventory and --all-hosts not working

Do all of the hosts need to be in a specific host group for this to work? I get no results when using --all-hosts -A as the flags. I see that it is using the api to do a zapi.host.get() for the --all-hosts flag and when I user zapi.py interactviely and perform a "z host.get()" it works fine.

Python version

Hello,
I tried using the scripts but in openSUSE, but most did not work. Only they started to run after them performed with python3 and some adjustments in the code (indented with autopep8 and repair of ConfigParser).
Is there any version for python3?

Thank you.

Strange behaviour with Zabbix 3.4.5

Hi,
I have a problem with a fresh installation of Zabbix and Zabbix Gnomes:

Here is a screen copy of Host groups. SYS_Linux & Zabbix_servers Linux have the same hosts.
image

[zabbix@SLT00795 zabbix-gnomes]$ /home/zabbix/zabbix-gnomes/zversion.py
3.4.5
[zabbix@SLT00795 zabbix-gnomes]$ /home/zabbix/zabbix-gnomes/zghostfinder.py "Zabbix_servers Linux"
slt00795
slt00797
slt00762
slt00761
slt00798
slt00801
slt00760
[zabbix@SLT00795 zabbix-gnomes]$ /home/zabbix/zabbix-gnomes/zghostfinder.py "SYS_Linux"
Error: Could not find hostgroup "SYS_Linux"
[zabbix@SLT00795 zabbix-gnomes]$ cat /home/zabbix/adminscripts/ListeGroupesHosts.input
z hostgroup.get(output="extend")
exit
[zabbix@SLT00795 zabbix-gnomes]$ /home/zabbix/zabbix-gnomes/zapi.py < /home/zabbix/adminscripts/ListeGroupesHosts.input | grep "'name'"
zapi: [{u'flags': u'0', u'groupid': u'1', u'internal': u'0', u'name': u'Templates'},
u'name': u'Discovered hosts'},
u'name': u'Virtual machines'},
u'name': u'Hypervisors'},
u'name': u'TEM_Templates_de_base'},
u'name': u'Zabbix_servers Linux'}]

zghostfinder find one group but no the other ! Very strange ...

Do you have an idea ?
Thanks a lot

CentOS 7.3
Zabbix 3.4.5
PostgreSQL 9.6
Python 2.7
pyzabbix 0.74
Last version of Zabbix Gnomes

URL handling failure when API is specified within .zbx.conf

When specifying API configuration details within a .zbx.conf file, all zabbix-gnomes scripts result in one of the errors specified below.

When "api=" is specified with a protocol (http://zabbix.website.com) as per the documentation, this error is received:

Traceback (most recent call last):
File "./zhostfinder.py", line 114, in
zapi.login(username, password)
File "/usr/lib/python2.7/site-packages/pyzabbix/init.py", line 68, in login
self.auth = self.user.login(user=user, password=password)
File "/usr/lib/python2.7/site-packages/pyzabbix/init.py", line 156, in fn
args or kwargs
File "/usr/lib/python2.7/site-packages/pyzabbix/init.py", line 101, in do_request
timeout=self.timeout
File "/usr/lib/python2.7/site-packages/requests/sessions.py", line 507, in post
return self.request('POST', url, data=data, json=json, **kwargs)
File "/usr/lib/python2.7/site-packages/requests/sessions.py", line 464, in request
resp = self.send(prep, **send_kwargs)
File "/usr/lib/python2.7/site-packages/requests/sessions.py", line 576, in send
r = adapter.send(request, **kwargs)
File "/usr/lib/python2.7/site-packages/requests/adapters.py", line 415, in send
raise ConnectionError(err, request=request)
requests.exceptions.ConnectionError: ('Connection aborted.', gaierror(-2, 'Name or service not known'))

When "api=" is specified withOUT a protocol (zabbix.website.com), this error is received:

Traceback (most recent call last):
File "./zhostfinder.py", line 114, in
zapi.login(username, password)
File "/usr/lib/python2.7/site-packages/pyzabbix/init.py", line 68, in login
self.auth = self.user.login(user=user, password=password)
File "/usr/lib/python2.7/site-packages/pyzabbix/init.py", line 156, in fn
args or kwargs
File "/usr/lib/python2.7/site-packages/pyzabbix/init.py", line 101, in do_request
timeout=self.timeout
File "/usr/lib/python2.7/site-packages/requests/sessions.py", line 507, in post
return self.request('POST', url, data=data, json=json, **kwargs)
File "/usr/lib/python2.7/site-packages/requests/sessions.py", line 450, in request
prep = self.prepare_request(req)
File "/usr/lib/python2.7/site-packages/requests/sessions.py", line 381, in prepare_request
hooks=merge_hooks(request.hooks, self.hooks),
File "/usr/lib/python2.7/site-packages/requests/models.py", line 304, in prepare
self.prepare_url(url, params)
File "/usr/lib/python2.7/site-packages/requests/models.py", line 361, in prepare_url
"Perhaps you meant http://{0}?".format(url))
requests.exceptions.MissingSchema: Invalid URL u'zabbix.website.com/api_jsonrpc.php': No schema supplied. Perhaps you meant http://zabbix.website.com/api_jsonrpc.php?

I am able to connect successfully by either passing all authentication variables as command line arguments. I can also connect by pulling username & password from $HOME/.zbx.conf and passing the API URL as a command line argument. This would seem to suggest that there is a formatting issue with the api variable when retrieved from ini-style configuration files, rather than an environment-specific issue on my part, however I could easily be wrong and I do not have a ton of time to troubleshoot ATM ( I will update if I am able w/ additional info).

For example:

# ./zhostfinder.py -uzabbixUser -pzabbixPassword ahttp://zabbix.website.com -m -S foo
Error: Could not find any hosts matching "foo"

# ./zhostfinder.py -c $HOME/.zbx.conf -ahttp://zabbix.website.com  -m -S foo
Error: Could not find any hosts matching "foo"

The instance I am using does not use SSL to connect, so my $HOME/.zbx.conf looks like this:

[Zabbix API]
username=johndoe
password=verysecretpassword
api=http://zabbix.mycompany.com
no_verify=true

Error occurs with and without trailing / on api url and with or without the inclusion of the irrelevant-for-me no_verify flag.

Error occurs in CentOS 7 with Python 2.7.5 with th following modules installed:

ansible==2.4.0
ansible-cmdb==1.20
ansible-shell==0.0.5
ansible-toolkit==1.3.2
asn1crypto==0.22.0
backports.ssl-match-hostname==3.4.0.2
bcrypt==3.1.3
cffi==1.10.0
chardet==2.2.1
cryptography==1.9
decorator==3.4.0
enum34==1.1.6
idna==2.5
iniparse==0.4
ipaddr==2.1.11
ipaddress==1.0.18
Jinja2==2.9.6
jsonxs==0.4
Mako==1.0.7
MarkupSafe==1.0
paramiko==2.2.1
passlib==1.7.1
pyasn1==0.2.3
pycparser==2.18
pycurl==7.19.0
pygobject==3.22.0
pygpgme==0.3
pyliblzma==0.5.3
PyNaCl==1.1.2
pyparsing==1.5.6
pyxattr==0.5.1
PyYAML==3.12
pyzabbix==0.7.4
requests==2.6.0
Runner==1.1
six==1.10.0
slip==0.4.0
slip.dbus==0.4.0
urlgrabber==3.10
urllib3==1.10.2
ushlex==0.99
yum-metadata-parser==1.1.4
zabbix-api==0.4
zabbix-cli==1.7.0

Getting error when I run zgetinventory.py on certain hostgroups

When I run this on my "Elastic Search" hostgroup I get this error:

./zgetinventory.py --hostgroups "Elastic Search" -F "software"
"id","host","software"
"12522","nw-es-201","2.4.0"
"12523","nw-es-202.prod.pcln.com","2.4.0"
"12524","nw-es-203.prod.pcln.com","2.4.0"
"12525","nw-es-204.prod.pcln.com","2.4.0"
"12526","nw-es-205.prod.pcln.com","2.4.0"
"13493","ny-es-001.prod.pcln.com","2.4.0"
"13494","ny-es-002.prod.pcln.com","2.4.0"
"13495","ny-es-003.prod.pcln.com","2.4.0"
"13550","ny-esclient-001.prod.pcln.com","2.4.0"
"13580","nw-esclient-201.prod.pcln.com","2.4.4"
"13655","nw-esmaster-201.prod.pcln.com","2.4.0"
"13656","nw-esmaster-202.prod.pcln.com","2.4.0"
"13657","nw-esmaster-203.prod.pcln.com","2.4.0"
Traceback (most recent call last):
File "./zgetinventory.py", line 305, in
row.append(host['inventory'][field])
TypeError: list indices must be integers, not str

Is this project supported zabbix 4.0?

I can import templates on the web side, but with ztmplimport.py I get an error.

Error: Something went wrong while importing /home/ftpuser/confluencebak.xml Error -32602: Invalid params., Invalid parameter "/rules/applications": unexpected parameter "updateExisting".
Could you please take a look at it for me?

LogIn with API

Hi,

Since few days , I have a strange error with login API :
Traceback (most recent call last):
File "./zhostfinder.py", line 114, in
zapi.login(username, password)
TypeError: 'ZabbixAPIObjectClass' object is not callable

Any Ideas ?
Thx

zgdelete.py no delete groups

Hi Raymond,

I've tested the zgdelete.py but there is no delete with an existing group , the message is

Error: No hostgroups to delete

RFE : manipulating maps

Hi Raymond,
Just tested zabbix-gnomes and "it just works [TM]" :-)
It does what I was searching for : adding/modifying groups, adding/removing group membership for hosts, link/unlinking templates.
Was just wondering (so RFE, not a bug fix) if you had plan on adding the maps creation/modification in zabbix-gnomes ?
Thanks a lot

Bug in master ,

Inconsistent tabs and configparser module import is incorrect in script zhostfinder.py with Python version 3.10. Please correct it

Traceback (most recent call last):
File "C:\Users\hashim1\OneDrive - Intel Corporation\Desktop\workspace\zabbix\zabbix-gnomes\zhostfinder.py", line 7, in
import ConfigParser
ModuleNotFoundError: No module named 'ConfigParser'

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.