From 9b49ea54a0a06cc278ae054c8328b3e5407d32ed Mon Sep 17 00:00:00 2001 From: FlorianVeaux Date: Mon, 28 Mar 2022 12:30:22 -0400 Subject: [PATCH 1/3] Ship SNMP Traps database --- omnibus/config/software/datadog-agent.rb | 3 +++ omnibus/config/software/snmp-traps.rb | 18 ++++++++++++++++++ ...MP---include-traps-db-7c44bd129daf7667.yaml | 11 +++++++++++ 3 files changed, 32 insertions(+) create mode 100644 omnibus/config/software/snmp-traps.rb create mode 100644 releasenotes/notes/SNMP---include-traps-db-7c44bd129daf7667.yaml diff --git a/omnibus/config/software/datadog-agent.rb b/omnibus/config/software/datadog-agent.rb index 28d38c7b889ee..2cfb92aa30b27 100644 --- a/omnibus/config/software/datadog-agent.rb +++ b/omnibus/config/software/datadog-agent.rb @@ -14,6 +14,9 @@ dependency "libarchive" if windows? dependency "yaml-cpp" if windows? +# Include traps db file in snmp.d/traps_db/ +dependency 'snmp-traps' + source path: '..' relative_path 'src/github.com/DataDog/datadog-agent' diff --git a/omnibus/config/software/snmp-traps.rb b/omnibus/config/software/snmp-traps.rb new file mode 100644 index 0000000000000..4865a88b18ffe --- /dev/null +++ b/omnibus/config/software/snmp-traps.rb @@ -0,0 +1,18 @@ +name "snmp-traps" +default_version "0.2.0" + +source :url => "https://s3.amazonaws.com/dd-agent-omnibus/snmp_traps_db/dd_traps_db-#{version}.json.gz", + :sha256 => "dd308ba8ec1453ed73d60e9b8d4c38050371fdceaab4404448e1084d628d3298", + :target_filename => "dd_traps_db.json.gz" + + +build do + # The dir for confs + if osx? + traps_db_dir = "#{install_dir}/etc/conf.d/snmp.d/traps_db" + else + traps_db_dir = "#{install_dir}/etc/datadog-agent/conf.d/snmp.d/traps_db" + end + mkdir traps_db_dir + copy "dd_traps_db.json.gz", "#{traps_db_dir}/dd_traps_db.json.gz" +end diff --git a/releasenotes/notes/SNMP---include-traps-db-7c44bd129daf7667.yaml b/releasenotes/notes/SNMP---include-traps-db-7c44bd129daf7667.yaml new file mode 100644 index 0000000000000..f01aa1b3790f8 --- /dev/null +++ b/releasenotes/notes/SNMP---include-traps-db-7c44bd129daf7667.yaml @@ -0,0 +1,11 @@ +# Each section from every release note are combined when the +# CHANGELOG.rst is rendered. So the text needs to be worded so that +# it does not depend on any information only available in another +# section. This may mean repeating some details, but each section +# must be readable independently of the other. +# +# Each section note must be formatted as reStructuredText. +--- +other: + - | + Include pre-generated trap db file in the `conf.d/snmp.d/traps_db/` folder. From 4db2b4346ba7fc986447169a0280206869c32df5 Mon Sep 17 00:00:00 2001 From: Florian Veaux Date: Mon, 28 Mar 2022 12:53:35 -0400 Subject: [PATCH 2/3] Update releasenotes/notes/SNMP---include-traps-db-7c44bd129daf7667.yaml Co-authored-by: Alexandre Yang --- .../notes/SNMP---include-traps-db-7c44bd129daf7667.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/releasenotes/notes/SNMP---include-traps-db-7c44bd129daf7667.yaml b/releasenotes/notes/SNMP---include-traps-db-7c44bd129daf7667.yaml index f01aa1b3790f8..8aa0bf9be0419 100644 --- a/releasenotes/notes/SNMP---include-traps-db-7c44bd129daf7667.yaml +++ b/releasenotes/notes/SNMP---include-traps-db-7c44bd129daf7667.yaml @@ -8,4 +8,4 @@ --- other: - | - Include pre-generated trap db file in the `conf.d/snmp.d/traps_db/` folder. + Include pre-generated trap db file in the ``conf.d/snmp.d/traps_db/`` folder. From ac00af002dd42a649a47ba7c8b87cd7a5b2cfc42 Mon Sep 17 00:00:00 2001 From: FlorianVeaux Date: Mon, 28 Mar 2022 14:01:56 -0400 Subject: [PATCH 3/3] Move snmp-traps dep to agent.rb --- omnibus/config/projects/agent.rb | 3 +++ omnibus/config/software/datadog-agent.rb | 3 --- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/omnibus/config/projects/agent.rb b/omnibus/config/projects/agent.rb index 94d3c9adab84c..20a8622f81cf3 100644 --- a/omnibus/config/projects/agent.rb +++ b/omnibus/config/projects/agent.rb @@ -254,6 +254,9 @@ dependency 'datadog-security-agent-policies' end +# Include traps db file in snmp.d/traps_db/ +dependency 'snmp-traps' + # External agents dependency 'jmxfetch' diff --git a/omnibus/config/software/datadog-agent.rb b/omnibus/config/software/datadog-agent.rb index 2cfb92aa30b27..28d38c7b889ee 100644 --- a/omnibus/config/software/datadog-agent.rb +++ b/omnibus/config/software/datadog-agent.rb @@ -14,9 +14,6 @@ dependency "libarchive" if windows? dependency "yaml-cpp" if windows? -# Include traps db file in snmp.d/traps_db/ -dependency 'snmp-traps' - source path: '..' relative_path 'src/github.com/DataDog/datadog-agent'