Page 1 of 2 12 LastLast
Results 1 to 10 of 14

Thread: [RESOLVED] SnmpBooster hook_late_configuration not happening?

  1. #1

    [RESOLVED] SnmpBooster hook_late_configuration not happening?

    Hey there,

    as usual I'm struggling to get SnmpBooster to work
    I don't see the hook_late_configuration procedure being called, thus hosts are never going to the memcache area.
    On LiveStatus and logs all I see is: Host not found in memcache: `SW01'

    I thought to have followed all the wiki setup_snmp_booster_module but still don't know what's going on.

    In the logs see the SnmpBooster module to be loaded in the arbiter, scheduler and poller.

    Is there any way to call hook_late_configuration after the daemons are running?

  2. #2
    Administrator
    Join Date
    Dec 2011
    Posts
    278

    Re: SnmpBooster hook_late_configuration not happening?

    Did you run scheduler, poller and arbiter with debugging on?

    Next do a simple filter on the logs to get the SnmpBooster tagged messages. Attach them to this email thread. I will take a look.

    The hook call is part of Shinken itself and calls the snmp_booster.py hook module automagically.

    Are you using the latest version of snmp_booster from last year?

    Is your memcache running on the expected port and IP.

    The logs should tell us what is going on.

    Is your check command specifying the module with the correct syntax in addition to the command and arguments?

    Cheers,

    xkilian

    ps. We will strive to make this an easier process, anything we can improve we will!

  3. #3
    Administrator
    Join Date
    Dec 2011
    Posts
    278

    Re: SnmpBooster hook_late_configuration not happening?

    To answer your question:

    hook_late_configuration is only called once when the arbiter is done loading base the configuration.

    There is no means to update the configuration. We could expose it to shinken-admin, but I am not sure what that will buy us exactly as it will not be in sync with what the scheduler uses as a configuration.

    Cheers,

    xkilian

  4. #4

    Re: SnmpBooster hook_late_configuration not happening?

    Hi, step by step:

    [quote author=xkilian link=topic=766.msg4251#msg4251 date=1360256827]
    Did you run scheduler, poller and arbiter with debugging on?
    [/quote]

    I'm doing a "service shinken -d restart" always, I believe this makes everybody to be in debug mode.

    [quote author=xkilian link=topic=766.msg4251#msg4251 date=1360256827]
    Next do a simple filter on the logs to get the SnmpBooster tagged messages. Attach them to this email thread. I will take a look.
    [/quote]

    For each log in shinken/var:

    var/arbiter-debug.log
    no messages

    var/arbiterd.log
    no messages

    var/broker-debug.log
    no messages

    var/brokerd.log
    errors about missing pysnmp module, several hours ago (before I remembered easy_install pysnmp)
    no recent errors

    var/pollerd-debug.log
    every few minutes one message like this (yes, the next message comes over it)
    [1360257218] Debug : Wait ratio: 1.9842257074] Error : [SnmpBooster] Host not found in memcache: SW01
    sometimes one like this
    [snmp_poller] Stats: Workers:1 (Queued:3 TotalReturnWait:1)
    hundreds of messages like this, from line 739:
    [1360257077] Error : [SnmpBooster] Host not found in memcache: SW01

    var/pollerd.log
    also lots of hundreds of messages like this one
    [1360257077] Error : [SnmpBooster] Host not found in memcache: SW01

    var/reactionner-debug.log
    no messages

    var/reactionnerd.log
    same as brokerd.log, no recent messages

    var/receiver-debug.log
    no messages

    var/receiverd.log
    same as broker.dlog

    var/scheduler-debug.log
    hundreds of messages like this one (from line 1399)
    [1360259623] Error : [SnmpBooster] Host not found: SW01
    [1360259624] Debug : hook_point: SnmpBooster: True get_new_actions
    [1360259625] Debug : hook_point: SnmpBooster: True get_new_actions

    var/schedulerd.log:2013-02-07 18:00:28,496 [1360260028] Error : [SnmpBooster] 1399 Host not found: SW01
    var/schedulerd.log:2013-02-07 18:00:29,504 [1360260029] Debug : hook_point: SnmpBooster: True get_new_actions

    [quote author=xkilian link=topic=766.msg4251#msg4251 date=1360256827]
    The hook call is part of Shinken itself and calls the snmp_booster.py hook module automagically.

    Are you using the latest version of snmp_booster from last year?
    [/quote]

    I just downloaded it from a git repo on snmp_booster tree. https://raw.github.com/titilambert/s...snmp_poller.py

    [quote author=xkilian link=topic=766.msg4251#msg4251 date=1360256827]
    Is your memcache running on the expected port and IP.
    [/quote]

    Yes. It's on the same host but using eth0 IP. 10.x.y.z port 11211.

    [quote author=xkilian link=topic=766.msg4251#msg4251 date=1360256827]
    The logs should tell us what is going on.
    [/quote]

    Hope so, I'm glad to help in what I can.

    [quote author=xkilian link=topic=766.msg4251#msg4251 date=1360256827]
    Is your check command specifying the module with the correct syntax in addition to the command and arguments?
    [/quote]

    I copy-pasted them from the wiki page, here it follows:

    etc/snmp-template.cfg ($SNMPCOMMUNITYNETWORKS$ is defined in resource.cfg)
    Code:
    define command {
     command_name  check_snmp_booster
     command_line  check_snmp_booster -H $HOSTNAME$ -C $SNMPCOMMUNITYNETWORKS$ -V 2c -t $ARG1$ -i $_SERVICEINST$ -T $_SERVICETRIGGERGROUP$
     module_type   snmp_poller
    
    } 
    
     define service {
    
     name          default-snmp-template
     check_command      check_snmp_booster!$_SERVICEDSTEMPLATE$!$_SERVICEINST$!$_SERVICETRIGGERGROUP
     _inst          None
     _triggergroup      None
     max_check_attempts   3
     check_interval     1
     retry_interval     1
     register        0
    
    } 
    
    define host{
     name          default-snmp-host-template
     alias          default-snmp-host
     check_command   check_host_alive
     max_check_attempts   3
     check_interval     1
     retry_interval     1
     use           generic-host
     register        0
    
    }
    etc/SNMP has the sample-config from genDevConfig, all files...

    My device is SW01 as generated by genDevConfig (git clone from sha1 ef014b19af9e4ba913283b984564f19042e01964)
    It's on etc/genDevConfig/10.a.b.c.cfg

    Code:
    define host {
      host_name    SW01
      display_name   SW01
      _sys_location  
      address   10.a.b.c
      hostgroups  
      notes  
      parents  
      use     default-snmp-host-template,my_notification_template,my_poller_tag_template
      register   1  
      check_command check-host-alive
      check_period 24x7
    }
    
    define service {
      host_name    SW01
      service_description chassis
      display_name   chassis.generic - 
      _display_order  999 
      _dstemplate   Generic-Device
      _inst    0  
      notes    Juniper Networks, Inc. ex4200-48t blablabla
      use     default-snmp-template
      register   1  
    }
    
    define service {
      host_name    SW01
      service_description chassis.device-traffic
      service_dependencies ,chassis
      display_name   Switch fabric statistics - Packets per Second
      _display_order  998 
      _dstemplate   Device-Traffic
      notes    Switch fabric statistics - Packets per Second
      use     default-snmp-template
      register   1
    }
    On nagios.cfg I have:

    Code:
    # SNMP Booster
    cfg_file=snmp-template.cfg
    cfg_dir=genDevConfig
    And my shinken-specific.cfg has the SnmpBooster defined and loaded on the arbiter, poller and scheduler modules. Just copied from the wiki and correct directory and IP.

    [quote author=xkilian link=topic=766.msg4251#msg4251 date=1360256827]
    Cheers,

    xkilian

    ps. We will strive to make this an easier process, anything we can improve we will!
    [/quote]

    Thanks, I appreciate the effort of everybody, will be glad to help

  5. #5

    Re: SnmpBooster hook_late_configuration not happening?

    [quote author=xkilian link=topic=766.msg4252#msg4252 date=1360257737]
    To answer your question:

    hook_late_configuration is only called once when the arbiter is done loading base the configuration.

    There is no means to update the configuration. We could expose it to shinken-admin, but I am not sure what that will buy us exactly as it will not be in sync with what the scheduler uses as a configuration.

    Cheers,

    xkilian
    [/quote]

    Agreed, I don't see why hook_late would ever be called after loading the configuration.
    I'm happy with some regular "service shinken reload" to push new configuration to the arbiter.
    Cheers!

  6. #6
    Junior Member
    Join Date
    Mar 2013
    Posts
    6

    Re: SnmpBooster hook_late_configuration not happening?

    Hi, I'm trying to setup the SnmpBooster and it seems hook_late_configuration is not beeing run. I think this is where the initial configuration is set in memcached.

    This results in "Host not found in memcache: --host--" in check_mk

    hook_late_configuration was called earlier when I had a configuration error, because I got an exception and error message, but after correcting it I get nothing.

    What am I missing here?

  7. #7
    Administrator
    Join Date
    Dec 2011
    Posts
    278

    Re: SnmpBooster hook_late_configuration not happening?

    Good question noer,

    I will try and reproduce it next week.

    You might want to see if there is anything in your memcache database after the arbiter has finished loading the configuration. This will tell you if the Arbiter has run hook_late and loaded the memcached database. It might simply be a question of not reading the right config file or something changed in Shinken...

    See: http://www.darkcoding.net/software/m...list-all-keys/

    or using a python one liner, though you have to install the library using pip.

    https://github.com/dlrust/python-memcached-stats

    Otherwise, what version of Shinken are you using?

    Cheers,

    xkilian

  8. #8
    Junior Member
    Join Date
    Mar 2013
    Posts
    6

    Re: SnmpBooster hook_late_configuration not happening?

    I'm running Shinken 1.2.4

    I even did a new installation to see if I had somehow messed up the other one poking around in the code, but I still have the same problem.

    Looking in memcached didn't give much. As you can see below it's only the datasource that is stored. Don't understand what the datasource value "N." is?

    Code:
    127.000.000.001.11211-127.000.000.001.38044: STAT pid 13054
    STAT uptime 8121
    STAT time 1363366468
    STAT version 1.2.0
    STAT pointer_size 64
    STAT rusage_user 6.708419
    STAT rusage_system 11.036689
    STAT ibuffer_size 512
    STAT curr_connections 6
    STAT total_connections 59
    STAT connection_structures 9
    STAT cmd_get 81
    STAT cmd_set 24
    STAT get_hits 0
    STAT get_misses 81
    STAT bytes_read 2194
    STAT bytes_written 10928
    STAT threads 4
    END
    
    127.000.000.001.38044-127.000.000.001.11211: set datasource 1 604800 2
    N.
    
    127.000.000.001.11211-127.000.000.001.38044: STORED
    
    127.000.000.001.38044-127.000.000.001.11211: get eltek31
    
    127.000.000.001.11211-127.000.000.001.38044: END
    
    127.000.000.001.38044-127.000.000.001.11211: get eltek32
    
    127.000.000.001.11211-127.000.000.001.38044: END
    I will try to do some more poking around over the weekend.

    Cheers!

  9. #9
    Junior Member
    Join Date
    Mar 2013
    Posts
    6

    Re: SnmpBooster hook_late_configuration not happening?

    Ok, so my test setup was actually running the hook_late_configuration.

    But the files in the datasource dir was not loaded because of a bug in snmp_poller.py around line 1171

    Code:
            files = glob.glob(os.path.join(self.datasource_file,
                            '/Default*.ini')
                     )
    The Default*.ini part should not contain the / in front, or it will try to load /Default*.ini without the datasource_file prefix

    Code:
            files = glob.glob(os.path.join(self.datasource_file,
                            'Default*.ini')
                     )
    Now I "just" have some problems getting the actual data from the unit. Made my own Template and I get this error

    Code:
    SNMP Request error: Invalid sub-ID in (1, 3, 6, 1, 4, 1, 12148, 9, 3, 3, -1) at ObjectName
    Don't know why it says -1 at the end, when the template has a 0

    Code:
    snmpget -c public -v 2c hostname .1.3.6.1.4.1.12148.9.3.3.0
    iso.3.6.1.4.1.12148.9.3.3.0 = INTEGER: 2

  10. #10
    Junior Member
    Join Date
    Mar 2013
    Posts
    6

    Re: SnmpBooster hook_late_configuration not happening?

    Just to answer my own question...

    The problem is that the device I'm polling seems to not support getBulk requests. SnmpBooster doesn't support anything else at the moment.

    In my case a simple get request (with 3 oids) would be the best solution. No need for for bulk since I need 3 single values.

    Unfortunately this means I cannot use this solution at the moment.

    Cheers

Posting Permissions

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