diff options
author | Stef Walter <stef@memberwebs.com> | 2006-03-12 00:37:53 +0000 |
---|---|---|
committer | Stef Walter <stef@memberwebs.com> | 2006-03-12 00:37:53 +0000 |
commit | 747d94deb016b5eb4d5738d785781463f8ba4595 (patch) | |
tree | 985af0408bee05361f2146ea3b47260899e18947 /src/bsnmp-regex.c | |
parent | 300a80192acb2d86a90890694199d6054163bce8 (diff) |
Other small fixes.
Diffstat (limited to 'src/bsnmp-regex.c')
-rw-r--r-- | src/bsnmp-regex.c | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/src/bsnmp-regex.c b/src/bsnmp-regex.c index 4792d77..12950b7 100644 --- a/src/bsnmp-regex.c +++ b/src/bsnmp-regex.c @@ -23,7 +23,7 @@ #include "regex_oid.h" #define DEFAULT_CONFIG CONF_PREFIX "/rrdbot" -#define DEFAULT_FIFO "/var/run/snmp-regex.fifo" /* TODO: Configure this properly */ +#define DEFAULT_FIFO "/var/run/snmp-regex.fifo" /* our module handle */ static struct lmodule *module; @@ -934,10 +934,14 @@ op_regexentry (struct snmp_context *ctx, struct snmp_value *value, return (string_get (value, data->descr, -1)); case LEAF_regexLast: - ticks = getcurrticks (); - if (ticks == 0) - return SNMP_ERR_GENERR; - value->v.uint32 = (ticks - data->last_update); + if (data->last_update) { + ticks = getcurrticks (); + if (ticks == 0) + return SNMP_ERR_GENERR; + value->v.uint32 = (ticks - data->last_update); + } else { + value->v.uint32 = 0; + } break; case LEAF_regexValue: @@ -985,6 +989,9 @@ static void module_start (void) { reg_index = or_register (&oid_regex, "The MIB for regex data.", module); + + /* Initial reads */ + receive_log (fifo_fd, NULL); } /* Called, when the module is to be unloaded after it was successfully loaded */ |