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

[Cisco Meraki] Add warning message productType is not applicable to this network and skip collecting logs in cisco meraki collector #383

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
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
13 changes: 9 additions & 4 deletions collectors/ciscomeraki/collector.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const MAX_POLL_INTERVAL = 900;
const API_THROTTLING_ERROR = 429;
const API_NOT_FOUND_ERROR = 404;
const NOT_FOUND_ERROR_MAX_RETRIES = 3;

const PRODUCT_TYPE_NOTAPPLICABLE_MESSAGE = "productType is not applicable to this network";
const typeIdPaths = [{ path: ["type"] }];
const tsPaths = [{ path: ["occurredAt"] }];

Expand Down Expand Up @@ -187,9 +187,14 @@ class CiscomerakiCollector extends PawsCollector {
return callback(error);
}
} else if (error && error.response && error.response.data) {
AlLogger.debug(`CMRI0000022 error ${error.response.data.errors} - status: ${error.response.status}`);
error.response.data.errorCode = error.response.status;
return callback(error.response.data);
if (error.response.data.errors == PRODUCT_TYPE_NOTAPPLICABLE_MESSAGE) {
AlLogger.warn(`CMRI0000023 ${error.response.data.errors} : ${state.networkId}`);
return callback(null, [], state, state.poll_interval_sec);
} else {
AlLogger.debug(`CMRI0000022 error ${error.response.data.errors} - status: ${error.response.status}`);
error.response.data.errorCode = error.response.status;
return callback(error.response.data);
}
} else {
return callback(error);
}
Expand Down
2 changes: 1 addition & 1 deletion collectors/ciscomeraki/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ciscomeraki-collector",
"version": "1.0.5",
"version": "1.0.6",
"description": "Alert Logic AWS based Cisco Meraki Log Collector",
"repository": {},
"private": true,
Expand Down
2 changes: 1 addition & 1 deletion ps_spec.yml
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ stages:
- ./build_collector.sh ciscomeraki
env:
ALPS_SERVICE_NAME: "paws-ciscomeraki-collector"
ALPS_SERVICE_VERSION: "1.0.5" #set the value from collector package json
ALPS_SERVICE_VERSION: "1.0.6" #set the value from collector package json
outputs:
file: ./ciscomeraki-collector*
packagers:
Expand Down
Loading