Page 1 of 5 123 ... LastLast
Results 1 to 10 of 44

Thread: Discovering interfaces to monitor on a router/switch

  1. #1

    Discovering interfaces to monitor on a router/switch

    Hey there,

    did anyone craft a tool to populate a list of interfaces (probably from SNMP IF-MIB) on a router?

    Requirement here is to aid when setting up monitoring for hundreds of interfaces per equipment. I'm thinking in creating a small bash script to get the output from snmpwalk, create the nagios configuration and then importing it to NConf.

    Someone else has a path to share?

    Thanks

  2. #2
    Administrator
    Join Date
    Dec 2011
    Posts
    278

    Re: Discovering interfaces to monitor on a router/switch

    Hello openglx,

    SNMP discovery for Nagios… Where to begin.

    A scripted action (From a management console (Skonf, Puppet, Chef, CLI) discovers a device:

    Step 1. Get common SNMP identifiers to see if this is a supported device (sysObject, sysDescr, etc)
    Step 2. Get Table dumps of data to see what interested bits can be queried
    Step 3. Create of list of services to supervised based on user/script inputs
    Step 4. Review in a web interface the supported items and check what needs to be supported(or full automation with scripted inputs)
    Step 5. Apply/commit the generated configs to Nagios/Shinken config

    This is what we want?

    Current support is a hodge podge. For Shinken, this is even more bare. I am curious to see what people suggest. (check_nwc_health, manubulon scripts, check_mk/wato, etc.)

    My own workflow is:

    Run genDevConfig against the device(disovery and Shinken configuration generator), verify and copy the generated files into the Shinken config directory. Run Shinken with the SnmpBooster module to collect the data, apply thresholds. Better would be some type of SkonfUI web management as listed above, but that doesn't exist, yet.

    Ah ha. SnmpBooster… The great mystery soon to be unveiled in a public beta!

    I have been hinting at this for a while now, a Shinken news article should appear in the next few days to announce it. :-)

    Is it perfect, hell no. Is it a good step in the right direction, I think so.

    xkilian

  3. #3
    Administrator
    Join Date
    Dec 2011
    Posts
    278

    Re: Discovering interfaces to monitor on a router/switch

    FYI.

    SnmpBooster module + genDevConfig combo are now available as a public beta starting today!

    Read about it in the Shinken News. http://www.shinken-monitoring.org/category/news/

    Hope you like it.

    xkilian

  4. #4

    Re: Discovering interfaces to monitor on a router/switch

    XKilian, thank you very much.

    I've read the documentation and started testing it. Very happy to see that the SNMP bulk approach is being taken very seriously.

    A few points to help.

    - On documentation http://www.shinken-monitoring.org/wi...booster_module is says

    snmpcommunityread which is set in your resource.cfg file
    host_name which is set in your service definition
    Isn't host_name an attribute from host class?

    - On the genDevConfig INSTALL:

    cp $genDevConfig/sample-config/genDevConfig/Defaults_unified.ini $SHINKEN/etc/SNMP/
    cp $genDevConfig/sample-config/genDevConfig/snmp-template.cfg $SHINKEN/etc/
    The directory inside sample-config is genConfig, not genDevConfig... And snmp-template.cfg is check_snmp_templates.cfg.

    - It's not very clear what it uses from the Shinken configuration. I need to run the command to check devices that are under a specific poller (segregated network), so I'll probably have some extra work with that. I understand that my setup is not that simple so it wouldn't fit a more general case.
    Anyway it is already a great work.


    Thanks

  5. #5

    Re: Discovering interfaces to monitor on a router/switch

    I was able to generate the config using genDevConfig, good stuff.

    Cloned https://github.com/titilambert/shinken.git, did checkout on branch snmp_booster (commit id d15a907a9d5c3e72ab65c813a87cf3306694b764) and installed over the previous Shinken I had.

    Looks like it accepted but still can't find /usr/local/shinken/libexec/check_snmp.py. Couldn't find this script elsewhere...


  6. #6
    Administrator
    Join Date
    Dec 2011
    Posts
    278

    Re: Discovering interfaces to monitor on a router/switch

    Hi,

    Sorry that wasn't clear in the doc.

    There is no check_snmp.py. It is a dummy check, like NrpeBooster. You could have written dummy_check, I will change it to something clearer.

    The code is actually the file shinken/modules/snmp_poller.py.

    What you need to do is declare SnmpBooster in your shinken-specific.cfg. I think this is what you missed.

    Add the SnmpBooster to Poller, Arbiter, Scheduler modules.

    Add the SnmpBooster module definition section.

    Cheers,

    xkilian



  7. #7

    Re: Discovering interfaces to monitor on a router/switch

    Well, the definitions are in shinken-specific.cfg but I overlooked the errors.

    ==> /usr/local/shinken/var/brokerd.log <==
    2012-10-15 12:37:58,317 [1350304678] Error : [broker-1] [SnmpBooster] Import error. Maybe one of this module is missing: memcache, configobj, pysnmp
    2012-10-15 12:37:58,318 [1350304678] Warning : [broker-1] Importing module: No module named pysnmp.carrier.asynsock.dispatch
    2012-10-15 12:37:58,458 [1350304678] Error : [SnmpBooster] Import error. Maybe one of this module is missing: memcache, configobj, pysnmp
    2012-10-15 12:37:58,459 [1350304678] Warning : Importing module: No module named pysnmp.carrier.asynsock.dispatch
    2012-10-15 12:37:58,474 [1350304678] Error : [SnmpBooster] Import error. Maybe one of this module is missing: memcache, configobj, pysnmp
    2012-10-15 12:37:58,474 [1350304678] Warning : Importing module: No module named pysnmp.carrier.asynsock.dispatch
    I couldn't find pysnmp on Centos 6.3 repo other than net-snmp-python. Just then I realized it would require pysnmp via easy_install.

    I'm checking how the remote probe will behave now, will keep you posted.

  8. #8

    Re: Discovering interfaces to monitor on a router/switch

    XKilian, if there's a better place to discuss about the SnmpBooster please let me know.

    I'm running SnmpBooster in both master and remote poller. This is the debug of the poller after I ask for a refresh oh a host configured using GenDevConfig:

    2012-10-15 14:56:06,472 [1350309366] Debug : ========================
    2012-10-15 14:56:06,473 [1350309366] Debug : [0][scheduler-1][fork] Stats: Workers:0 (Queued:0 TotalReturnWait:0)
    2012-10-15 14:56:06,473 [1350309366] Debug : [0][scheduler-1][snmp_poller] Stats: Workers:1 (Queued:0 TotalReturnWait:0)
    2012-10-15 14:56:06,474 [1350309366] Debug : Wait ratio: 1.038317
    2012-10-15 14:56:06,584 [1350309366] Debug : Ask actions to 0, got 401
    2012-10-15 14:56:06,746 [1350309366] Debug : Loop turn
    2012-10-15 14:56:07,785 [1350309367] Debug : ========================
    2012-10-15 14:56:07,785 [1350309367] Debug : [0][scheduler-1][fork] Stats: Workers:0 (Queued:0 TotalReturnWait:256)
    2012-10-15 14:56:07,786 [1350309367] Debug : [0][scheduler-1][snmp_poller] Stats: Workers:1 (Queued:0 TotalReturnWait:256)
    2012-10-15 14:56:07,786 [1350309367] Debug : Wait ratio: 1.037488
    2012-10-15 14:56:07,882 [1350309367] Debug : Ask actions to 0, got 0
    2012-10-15 14:56:08,082 [1350309368] Debug : Loop turn
    2012-10-15 14:56:09,121 [1350309369] Debug : ========================
    2012-10-15 14:56:09,122 [1350309369] Debug : [0][scheduler-1][fork] Stats: Workers:0 (Queued:0 TotalReturnWait:146)
    2012-10-15 14:56:09,122 [1350309369] Debug : [0][scheduler-1][snmp_poller] Stats: Workers:1 (Queued:0 TotalReturnWait:146)
    2012-10-15 14:56:09,123 [1350309369] Debug : Wait ratio: 1.036662
    2012-10-15 14:56:09,215 [1350309369] Debug : Ask actions to 0, got 1
    2012-10-15 14:56:09,409 [1350309369] Debug : Loop turn
    2012-10-15 14:56:10,447 [1350309370] Debug : ========================
    2012-10-15 14:56:10,448 [1350309370] Debug : [0][scheduler-1][fork] Stats: Workers:0 (Queued:0 TotalReturnWait:0)
    2012-10-15 14:56:10,448 [1350309370] Debug : [0][scheduler-1][snmp_poller] Stats: Workers:1 (Queued:0 TotalReturnWait:0)
    2012-10-15 14:56:10,448 [1350309370] Debug : Wait ratio: 1.035860
    2012-10-15 14:56:10,491 [1350309370] Debug : Ask actions to 0, got 0
    2012-10-15 14:56:10,532 [1350309370] Debug : Loop turn
    It's pretty clear to me that it got the snmp_poller running and sent the requests to it.
    Still I can't receive any information back.

    On check_mk I see the "output of check plugin" as blank and service_state as Critical. The time since the last check of the service is 49 sec...

    The remote poller can reach the memcached running on the master...

    What else could I check?


    Thanks

  9. #9

    Re: Discovering interfaces to monitor on a router/switch

    I don't see any SNMP traffic being generated, and no fork/execve after attaching a strace to the shinken-poller on the remote probe.

    Looks like it is not effectively trying to issue the queries...

    Probe runs Centos 5.8 with Python 2.6.8. Others checks (not SnmpBooster) are working fine.

  10. #10
    Administrator
    Join Date
    Dec 2011
    Posts
    278

    Re: Discovering interfaces to monitor on a router/switch

    Do a:
    cd shinken/var
    grep SnmpBooster *

    You must have output messages. The first to look at is your Arbiter logs. This will tell you if yes or no your configuration is valid.

    Second is the Scheduler logs and finally poller logs. Will have SnmpBooster messages.

    Look at that and let me know.

    xkilian

Posting Permissions

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