Coder Social home page Coder Social logo

allenta / zabbix-template-for-redis Goto Github PK

View Code? Open in Web Editor NEW
39.0 12.0 21.0 219 KB

Zabbix template + script useful to monitor Redis Server & Redis Sentinel instances

License: Other

Python 18.91% Jinja 81.09%
zabbix zabbix-templates redis redis-server redis-sentinel

zabbix-template-for-redis's Introduction

This is a Zabbix template + script useful to monitor Redis Server & Redis Sentinel instances:

  1. Copy zabbix-redis.py to /usr/local/bin/.
  2. Add the redis_server.discovery & redis_server.stats and / or redis_sentinel.discovery & redis_sentinel.stats user parameters to Zabbix:

    UserParameter=redis_server.discovery[*],/usr/local/bin/zabbix-redis.py -i '$1' -t server discover $2 2> /dev/null
    UserParameter=redis_server.stats[*],/usr/local/bin/zabbix-redis.py -i '$1' -t server stats 2> /dev/null
    UserParameter=redis_sentinel.discovery[*],/usr/local/bin/zabbix-redis.py -i '$1' -t sentinel discover $2 2> /dev/null
    UserParameter=redis_sentinel.stats[*],/usr/local/bin/zabbix-redis.py -i '$1' -t sentinel stats 2> /dev/null
  3. Import the templates. You may download the appropriate versions from the releases page or generate them using the Jinja2 skeletons:

    $ pip install jinja2-cli
    $ PYTHONPATH=. jinja2 \
        -D version={6.0,6.2,6.4} \
        [-D name='Redis Server'] \
        [-D description=''] \
        [-D release='trunk'] \
        --extension=extensions.zabbix.ZabbixExtension --strict -o template.xml template-app-redis-server.j2
    $ PYTHONPATH=. jinja2 \
        -D version={6.0,6.2,6.4} \
        [-D name='Redis Sentinel'] \
        [-D description=''] \
        [-D release='trunk'] \
        --extension=extensions.zabbix.ZabbixExtension --strict -o template.xml template-app-redis-sentinel.j2
  4. Link hosts to the templates. Beware depending on the used template you must set a value for the {$REDIS_SERVER.LOCATIONS} or {$REDIS_SENTINEL.LOCATIONS} macro (comma-delimited list of Redis instances; port, host:port and unix:///path/to/socket formats are allowed). Additional macros and contexts are available for further customizations.

zabbix-template-for-redis's People

Contributors

carlosabalde avatar davidfb avatar moisesrg 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

Watchers

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

zabbix-template-for-redis's Issues

Can you clarify what the "eps" unit is?

Just trying to understand what I'm seeing in my graphs. I see that this is taking a Delta from the last reading. I'm assuming it's "executions per second" or something of that nature?

redis_server.info key missing?

Seems like a very well thought through template for redis. I'm a bit confused though.. the templates reference keys redis_server.info and redis_sentinel.info, that aren't defined in the zabbix agent configuration file. Is there something I don't understand here?

Specific instructions needed

Hi, thanks for your template, looks good! But I don't really know where should I add the parameters, server? agent ? where? Could you provide better instructions? Thanks

error running python code

Hi
when I use your script to monitor redis,I get this error:
/usr/local/bin/zabbix-redis.py -i '6379, 6380, 6381, 7000, 7001, 7002, 7003, 7004, 7005' -t server send -c /etc/zabbix/zabbix_agentd.conf -s dev

Traceback (most recent call last):
File "/usr/local/bin/zabbix-redis.py", line 380, in
main()
File "/usr/local/bin/zabbix-redis.py", line 376, in main
globals()options.command
File "/usr/local/bin/zabbix-redis.py", line 101, in send
items = stats(instance, options.redis_type)
File "/usr/local/bin/zabbix-redis.py", line 240, in stats
sys.stderr.write(output)
TypeError: write() argument must be str, not bytes

can you help me?
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.