monit-dev
[Top][All Lists]
Advanced

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

Changes to monit/util.c


From: Martin Pala
Subject: Changes to monit/util.c
Date: Thu, 09 Dec 2004 13:10:55 -0500

Index: monit/util.c
diff -u monit/util.c:1.131 monit/util.c:1.132
--- monit/util.c:1.131  Tue Sep 28 14:24:01 2004
+++ monit/util.c        Thu Dec  9 17:02:44 2004
@@ -110,7 +110,7 @@
  *  @author Christian Hopp <address@hidden>
  *  @author Michael Amster, <address@hidden> 
  *
- *  @version \$Id: util.c,v 1.131 2004/09/28 14:24:01 martinp Exp $
+ *  @version \$Id: util.c,v 1.132 2004/12/09 17:02:44 martinp Exp $
  *  @file
  */
 
@@ -780,21 +780,35 @@
     
     if(dl->resource == RESOURCE_ID_INODE) {
            
-      printf(" %-20s = if %s %ld %s then %s else if recovered then %s\n",
-        "Inodes usage limit",
-        operatornames[dl->operator],
-        (dl->limit_absolute > -1)?dl->limit_absolute:dl->limit_percent,
-        (dl->limit_absolute > -1)?"":"%",
-        actionnames[a->failed->id], actionnames[a->passed->id]);
+      if(dl->limit_absolute > -1) {
+        printf(" %-20s = if %s %ld then %s else if recovered then %s\n",
+          "Inodes usage limit",
+          operatornames[dl->operator],
+          dl->limit_absolute,
+          actionnames[a->failed->id], actionnames[a->passed->id]);
+      } else {
+        printf(" %-20s = if %s %.1f%% then %s else if recovered then %s\n",
+          "Inodes usage limit",
+          operatornames[dl->operator],
+          dl->limit_percent/10.,
+          actionnames[a->failed->id], actionnames[a->passed->id]);
+      }
       
     } else if(dl->resource == RESOURCE_ID_SPACE) {
            
-      printf(" %-20s = if %s %ld %s then %s else if recovered then %s\n",
-        "Space usage limit",
-        operatornames[dl->operator],
-        (dl->limit_absolute > -1)?dl->limit_absolute:dl->limit_percent,
-        (dl->limit_absolute > -1)?"blocks":"%",
-        actionnames[a->failed->id], actionnames[a->passed->id]);
+      if(dl->limit_absolute > -1) {
+        printf(" %-20s = if %s %ld blocks then %s else if recovered then %s\n",
+          "Space usage limit",
+          operatornames[dl->operator],
+          dl->limit_absolute,
+          actionnames[a->failed->id], actionnames[a->passed->id]);
+      } else {
+        printf(" %-20s = if %s %.1f%% then %s else if recovered then %s\n",
+          "Space usage limit",
+          operatornames[dl->operator],
+          dl->limit_percent/10.,
+          actionnames[a->failed->id], actionnames[a->passed->id]);
+      }
 
     }
     




reply via email to

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