--- check_disk.c.old	2010-04-24 02:49:24.000000000 +0200
+++ check_disk.c	2010-04-24 02:59:44.000000000 +0200
@@ -159,6 +159,10 @@
   char *details;
   char *perf;
   char *preamble;
+  /* mi@bacher.at: pathname and devname with "-inodes" for inodes perfdata*/
+  char *mountdir_inodes;
+  char *devname_inodes;
+  /* mi@bacher.at: end */
   double inode_space_pct;
   uintmax_t total, available, available_to_root, used;
   double dfree_pct = -1, dused_pct = -1;
@@ -166,6 +170,10 @@
   double dused_inodes_percent, dfree_inodes_percent;
   double warning_high_tide;
   double critical_high_tide;
+  /* mi@bacher.at: high tides for inodes */
+  double warning_high_tide_inodes;
+  double critical_high_tide_inodes;
+  /* mi@bacher.at: end */
   int temp_result;
 
   struct mount_entry *me;
@@ -363,6 +371,10 @@
       /* *_high_tide must be reinitialized at each run */
       warning_high_tide = UINT_MAX;
       critical_high_tide = UINT_MAX;
+      /* mi@bacher.at:initialize  high tides for inodes */
+      warning_high_tide_inodes = UINT_MAX;
+      critical_high_tide_inodes = UINT_MAX;
+      /* mi@bacher.at: end */
 
       if (path->freespace_units->warning != NULL) {
         warning_high_tide = dtotal_units - path->freespace_units->warning->end;
@@ -376,6 +388,16 @@
       if (path->freespace_percent->critical != NULL) {
         critical_high_tide = abs( min( (double) critical_high_tide, (double) (1.0 - path->freespace_percent->critical->end/100)*dtotal_units ));
       }
+      /* mi@bacher.at: get warning and critical high tides */
+      if (path->freeinodes_percent->warning != NULL) {
+	warning_high_tide_inodes = 100 - path->freeinodes_percent->warning->end;
+      }
+      if (path->freeinodes_percent->critical != NULL) {
+        critical_high_tide_inodes = 100 - path->freeinodes_percent->critical->end;
+      } 
+      /* mi@bacher.at: end */
+
+	
 
       /* Nb: *_high_tide are unset when == UINT_MAX */
       asprintf (&perf, "%s %s", perf,
@@ -386,6 +408,27 @@
                           TRUE, 0,
                           TRUE, dtotal_units));
 
+
+      /* mi@bacher.at: add inodes used (percent) with warning and critical thresholds to perfdata string */
+      asprintf (&mountdir_inodes, "%s-inodes", me->me_mountdir);
+      asprintf (&devname_inodes, "%s-inodes", me->me_devname);
+	      
+
+      asprintf (&perf, "%s %s", perf,
+		perfdata ((!strcmp(me->me_mountdir, "none") || display_mntp) ? devname_inodes : mountdir_inodes,
+			  dused_inodes_percent, "%",
+			  (warning_high_tide_inodes != UINT_MAX ? TRUE : FALSE), warning_high_tide_inodes,
+			  (critical_high_tide_inodes != UINT_MAX ? TRUE : FALSE), critical_high_tide_inodes,
+			  FALSE, 0,
+			  FALSE, 0)); 
+
+
+      free(mountdir_inodes); 
+      free(devname_inodes);
+      /* mi@bacher.at: end */
+
+
+
       if (disk_result==STATE_OK && erronly && !verbose)
         continue;
 
@@ -413,6 +456,7 @@
 
   }
 
+
   if (verbose >= 2)
     asprintf (&output, "%s%s", output, details);
 
@@ -509,6 +553,7 @@
     if (strcmp ("-to", argv[c]) == 0)
       strcpy (argv[c], "-t");
 
+
   while (1) {
     c = getopt_long (argc, argv, "+?VqhveCt:c:w:K:W:u:p:x:X:mklLg:R:r:i:I:MEA", longopts, &option);
 
@@ -684,6 +729,7 @@
 
       previous = NULL;
       while (temp_list) {
+
         if (temp_list->best_match) {
           if (np_regex_match_mount_entry(temp_list->best_match, &re)) {
 
