Results 1 to 6 of 6

Thread: [SOLVED] Alert history

  1. #1

    [SOLVED] Alert history

    Hello everyone, I am using Shinken 1.2 with Thruk 1.60
    I want to use mongologs for livestatus reporting, but I get internal server error when fetching the url

    There is my configuration :
    Code:
    #===============================================================================
    # BROKER (Broker-master)
    #===============================================================================
    define broker {
      broker_name   Broker-master
      address     IP1
      port      7772
      spare      0
      manage_arbiters   1  ; Take data from Arbiter. There should be only one
                  ; broker for the arbiter.
      manage_sub_realms  0  ; Does it take jobs from schedulers of sub-Realms?
      timeout       3  ; Ping timeout
      data_timeout    120 ; Data send timeout
      max_check_attempts 3  ; If ping fails N or more, then the node is dead
      check_interval   60 ; Ping node every N seconds
      modules   Livestatus, Simple-log, WebUI,NPCDMOD
      realm  France
    }
    
    
    define module {
      module_name   Livestatus
      module_type   livestatus
      host      *      ; * = listen on all configured IP addresses
      port      50000    ; port to listen
      #socket     /usr/local/shinken/var/rw/live ; If a Unix socket is required
      ## Available modules:
      # - logsqlite: send historical logs to a local sqlite database
      # - mongologs: send historical logs to a mongodb database
      # - nulllogs : send historical logs to a black hole
      modules    mongologs
      debug      /tmp/ls.debug  ; Enable only for debugging this module
      debug_queries  1  ; Set to 1 to dump queries/replies too (very verbose)
    }
    
    define module {
      module_name   mongologs
      module_type   logstore_mongodb
      mongodb_uri   mongodb://IP1,IP2/?safe=true
      # If you are running a MongoDB cluster (called a replica set in MongoDB),
      # you need to specify it's name here.
      # With this option set, you can also write the mongodb_uri as a comma-separated
      # list of host:port items. (But one is enough, it will be used as a seed)
      replica_set     rs0
      database      livestatusLogs
      #collection
      max_logs_age    3m
    }
    I wonder if this is a version related bug or if I have done something wrong in my configuration.

    Thanks !

    David

  2. #2
    Administrator
    Join Date
    Jun 2011
    Posts
    216

    Re: Alert history

    Well it,s a thruk error... Without looking at the log I suggest you to update your thruk, the last release is 1.72.

    Now, regarding your logs, it looks like it's more related to host/services configuration not the broker one

  3. #3

    Re: Alert history

    I just updated thruk to 1.72 and I am still getting the same error.
    I am going to try to update shinken to latest version and will keep you updated

    David

  4. #4

    Re: Alert history

    Hi Jean, Seb.
    I posted my problem on Thruk google group, here's the link: https://groups.google.com/forum/#!topic/thruk/hxbv1Qmp69g

    It looks like the problem is livestatus-shinken related
    This raises an error:
    Code:
    echo GET log | nc shinkenIp 50000
    
    Livestatus debug:
    
    Traceback (most recent call last):
     File "/usr/local/shinken/shinken/modules/livestatus_broker/livestatus_query.py", line 307, in launch_query
      result = self.get_live_data_log(cs)
     File "/usr/local/shinken/shinken/modules/livestatus_broker/livestatus_query.py", line 614, in get_live_data_log
      firstdb = [x for x in self.db.get_live_data_log()]
     File "/usr/local/shinken/shinken/modules/logstore_mongodb.py", line 266, in get_live_data_log
      logger.debug("[LogStoreMongoDB] Mongo filter is" % mongo_filter)
    TypeError: not all arguments converted during string formatting
    What do you think ?

    David

  5. #5
    Administrator
    Join Date
    Jun 2011
    Posts
    216

    Re: Alert history

    The line is obviously wrong :

    logger.debug("[LogStoreMongoDB] Mongo filter is" % mongo_filter)

    you give mongofilter as parameter but you don't use it. try to add a %s somewhere

  6. #6

    Re: Alert history

    Hi everyone, I just updated to Shinken 1.4 and it seems to have solved the problem. As Jorg Kottman told me, discussion https://groups.google.com/forum/#!to...uk/hxbv1Qmp69g, the problem was version 1.2 and before related and has been fixed since.

    Thanks for your help

    David

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •