Git Product home page Git Product logo

sauna's People

Contributors

bewiwi avatar bubu11e avatar geoffreybauduin avatar kaseifr avatar nicolaslm avatar rbeuque74 avatar thbkrkr avatar wayt avatar

Stargazers

 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

sauna's Issues

Sauna doesn't always exit when dependencies are not installed

When plugin or consumer dependencies are not installed, sauna prints a message and exits. Sometimes however it prints the message and does not exit, it just hangs, waiting for a ^C:

root@a7864fef64e6:/# sauna
HTTPConsumer depends on requests. It can be installed with:
    pip install requests
    apt-get install python3-requests

Memory depends on psutil. It can be installed with:
    pip install psutil
    apt-get install python3-psutil

^CException ignored in: <module 'threading' from '/usr/lib/python3.4/threading.py'>
Traceback (most recent call last):
  File "/usr/lib/python3.4/threading.py", line 1294, in _shutdown
    t.join()
  File "/usr/lib/python3.4/threading.py", line 1060, in join
    self._wait_for_tstate_lock()
  File "/usr/lib/python3.4/threading.py", line 1076, in _wait_for_tstate_lock
    elif lock.acquire(block, timeout):
KeyboardInterrupt

It must be a race condition somewhere.

Reuse HTTP session (make it configurable)

To improve HTTP request performance, you should avoid re-opening a new HTTP session each time (or at least add an option to make this configurable). With requests, instead of calling requests.request, you could create a Session object and keep it open for each call.

PGSQL Query based alert

I was wondering how to implement alerts based on a PostgreSQL query.
My need here is to trigger a critical status if I have an entry older than XXX in my database.

Would a PostgresSQL plugin with custom query support be relevant ?
Or is it too specific, and I should use the command plugin ?

Publish current version

Hi,

Could you publish the current version on pypi? The last version dates from august.

Thanks

Have a PPA for Sauna

Sauna is extremely useful for monitoring hosts with OVH Shinken as a Service. It is installed on each host or VM that is monitored.

If installing it is easy thanks to the .deb, upgrading it on each and every monitored host is a real pain.

Would it be possible to offer a PPA (Personal Package Archive) for Sauna ? (so that upgrades would be done automatically)

Release 0.0.18

It's possible to release new version with dashboard ?

Concurrency seems to break non-concurrent behaviour

I tried to run sauna with the latest docker image (and the latest commit from master) and I can't get it to start with concurrency: 1

Conf used :

---                                                                
periodicity: 10                                                    
concurrency: 1                                                     
hostname: dev-timothee                                             
                                                                   
consumers:                                                         
  # Listen on a TCP port and serve results to incoming connections 
  - type: TCPServer                                                
    port: 55555                                                    
  # Just prints checks on the standard output                      
  - type: Stdout                                                   
  # HTTP Server that exposes sauna status as a REST API
  - type: HTTPServer
    port: 8088

plugins:
  # Fake checks that return the provided
  # status and output
  - type: Dummy
    checks:
      - type: dummy
        status: 0
        output: Everything is alright

result :

$  sauna --level debug
2017/01/09 15:55:42 - INFO     - Running checks with interval: {10}
2017/01/09 15:55:42 - DEBUG    - Running consumer TCPServer
2017/01/09 15:55:42 - DEBUG    - Scheduler has 1 ticks, each one is 10 seconds
2017/01/09 15:55:42 - DEBUG    - Tick 0, scheduled [<Job launch_and_publish_checks_with_periodicity every 10 seconds>]
2017/01/09 15:55:42 - DEBUG    - Pushing to consumers: dummy_dummy
Exception in thread producer:
Traceback (most recent call last):
  File "/home/admin/.pyenv/versions/3.5.2/lib/python3.5/threading.py", line 914, in _bootstrap_inner
    self.run()
  File "/home/admin/.pyenv/versions/3.5.2/lib/python3.5/threading.py", line 862, in run
    self._target(*self._args, **self._kwargs)
  File "/home/admin/dev/sauna/sauna/__init__.py", line 331, in run_producer
    for _ in scheduler:
  File "/home/admin/dev/sauna/sauna/scheduler.py", line 54, in __next__
    job()
  File "/home/admin/dev/sauna/sauna/scheduler.py", line 97, in __call__
    self.func(*self.func_args, **self.func_kwargs)
  File "/home/admin/dev/sauna/sauna/__init__.py", line 291, in launch_and_publish_checks_with_periodicity
    self._check_helper(check)
  File "/home/admin/dev/sauna/sauna/__init__.py", line 302, in _check_helper
    self._current_checks.remove(service_check.name)
ValueError: list.remove(x): x not in list

2017/01/09 15:55:42 - DEBUG    - [StdoutConsumer] Got check ServiceCheck(timestamp=1483977342, hostname='dev-timothee', name='dummy_dummy', status=0, output='Everything is alright')
ServiceCheck(timestamp=1483977342, hostname='dev-timothee', name='dummy_dummy', status=0, output='Everything is alright')
2017/01/09 15:55:42 - DEBUG    - Running consumer Stdout
2017/01/09 15:55:42 - DEBUG    - Running consumer HTTPServer
2017/01/09 15:55:42 - INFO     - Exiting...
2017/01/09 15:55:42 - INFO     - [StdoutConsumer] Check sent
2017/01/09 15:55:42 - DEBUG    - [StdoutConsumer] Exited consumer thread
2017/01/09 15:55:43 - DEBUG    - [HTTPServerConsumer] Exited consumer thread
2017/01/09 15:55:43 - DEBUG    - [TCPServerConsumer] Exited consumer thread
2017/01/09 15:55:43 - DEBUG    - Exited main thread

It's seems to be related to this line :
https://github.com/NicolasLM/sauna/blob/master/sauna/__init__.py#L300

What I try to make it work :

Check if the service is in the _current_check list before trying to remove it

with self._current_checks_lock:                    
    if service_check.name in self._current_checks:
        self._current_checks.remove(service_check.name)

It seems to work

Plugin http-json expects a string or a buffer

Hi,

I'm using the plugin http-json to expect the integer value 0 as a result after json extraction.

- type: HTTP-JSON
  checks:
    - type: request
      name: check_1234
      url: http://<check_endpoint>
      verify_ca_crt: false
      method: GET
      code: 200
      expect: "0"
      success_jsonpath: '$.value'
      error_jsonpath: '$..*'
      timeout: 5000
      warn: 1000
      crit: 5000

The <check_endpoint> returns the json response: {value:0}.

sauna fails with the error: expected string or buffer.

See: https://github.com/NicolasLM/sauna/blob/master/sauna/plugins/ext/http_json.py#L54

The value parameter given to regex.match must be a string or a buffer.

I think a fix could be to force the string conversion?

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.