summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorStef Walter <stef@memberwebs.com>2006-11-28 01:53:57 +0000
committerStef Walter <stef@memberwebs.com>2006-11-28 01:53:57 +0000
commitfafb8142821a34311f55971674630b674b063495 (patch)
tree58aef24fc7ce8fc093d5e477dbacf8306b412859 /tools
parent9791f61c323d2769abfe0e9889b81c52ca1309af (diff)
Added SNMP v2 support.
Diffstat (limited to 'tools')
-rw-r--r--tools/rrdbot-get.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/tools/rrdbot-get.c b/tools/rrdbot-get.c
index e140eb1..0df7b84 100644
--- a/tools/rrdbot-get.c
+++ b/tools/rrdbot-get.c
@@ -121,6 +121,7 @@ send_req()
static void
setup_req(char* uri)
{
+ enum snmp_version version;
const char* msg;
char* scheme;
char* copy;
@@ -137,15 +138,16 @@ setup_req(char* uri)
ASSERT(ctx.hostname && path);
/* Currently we only support SNMP pollers */
- if(strcmp(scheme, "snmp") != 0)
- errx(2, "invalid scheme: %s", scheme);
+ msg = cfg_parse_scheme(scheme, &version);
+ if(msg)
+ errx(2, "%s: %s", msg, scheme);
if(sock_any_pton(ctx.hostname, &ctx.hostaddr,
SANY_OPT_DEFPORT(161) | SANY_OPT_DEFLOCAL) == -1)
err(1, "couldn't resolve host address (ignoring): %s", ctx.hostname);
memset(&ctx.pdu, 0, sizeof(ctx.pdu));
- ctx.pdu.version = 1;
+ ctx.pdu.version = version;
ctx.pdu.request_id = 0;
ctx.pdu.type = ctx.recursive ? SNMP_PDU_GETNEXT : SNMP_PDU_GET;
ctx.pdu.error_status = 0;