Skip to content
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

Adding log_req_limit value #6

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Adding new log_req_limit value to venafi_cert.yaml and python file. T…
…his allows users to separate the two and specify different values for each based on their needs instead of have one value for everything.

Adding a default variable LOG_LIMIT set to 10000.
Adding if statement for passed log_req_limit value from yaml.
Changing params for POST request in get_log_events method to LOG_LIMIT variable.
Adding log_req_limit to yaml example.
Adding log_req_limit to README.
ckamm committed Oct 4, 2022
commit 5820a802db88db7ac3e9a5dacfccba349b92773a
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -25,6 +25,7 @@ To install the project's dependencies, clone this repo to the host machine and r
| client_id | `OAuth` client id. Required if `auth_method` is `oauth`. | No
| scope | `OAuth` scope. Required if `auth_method` is `oauth`. | No
| req_limit | Default is `10000`. Limits number of records returned from the API. | No
| log_req_limit | Default is `10000`. Limits number of log records returned from the API. | No
| key_sizes | Default is a list of `[512, 1024, 2048]` | No
| key_algorithms | Default is a list of `["RSA", "ECC"]` | No
| min_collection_interval | Default is `60`. Sets the minimum interval of metrics collections when the DataDog agent is running.| No
8 changes: 6 additions & 2 deletions checks.d/venafi_cert.py
Original file line number Diff line number Diff line change
@@ -11,6 +11,7 @@
class VenafiCheck(AgentCheck):
UTCNOW = datetime.utcnow()
LIMIT = 5000
LOG_LIMIT = 10000

KEY_SIZES = [256, 512, 1024, 2048]
KEY_ALGOS = ["RSA", "ECC"]
@@ -76,6 +77,9 @@ def configure(self, instance):
if "req_limit" in instance:
self.LIMIT = instance["req_limit"]

if "log_req_limit" in instance:
self.LOG_LIMIT = instance["log_req_limit"]

if "key_sizes" in instance:
self.KEY_SIZES = instance["key_sizes"]

@@ -305,7 +309,7 @@ def count_algo_certs(self):
tags=[
"key_algorithm:%s" % algo.lower(),
"metric_submission_type:count",
],
],
)

def count_keysize_certs(self):
@@ -532,7 +536,7 @@ def get_log_events(self):
url = self.BASE_URL + "/vedsdk/Log/"

params = {
"limit": self.LIMIT,
"limit": self.LOG_LIMIT,
}

headers = {
1 change: 1 addition & 0 deletions conf.d/venafi_cert.yaml
Original file line number Diff line number Diff line change
@@ -8,6 +8,7 @@ instances:
# client_id: "clientid"
# scope: "scope:scope"
# req_limit: 10000
# log_req_limit: 10000
# key_sizes:
# - 512
# - 1024