-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
snmp: borrow dummy plugin as a start point
Add: ChatGPT in_snmp Add: snmp get with fix request Add: snmp with log recorder Add: print value by sprint_realloc_by_type Fix: refine code. Add: walk get values TMP Signed-off-by: k402xxxcenxxx <[email protected]>
- Loading branch information
1 parent
362ca1f
commit cf8b9ff
Showing
8 changed files
with
590 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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 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,73 @@ | ||
# - 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 snmp.h | ||
/usr/include/net-snmp/library | ||
) | ||
|
||
SET(NETSNMP_NAMES netsnmp) | ||
FIND_LIBRARY(NETSNMP_LIBRARY | ||
NAMES ${NETSNMP_NAMES} | ||
PATHS /usr/lib /usr/local/lib | ||
) | ||
|
||
SET(NETSNMPAGENT_NAMES netsnmpagent) | ||
FIND_LIBRARY(NETSNMPAGENT_LIBRARY | ||
NAMES ${NETSNMPAGENT_NAMES} | ||
PATHS /usr/lib /usr/local/lib | ||
) | ||
|
||
SET(NETSNMPHELPERS_NAMES netsnmphelpers) | ||
FIND_LIBRARY(NETSNMPHELPERS_LIBRARY | ||
NAMES ${NETSNMPHELPERS_NAMES} | ||
PATHS /usr/lib /usr/local/lib | ||
) | ||
|
||
SET(NETSNMPMIBS_NAMES netsnmpmibs) | ||
FIND_LIBRARY(NETSNMPMIBS_LIBRARY | ||
NAMES ${NETSNMPMIBS_NAMES} | ||
PATHS /usr/lib /usr/local/lib | ||
) | ||
|
||
SET(NETSNMPTRAPD_NAMES netsnmptrapd) | ||
FIND_LIBRARY(NETSNMPTRAPD_LIBRARY | ||
NAMES ${NETSNMPTRAPD_NAMES} | ||
PATHS /usr/lib /usr/local/lib | ||
) | ||
|
||
SET(NETSNMP_LIBRARIES | ||
${NETSNMP_LIBRARY} | ||
${NETSNMPAGENT_LIBRARY} | ||
${NETSNMPHELPERS_LIBRARY} | ||
${NETSNMPMIBS_LIBRARY} | ||
# ${NETSNMPTRAPD_LIBRARY} | ||
) | ||
|
||
|
||
INCLUDE(FindPackageHandleStandardArgs) | ||
FIND_PACKAGE_HANDLE_STANDARD_ARGS(NETSNMP | ||
DEFAULT_MSG | ||
NETSNMP_INCLUDE_DIR | ||
NETSNMP_LIBRARIES | ||
) | ||
|
||
MARK_AS_ADVANCED( | ||
NETSNMP_LIBRARY | ||
NETSNMPAGENT_LIBRARY | ||
NETSNMPHELPERS_LIBRARY | ||
NETSNMPMIBS_LIBRARY | ||
NETSNMPTRAPD_LIBRARY | ||
NETSNMP_INCLUDE_DIR | ||
) |
This file contains 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 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,8 @@ | ||
set(NETSNMP_LIBRARIES ${NETSNMP_LIBRARY}) | ||
set(NETSNMP_INCLUDE_DIRS ${NETSNMP_INCLUDE_DIR}) | ||
|
||
set(src | ||
in_snmp.c) | ||
|
||
FLB_PLUGIN(in_snmp "${src}" "") | ||
target_link_libraries(flb-plugin-in_snmp ${NETSNMP_LIBRARIES}) |
Oops, something went wrong.