Alejandro Galue
    • Create new note
    • Create a note from template
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Write
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
    • Invite by email
      Invitee

      This note has no invitees

    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Note Insights New
    • Engagement control
    • Make a copy
    • Transfer ownership
    • Delete this note
    • Save as template
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Note Insights Versions and GitHub Sync Sharing URL Create Help
Create Create new note Create a note from template
Menu
Options
Engagement control Make a copy Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Write
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
  • Invite by email
    Invitee

    This note has no invitees

  • Publish Note

    Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

    Your note will be visible on your profile and discoverable by anyone.
    Your note is now live.
    This note is visible on your profile and discoverable online.
    Everyone on the web can find and read all notes of this public team.
    See published notes
    Unpublish note
    Please check the box to agree to the Community Guidelines.
    View profile
    Engagement control
    Commenting
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    • Everyone
    Suggest edit
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    Emoji Reply
    Enable
    Import from Dropbox Google Drive Gist Clipboard
       Owned this note    Owned this note      
    Published Linked with GitHub
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    SNMP Data Collection Parsing Example ==== We're talking about the SNMP Collector, not any other collector, as `datacollection-config.xml` is all about building `snmp-collections`. As mentioned, it is crucial to make a distinction between the following two concepts: 1. Build the effective `snmp-collection` based on the `systemDef` list associated with a given list of `datacollection-groups`. Build the effective list of `mibObj` to collect from a given node using its `sysObjectID`. 2. The first process starts when the spring context initializes. Of course, it also happens during runtime when a change in `datacollection-config.xml` is detected (not the files inside the `datacollection` directory). The second process starts every time the SNMP Collector will collect data from the node. So, as you're mentioning categories and filters, that means we're talking about different `Collectd` packages, so for your example, I would expect to see in `collectd-configuration.xml` the following: ```xml= <package name="package-1" remote="false"> <filter>catincCatA</filter> <service name="SNMP" interval="300000" user-defined="false" status="on"> <parameter key="collection" value="group1"/> </service> </package> <package name="package-2" remote="false"> <filter>catincCatB</filter> <service name="SNMP" interval="300000" user-defined="false" status="on"> <parameter key="collection" value="group2"/> </service> </package> ``` Then, in `datacollection-config.xml`, I would expect to see: ```xml= <snmp-collection name="group1" snmpStorageFlag="select"> <rrd step="300"> <rra>RRA:AVERAGE:0.5:1:2016</rra> </rrd> <include-collection dataCollectionGroup="UniqueA"/> <include-collection dataCollectionGroup="UniqueB"/> </snmp-collection> <snmp-collection name="group2" snmpStorageFlag="select"> <rrd step="300"> <rra>RRA:AVERAGE:0.5:1:2016</rra> </rrd> <include-collection dataCollectionGroup="UniqueB"/> <include-collection dataCollectionGroup="UniqueC"/> </snmp-collection> ``` Then, inside the `datacollection` directory, I'd expect to find 3 files, let's call them `unique-a.xml`, `unique-b.xml` and `unique-c.xml`, with the following content, respectively: ```xml= <datacollection-group name="UniqueA"> <systemDef name="Collect-A"> <sysoid>.1.100.1.1</sysoid> <collect> <includeGroup>test-group-1</includeGroup> </collect> </systemDef> <systemDef name="Collect-B"> <sysoid>.1.100.1.2</sysoid> <collect> <includeGroup>test-group-2</includeGroup> </collect> </systemDef> <systemDef name="Collect-C"> <sysoidMask>.1.100.</sysoidMask> <collect> <includeGroup>test-group-3</includeGroup> </collect> </systemDef> </datacollection-group> ``` ```xml= <datacollection-group name="UniqueB"> <systemDef name="Collect-D"> <sysoidMask>.1.100.1.</sysoidMask> <collect> <includeGroup>test-group-4</includeGroup> </collect> </systemDef> <systemDef name="Collect-E"> <sysoid>.1.100.1.3</sysoid> <collect> <includeGroup>test-group-5</includeGroup> </collect> </systemDef> <systemDef name="Collect-F"> <sysoidMask>.1.100.1.</sysoidMask> <collect> <includeGroup>test-group-6</includeGroup> </collect> </systemDef> </datacollection-group> ``` ```xml= <datacollection-group name="UniqueC"> <systemDef name="Collect-G"> <sysoidMask>.1.</sysoidMask> <collect> <includeGroup>test-group-7</includeGroup> </collect> </systemDef> <systemDef name="Collect-H"> <sysoid>.1.100.3.1</sysoid> <collect> <includeGroup>test-group-8</includeGroup> </collect> </systemDef> <systemDef name="Collect-I"> <sysoid>.1.100.1.1.2</sysoid> <collect> <includeGroup>test-group-9</includeGroup> </collect> </systemDef> </datacollection-group> ``` # Test scenarios a) Node A belongs to categories `CatA` and `CatB`, and it has a `sysObjectID` of `.1.100.1.1` b) Node B belongs to category `CatB`, and it has a `sysObjectID` of `.1.100.1.2` As mentioned, there will be two effective `snmp-collections` called `group1` and `group2`, as the SNMP service appears twice in `collectd-configuration.xml`, each of them matching a different set of nodes. Because all the `systemDefs` have unique names, the `group1` will contain `UniqueA` plus `UniqueB`, meaning it would have: `Collect-A` through `Collect-F`. Similarly, `group2` would contain `Collect-D` through `Collect-I`. Regardless of the `sysoid` and `sysoidMasks` inside the `systemDef`, what matters at this level is the `systemDef` name. ## For node A Because it matches two `collectd` packages for the SNMP service, The collector will use both collections (`group1` and `group2`). In other words, it will check `Collect-A` through `Collect-I`. Note that even if `UniqueB` is referenced twice, it will be included once. Now, as the node's `sysObjectID` is `.1.100.1.1`, only the `systemDefs` `Collect-A`, `Collect-C`, `Collect-D`, `Collect-F` and `Collect-G` will be included as those are the only ones with a `sysoid` or `sysoidMask` that matches the `sysObjectID`. However, it will add the `mibObj groups` in the order they appear. If one `systemDef` is referencing a group already included, it won't add it again (one more time, knowing the groups is done by checking their names). Remember the idea is to extract the list of `systemDefs` that match the `sysObjectID`, to get the list of `mibObj groups`, to finally get the list of `OIDs` to retrieve via SNMP. ## For node B Because it matches one `collectd` package for the SNMP service, the collector will use one collection (`group2`). In other words, it will check `Collect-D` through `Collect-I`. Now, as the node's sysObjectID is `.1.100.1.2`, only the `systemDefs` `Collect-D`, `Collect-F` and `Collect-G` will be included (for the same reason as the other use case).

    Import from clipboard

    Paste your markdown or webpage here...

    Advanced permission required

    Your current role can only read. Ask the system administrator to acquire write and comment permission.

    This team is disabled

    Sorry, this team is disabled. You can't edit this note.

    This note is locked

    Sorry, only owner can edit this note.

    Reach the limit

    Sorry, you've reached the max length this note can be.
    Please reduce the content or divide it to more notes, thank you!

    Import from Gist

    Import from Snippet

    or

    Export to Snippet

    Are you sure?

    Do you really want to delete this note?
    All users will lose their connection.

    Create a note from template

    Create a note from template

    Oops...
    This template has been removed or transferred.
    Upgrade
    All
    • All
    • Team
    No template.

    Create a template

    Upgrade

    Delete template

    Do you really want to delete this template?
    Turn this template into a regular note and keep its content, versions, and comments.

    This page need refresh

    You have an incompatible client version.
    Refresh to update.
    New version available!
    See releases notes here
    Refresh to enjoy new features.
    Your user state has changed.
    Refresh to load new user state.

    Sign in

    Forgot password

    or

    By clicking below, you agree to our terms of service.

    Sign in via Facebook Sign in via Twitter Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    Help

    • English
    • 中文
    • Français
    • Deutsch
    • 日本語
    • Español
    • Català
    • Ελληνικά
    • Português
    • italiano
    • Türkçe
    • Русский
    • Nederlands
    • hrvatski jezik
    • język polski
    • Українська
    • हिन्दी
    • svenska
    • Esperanto
    • dansk

    Documents

    Help & Tutorial

    How to use Book mode

    Slide Example

    API Docs

    Edit in VSCode

    Install browser extension

    Contacts

    Feedback

    Discord

    Send us email

    Resources

    Releases

    Pricing

    Blog

    Policy

    Terms

    Privacy

    Cheatsheet

    Syntax Example Reference
    # Header Header 基本排版
    - Unordered List
    • Unordered List
    1. Ordered List
    1. Ordered List
    - [ ] Todo List
    • Todo List
    > Blockquote
    Blockquote
    **Bold font** Bold font
    *Italics font* Italics font
    ~~Strikethrough~~ Strikethrough
    19^th^ 19th
    H~2~O H2O
    ++Inserted text++ Inserted text
    ==Marked text== Marked text
    [link text](https:// "title") Link
    ![image alt](https:// "title") Image
    `Code` Code 在筆記中貼入程式碼
    ```javascript
    var i = 0;
    ```
    var i = 0;
    :smile: :smile: Emoji list
    {%youtube youtube_id %} Externals
    $L^aT_eX$ LaTeX
    :::info
    This is a alert area.
    :::

    This is a alert area.

    Versions and GitHub Sync
    Get Full History Access

    • Edit version name
    • Delete

    revision author avatar     named on  

    More Less

    Note content is identical to the latest version.
    Compare
      Choose a version
      No search result
      Version not found
    Sign in to link this note to GitHub
    Learn more
    This note is not linked with GitHub
     

    Feedback

    Submission failed, please try again

    Thanks for your support.

    On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

    Please give us some advice and help us improve HackMD.

     

    Thanks for your feedback

    Remove version name

    Do you want to remove this version name and description?

    Transfer ownership

    Transfer to
      Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

        Link with GitHub

        Please authorize HackMD on GitHub
        • Please sign in to GitHub and install the HackMD app on your GitHub repo.
        • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
        Learn more  Sign in to GitHub

        Push the note to GitHub Push to GitHub Pull a file from GitHub

          Authorize again
         

        Choose which file to push to

        Select repo
        Refresh Authorize more repos
        Select branch
        Select file
        Select branch
        Choose version(s) to push
        • Save a new version and push
        • Choose from existing versions
        Include title and tags
        Available push count

        Pull from GitHub

         
        File from GitHub
        File from HackMD

        GitHub Link Settings

        File linked

        Linked by
        File path
        Last synced branch
        Available push count

        Danger Zone

        Unlink
        You will no longer receive notification when GitHub file changes after unlink.

        Syncing

        Push failed

        Push successfully