monit-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] Implement totalmemory percentage testing


From: Martin Pala
Subject: Re: [PATCH] Implement totalmemory percentage testing
Date: Sun, 09 Jan 2005 20:24:56 +0100
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.5) Gecko/20050105 Debian/1.7.5-1

Thanks, it was bug, i have added your patch to cvs.

Cheers :)
Martin

Michel Marti wrote:
Hello all,

Is there a reason why testing for totalmemory percentage usage is not implemented in monit-cvs? The test "if totalmemory is greater than 30% then restart" results in "error -- unknown resource ID: [9]". If not, here is a patch that adds totalmemory percentage testing.

Regards,

Michel

------------------------------------------------------------------------
diff -u -r1.130 validate.c
--- validate.c  6 Jan 2005 20:51:49 -0000 1.130
+++ validate.c  7 Jan 2005 12:38:18 -0000
@@ -694,6 +694,21 @@
     }
     break;

+  case RESOURCE_ID_TOTAL_MEM_PERCENT:
+ if(Util_evalQExpression(pr->operator, s->inf->total_mem_percent, pr->limit)) {
+      snprintf(report, STRLEN,
+        "'%s' total mem amount of %.1f%% matches resource limit"
+        " [total mem amount%s%.1f%%]",
+        s->name, (float)s->inf->total_mem_percent/10,
+        operatorshortnames[pr->operator], (float) pr->limit/10.0);
+      okay= FALSE;
+    } else {
+      DEBUG("'%s' total mem amount check passed "
+        "[current total mem amount=%.1f%%]\n", s->name,
+        (float)s->inf->total_mem_percent/10);
+    }
+    break;
+
   default:
log("'%s' error -- unknown resource ID: [%d]\n", s->name, pr->resource_id);
     return;
------------------------------------------------------------------------


_______________________________________________
monit-dev mailing list
address@hidden
http://lists.nongnu.org/mailman/listinfo/monit-dev




reply via email to

[Prev in Thread] Current Thread [Next in Thread]