Re: Using the monitor function with thresholds

Dave Shield <[email protected]>
Newsgroups gmane.network.net-snmp.user
Message-ID <[email protected]>
2009/5/13 Richard Gipps <[email protected]>:
>                 I have been using the monitor function with positive
> thresholds and it works well. When I try to use it with negative thresholds
> it does not seem to work at all (doesn’t send traps).

Hmmm.....   I have a horrible feeling that you are quite correct.
Can you please try the attached patch, and see whether this
fixes things for you.

Dave

------------------------------------------------------------------------------
The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your
production scanning environment may not be a perfect world - but thanks to
Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700
Series Scanner you'll get full speed at 300 dpi even with all image 
processing features enabled. http://p.sf.net/sfu/kodak-com

_______________________________________________
Net-snmp-users mailing list
[email protected]
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users
monitor.patch (text/x-patch, 1.6 KB)
Index: ../agent/mibgroup/disman/event/mteTriggerConf.c
===================================================================
--- agent/mibgroup/disman/event/mteTriggerConf.c	(revision 17535)
+++ agent/mibgroup/disman/event/mteTriggerConf.c	(working copy)
@@ -502,7 +502,6 @@
                     memcpy(oid_name_buf, buf, SPRINT_MAX_LEN);
                     memset(         buf,   0, SPRINT_MAX_LEN);
                     cp  = copy_nword(cp, buf, SPRINT_MAX_LEN);
-                    if ( buf[0] != '-' )
                         value = strtol(buf, NULL, 0);
     
                     /*
@@ -512,7 +511,7 @@
                     memcpy( buf, cp, strlen(cp));
                     cp = NULL;  /* To terminate the processing loop */
                     DEBUGMSGTL(("disman:event:conf", "%s: Thresh (%s, %d, %s)\n",
-                                              tname, oid_name_buf, op, buf));
+                                              tname, oid_name_buf, value, buf));
                     break;
                 }
             }
@@ -634,7 +633,6 @@
         }
         break;
     case MTE_TRIGGER_THRESHOLD:
-        if ( buf[0] != '-' ) {
             entry->mteTThFallValue  = value;
             value = strtol(buf, NULL, 0);
             entry->mteTThRiseValue  = value;
@@ -679,10 +677,7 @@
                 memcpy(entry->mteTThFallEvent,  "_mteTriggerFalling", 18);
             }
             cp = skip_token(buf);   /* skip riseThreshold value */
-        } else {
-            /* Skip absolute threshold placeholders */
-            cp = skip_token(buf);
-        }
+
         /*
          * Parse and set (optional) Delta thresholds & events
          */
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.