Skip to content

Commit

Permalink
[Cisco Meraki] Add warning message productType is not applicable to t…
Browse files Browse the repository at this point in the history
…his network and skip collecting logs in cisco meraki collector
  • Loading branch information
imranalisyed506 committed Dec 30, 2024
1 parent d9313f5 commit 1bde7db
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
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

0 comments on commit 1bde7db

Please sign in to comment.