2009/11/30 Sam V <[email protected]>:
> Now, in case of a threshold
> trigger
> which have multiple startup cases, Raising, Falling, RisingAndFalling. How
> can specify that I want a startup condition to be true on for the rising case
> and not all cases?
In term of configuring this via the snmpd.conf file, this is not
currently possible.
The "monitor" directive doesn't provide that level of control.
Try the attached patch (untested), which should extend the '-s' flag to
support '-sr' for rising only, and '-sf' for falling only. Please let me
know how it works for you.
Dave
Index: mteTriggerConf.c
===================================================================
--- mteTriggerConf.c (revision 17786)
+++ mteTriggerConf.c (working copy)
@@ -156,6 +156,7 @@
MTE_TRIGGER_FLAG_VALID;
long idx = 0;
long startup = 1; /* ??? or 0 */
+ long startTh = MTE_THRESH_START_RISEFALL;
long repeat = 600;
netsnmp_session *sess = NULL;
@@ -396,10 +397,19 @@
case 'S': /* disable startup tests */
startup = 0;
+ startTh = 0;
break;
case 's': /* enable startup tests (default?) */
startup = 1;
+ switch (buf[2]) {
+ case 'r':
+ startTh = MTE_THRESH_START_RISE;
+ break;
+ case 'f':
+ startTh = MTE_THRESH_START_FALL;
+ break;
+ }
break;
case 't': /* threshold test - already handled */
@@ -636,8 +646,7 @@
entry->mteTThFallValue = value;
value = strtol(buf, NULL, 0);
entry->mteTThRiseValue = value;
- if (!startup)
- entry->mteTThStartup = 0;
+ entry->mteTThStartup = startTh;
if ( idx > 0 ) {
/*
* Refer to the objects for this trigger (if any)...
------------------------------------------------------------------------------
Join us December 9, 2009 for the Red Hat Virtual Experience,
a free event focused on virtualization and cloud computing.
Attend in-depth sessions from your desk. Your couch. Anywhere.
http://p.sf.net/sfu/redhat-sfdev2dev
_______________________________________________
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