Skip to content

Commit

Permalink
Fixed bug that stopped reporting - sorry!
Browse files Browse the repository at this point in the history
  • Loading branch information
petersem committed Sep 3, 2024
1 parent 4884fe1 commit 8de99ed
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -352,8 +352,9 @@ async function list() {
if (c.Status.includes("(unhealthy)")) hcStatus = "(unhealthy)"
if (monContainers.includes(c.Id + "," + c.State + "," + c.Names[0] + "," + hcStatus) == false && monContainers.length !== 0) {
// exclude exited status if set
if ((EXCLUDE_EXITED == 'true' && c.State.toLocaleLowerCase() == 'exited') || ((typeof query !== 'undefined' && query) || c.Id)) {
if ((EXCLUDE_EXITED == 'true' && c.State.toLocaleLowerCase() == 'exited') && (typeof c.Id !== 'undefined' && c.Id)) {
// ignore
//console.log('ignore exited',c.Id,c.State,c.Names[0],hcStatus)
}
else {
// if only offline is set, then only show state changes that are offline
Expand Down Expand Up @@ -405,7 +406,7 @@ async function list() {
monContainers.forEach(c => {
let delArray = newConArray.filter(nc => nc.includes(c.split(",")[0]));
// if no match in history array and latest scan, then is deleted
if((delArray.length==0 && EXCLUDE_EXITED !== 'true') || (typeof c.Id !== 'undefined' || c.Id)){
if((delArray.length==0 && EXCLUDE_EXITED !== 'true') && (typeof c.Id !== 'undefined' && c.Id)){
var output = c.split(",")[2].replace("/","") + ": exited"
if(SHA.toLowerCase()=='true'){
output += " " + c.Id
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "monocker",
"version": "2.13.4",
"version": "2.13.5",
"description": "Monitors and alerts for docker containers state changes",
"type": "module",
"main": "index.js",
Expand Down

0 comments on commit 8de99ed

Please sign in to comment.