Giter Site home page Giter Site logo

mod-influxdb's Introduction

mod-influxdb Build Status Coverage Status

Shinken module for exporting data to an InfluxDB server

The module requires the following:

  • InfluxDB >= 0.9.0
  • Shinken >= 2.4
  • influxdb-python >= 2.0.1

mod-influxdb's People

Contributors

abondis avatar aviau avatar cyberflow avatar dgilm avatar fpeyre avatar titilambert avatar vfournier11 avatar

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

mod-influxdb's Issues

Metric name, spaces inside name should be removed ...

Metric name in the perfdata may include space character if you have some metrics as of : 'Pages printed'=15c

It should be interesting to remove all the space characters before storing the metric name in Influx ?

unbalanced quotes

when shinken sends an event to influxdb I always get the error message 'unbalanced quotes'

[1438808575] ERROR: [broker-master] [influxdb broker] 400: unable to parse 'EVENT,event_type=NOTIFICATION,host_name=host1,service_description=_self_ contact="admin",notification_method="notify-host-by email",notification_type="HOST",output="Host down': unbalanced quotes                                                                                    
[1438808575] ERROR: [broker-master] [influxdb broker] Sending data Failed. Buffering state : 11 / 300

any idea why ? I can see output doesn't have the right quotes, but I can't find in the code what would do that. I tried something like output="{}".format(data['output']) but no luck.

release last version to shinken

Hello,
Could you release last version (after commit 03c1051) to shinken modules for get ability install module by shinken cli.

Thanks.

Humand Readable date in influxDB register

Hi,

I'm not sure to completly understading what is happen to me but, maybe is not my fault.
In my InfluxDB, every entry is the DB got a date like this "1970-01-01T00:00:01.447302965Z"
Is this normal ? I've skipped something?

Thanks !

Also use the check command_name to store in series

As explained between us and confirmed by influxdb people :
we should also use the check_command in the serie names we use to store the check metrics results.

So the serie name scheme becomes :
"metric_%s_%s" % (command_name, metric_name)

[Feature Request] Please add prefix configuration

It would be really usefull if you can define a prefix (optional) at plugin configuration: prefix.host.service. It would fit better when you store data from different broker sources (the prefix would be the id of the site/implementation/area/realm etc.).

Merge alerts

Please merge service alerts

  • www.cibc.com.www.cibc.com.events.ALERT
  • www_cibc_com.www_cibc_com.events.alerts
    to
    www_cibc_com.www.cibc.com.events.ALERT

and host alerts

  • www_cibc_com.events.alerts
  • www_cibc_com.events.ALERT
    to
    www_cibc_com.events.ALERT

Also be aware of www.cibc.com must be www_cibc_com

nanosecond timestamps?

Shinken/influxdb/grafana newbie here.

I'm trying to get the combo to work but noticed that data ingested into influxdb have timestamps in seconds instead of nanoseconds and it's probably the reason I couldn't get grafana to plot anything useful for the metric_* series.

Running:

  • influxdb-0.10.3-1.x86_64
  • grafana-2.6.0-1.x86_64
  • Shinken 2.4.3
  • mod-influxdb installed via shinken CLI.

[Shinken] Bad module file for /var/lib/shinken/modules/mod-influxdb/module.py

Module v1.0 from shinken.io

[1426316628] WARNING: [Shinken] Bad module file for /var/lib/shinken/modules/mod-influxdb/module.py : cannot check its properties['daemons'] attribute : 'module' object has no attribute 'properties'
[1426316628] WARNING: [Shinken] The module type influxdb-perfdata for influxdb was not found in modules!

Module doesn't work with shinken 2.0.3 (logevent.py is not present)

Hi,

The module doesn't work with stable shinken (2.0.3) because the module shinken/misc/logevent.py is not present on the system:

https://github.com/savoirfairelinux/mod-influxdb/blob/master/module/module.py#L37
https://github.com/naparuba/shinken/tree/2.0.3/shinken/misc

The problem is that the shinken.io version of the module is also affected. So there is no stable influxdb module suitable if you want to work with the stable version of shinken.

Dublicate EVENT from passive checks

In scheduler.log:

[1461664767] PASSIVE SERVICE CHECK: host1;service1;2;message
[1461664769] SERVICE ALERT: host1;service1;CRITICAL;HARD;1;message

In influxdb:

name: EVENT
-----------
time            attempts    event_type  host_name   output                                              service_description state       state_type  alert_type
1461664767000000000         ALERT       host1   message     log_event       CRITICAL    HARD
1461664769000000000 1       ALERT       host1   message\n   log_event       CRITICAL    HARD        SERVICE

Field type conflict

Hi,

While playing around with InfluxDB and mod-influxdb to fill it with data from Shinken I've encountered a problem when filling it with ping data.
As you may or may not know, the type of a field in InfluxDB is defined by the first value written to it. (source) And this is where the problems start, because there is no standardized way that mod-influxdb writes data to the database, it's possible to get conflicts. In my case there are a bunch of hosts that are unreachable and thus the ping plugin (check_ping from nagios-plugins) returns a big number, which sets the field type to int64. Now my next host is actually online and returns a float. (24.78ms for example) When it tries to write this data, it gives a field type conflict.
I've come up with an ugly hack to work around this, but because testing of this hack is very limited, I have no idea if it will conflict with other nagios plugins.
In module.py at line 105 replace the for in statement with this one:

for mapping in fields_mappings:
    if 'value' in mapping:
        value = float(getattr(e, mapping[0], None))
    else:
        value = getattr(e, mapping[0], None)
    if value is not None:
        if 'value' in mapping:
            fields[mapping[1]] = float(value)
        else:
            fields[mapping[1]] = value

What this does is check if the data that's about to be written is going to be written to the field "value". If it is, it makes the value a float.

I don't think this is a permanent fix for this problem, feel free to suggest something that would work better! (hopefully more compatible too)

An hypothetic metric named "ALERT" would conflict with our "ALERT" related serie name..

Given that we store the metrics from the check commands directly in influx, in a serie whose name is exactly the one of the metric :

this normally prohibits us from using any other serie name for anything else because there is no restriction on a metric name (which would be a pity) (as far as it's a valid identifier eventually ?)

but we already need the "ALERT" serie to store the hosts & services state changes so we have a problem houston.

If we prefix every serie corresponding to a metric by say "metric_" then problem is gone.

How to check if it's work

Hello,

I'm testing your module with a fresh install of shinken. I have set only one host on my shinken for test purpose. After configuration of your plugins, how to check if it's works ?

I have set process_perfdata on shinken config, added the module on broker.conf, and then, no logging information on broker.log (execpt this : Correctly loaded mod-influxdb as a very-new-style shinken module :) )

Next, i can't see any data on influxdb (with a tcpdump or a query).
Do you have any method to check if all is fine ?

Thanks in advance, and thanks for your module !

Regards.

Exception on host_name

I had a problem after a bad restart of my Shinken and as a side effect I got many exceptions in the module :

[1432292887] WARNING: [broker-master] Back trace of this kill: Traceback (most recent call last):
  File "/usr/local/lib/python2.7/site-packages/Shinken-2.4_rc4-py2.7.egg/shinken/daemons/brokerdaemon.py", line 276, in manage_brok
    mod.manage_brok(b)
  File "/usr/local/lib/python2.7/site-packages/Shinken-2.4_rc4-py2.7.egg/shinken/basemodule.py", line 243, in manage_brok
    return manage(brok)
  File "/usr/local/libexec/shinken/modules/mod-influxdb/module.py", line 215, in manage_host_check_result_brok
    "address": self.host_config[host_name]['address'],
KeyError: u'lachassagne'

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.