-
Notifications
You must be signed in to change notification settings - Fork 1.8k
in_snmp: an input plugin for collect metrics by SNMP request #7671
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
k402xxxcenxxx
wants to merge
1
commit into
fluent:master
Choose a base branch
from
k402xxxcenxxx:feature/in_snmp
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,79 @@ | ||
| # - Find Net-SNMP | ||
| # | ||
| # -*- cmake -*- | ||
| # | ||
| # Find the Net-SNMP module | ||
| # | ||
| # NETSNMP_INCLUDE_DIR - where to find Net-SNMP.h, etc. | ||
| # NETSNMP_LIBRARIES - List of libraries when using Net-SNMP. | ||
| # NETSNMP_FOUND - True if Net-SNMP found. | ||
|
|
||
| IF (NETSNMP_INCLUDE_DIR) | ||
| # Already in cache, be silent | ||
| SET(NETSNMP_FIND_QUIETLY TRUE) | ||
| ENDIF (NETSNMP_INCLUDE_DIR) | ||
|
|
||
| FIND_PATH(NETSNMP_INCLUDE_DIR net-snmp/net-snmp-includes.h | ||
| /usr/include | ||
| /usr/local/include | ||
| /opt/homebrew/include | ||
| /opt/local/include | ||
| ) | ||
|
|
||
| SET(NETSNMP_NAMES netsnmp) | ||
| FIND_LIBRARY(NETSNMP_LIBRARY | ||
| NAMES ${NETSNMP_NAMES} | ||
| PATHS /usr/lib /usr/local/lib /opt/homebrew/lib /opt/local/lib | ||
| ) | ||
|
|
||
| SET(NETSNMPAGENT_NAMES netsnmpagent) | ||
| FIND_LIBRARY(NETSNMPAGENT_LIBRARY | ||
| NAMES ${NETSNMPAGENT_NAMES} | ||
| PATHS /usr/lib /usr/local/lib /opt/homebrew/lib /opt/local/lib | ||
| ) | ||
|
|
||
| SET(NETSNMPHELPERS_NAMES netsnmphelpers) | ||
| FIND_LIBRARY(NETSNMPHELPERS_LIBRARY | ||
| NAMES ${NETSNMPHELPERS_NAMES} | ||
| PATHS /usr/lib /usr/local/lib /opt/homebrew/lib /opt/local/lib | ||
| ) | ||
|
|
||
| SET(NETSNMPMIBS_NAMES netsnmpmibs) | ||
| FIND_LIBRARY(NETSNMPMIBS_LIBRARY | ||
| NAMES ${NETSNMPMIBS_NAMES} | ||
| PATHS /usr/lib /usr/local/lib /opt/homebrew/lib /opt/local/lib | ||
| ) | ||
|
|
||
| SET(NETSNMPTRAPD_NAMES netsnmptrapd) | ||
| FIND_LIBRARY(NETSNMPTRAPD_LIBRARY | ||
| NAMES ${NETSNMPTRAPD_NAMES} | ||
| PATHS /usr/lib /usr/local/lib /opt/homebrew/lib /opt/local/lib | ||
| ) | ||
|
|
||
| SET(NETSNMP_LIBRARIES | ||
| ${NETSNMP_LIBRARY} | ||
| ${NETSNMPAGENT_LIBRARY} | ||
| ${NETSNMPHELPERS_LIBRARY} | ||
| ${NETSNMPMIBS_LIBRARY} | ||
| # ${NETSNMPTRAPD_LIBRARY} | ||
| ) | ||
|
|
||
| # Provide plural form for CMake convention | ||
| SET(NETSNMP_INCLUDE_DIRS ${NETSNMP_INCLUDE_DIR}) | ||
|
|
||
|
|
||
| INCLUDE(FindPackageHandleStandardArgs) | ||
| FIND_PACKAGE_HANDLE_STANDARD_ARGS(NETSNMP | ||
| DEFAULT_MSG | ||
| NETSNMP_INCLUDE_DIRS | ||
| NETSNMP_LIBRARIES | ||
| ) | ||
|
|
||
| MARK_AS_ADVANCED( | ||
| NETSNMP_LIBRARY | ||
| NETSNMPAGENT_LIBRARY | ||
| NETSNMPHELPERS_LIBRARY | ||
| NETSNMPMIBS_LIBRARY | ||
| NETSNMPTRAPD_LIBRARY | ||
| NETSNMP_INCLUDE_DIR | ||
| ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -81,6 +81,7 @@ if(FLB_WINDOWS_DEFAULTS) | |
| set(FLB_IN_ELASTICSEARCH Yes) | ||
| set(FLB_IN_SPLUNK Yes) | ||
| set(FLB_IN_PROMETHEUS_REMOTE_WRITE Yes) | ||
| set(FLB_IN_SNMP No) | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. macOS too? |
||
|
|
||
| # OUTPUT plugins | ||
| # ============== | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -55,6 +55,7 @@ RUN echo "deb http://deb.debian.org/debian bookworm-backports main" >> /etc/apt/ | |
| flex \ | ||
| bison \ | ||
| libyaml-dev \ | ||
| libsnmp-dev \ | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We presumably will also need this in the various package builds under |
||
| && apt-get satisfy -y cmake "cmake (<< 4.0)" \ | ||
| && apt-get clean \ | ||
| && rm -rf /var/lib/apt/lists/* | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
Verify macOS support status for the SNMP plugin.
The inclusion of
cmake/FindNetsnmp.cmakeenables Net-SNMP discovery during configuration. While Windows support is explicitly disabled (cmake/windows-setup.cmake:84), the past review comments requested confirmation of macOS compatibility.Please confirm whether macOS support is:
🏁 Script executed:
Length of output: 390
🏁 Script executed:
Length of output: 2098
🏁 Script executed:
Length of output: 855
🏁 Script executed:
Length of output: 1753
🏁 Script executed:
Length of output: 601
🏁 Script executed:
Length of output: 1096
Update FindNetsnmp.cmake to support Homebrew, or explicitly disable SNMP on macOS.
macOS support status remains unresolved. The current implementation will fail to build on macOS with Homebrew-installed Net-SNMP:
/usr/liband/usr/local/lib, missing Homebrew's standard install paths (/usr/local/opt/net-snmpon Intel,/opt/homebrew/opt/net-snmpon Apple Silicon)${NETSNMP_LIBRARY}without checkingNETSNMP_FOUNDThe Windows disable mechanism (
FLB_IN_SNMP=Noin cmake/windows-setup.cmake:84) only gates tests, not the actual plugin build. Add equivalent macOS handling or update the SNMP finder to support Homebrew paths.🤖 Prompt for AI Agents