Skip to content

Commit 8de99ed

Browse files
committed
Fixed bug that stopped reporting - sorry!
1 parent 4884fe1 commit 8de99ed

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

index.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -352,8 +352,9 @@ async function list() {
352352
if (c.Status.includes("(unhealthy)")) hcStatus = "(unhealthy)"
353353
if (monContainers.includes(c.Id + "," + c.State + "," + c.Names[0] + "," + hcStatus) == false && monContainers.length !== 0) {
354354
// exclude exited status if set
355-
if ((EXCLUDE_EXITED == 'true' && c.State.toLocaleLowerCase() == 'exited') || ((typeof query !== 'undefined' && query) || c.Id)) {
355+
if ((EXCLUDE_EXITED == 'true' && c.State.toLocaleLowerCase() == 'exited') && (typeof c.Id !== 'undefined' && c.Id)) {
356356
// ignore
357+
//console.log('ignore exited',c.Id,c.State,c.Names[0],hcStatus)
357358
}
358359
else {
359360
// if only offline is set, then only show state changes that are offline
@@ -405,7 +406,7 @@ async function list() {
405406
monContainers.forEach(c => {
406407
let delArray = newConArray.filter(nc => nc.includes(c.split(",")[0]));
407408
// if no match in history array and latest scan, then is deleted
408-
if((delArray.length==0 && EXCLUDE_EXITED !== 'true') || (typeof c.Id !== 'undefined' || c.Id)){
409+
if((delArray.length==0 && EXCLUDE_EXITED !== 'true') && (typeof c.Id !== 'undefined' && c.Id)){
409410
var output = c.split(",")[2].replace("/","") + ": exited"
410411
if(SHA.toLowerCase()=='true'){
411412
output += " " + c.Id

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "monocker",
3-
"version": "2.13.4",
3+
"version": "2.13.5",
44
"description": "Monitors and alerts for docker containers state changes",
55
"type": "module",
66
"main": "index.js",

0 commit comments

Comments
 (0)