summaryrefslogtreecommitdiff
path: root/tools/rrdbot-get.c
diff options
context:
space:
mode:
authorStef Walter <stef@memberwebs.com>2008-07-29 02:29:15 +0000
committerStef Walter <stef@memberwebs.com>2008-07-29 02:29:15 +0000
commit0a3d06dfa8f534c48109e3afd49a292c3947d0cd (patch)
treea5f03f6c30f1415bef857dd7fce55f6ade64f8cd /tools/rrdbot-get.c
parent723785873edd5fc3c00fefc8894a2c2085676313 (diff)
- Add parameter to specify bind address.
Diffstat (limited to 'tools/rrdbot-get.c')
-rw-r--r--tools/rrdbot-get.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/tools/rrdbot-get.c b/tools/rrdbot-get.c
index 0f84578..9b038dd 100644
--- a/tools/rrdbot-get.c
+++ b/tools/rrdbot-get.c
@@ -413,6 +413,7 @@ version()
int
main (int argc, char* argv[])
{
+ char *bind_address = NULL;
char ch;
char* t;
@@ -421,7 +422,7 @@ main (int argc, char* argv[])
ctx.timeout = DEFAULT_TIMEOUT;
/* Parse the arguments nicely */
- while ((ch = getopt (argc, argv, "m:Mnrt:vV")) != -1) {
+ while ((ch = getopt (argc, argv, "m:Mnrs:t:vV")) != -1) {
switch (ch)
{
@@ -445,6 +446,11 @@ main (int argc, char* argv[])
ctx.recursive = 1;
break;
+ /* local source address */
+ case 's':
+ bind_address = optarg;
+ break;
+
/* The timeout */
case 't':
ctx.timeout = strtoul (optarg, &t, 10);
@@ -478,7 +484,7 @@ main (int argc, char* argv[])
usage ();
server_init ();
- snmp_engine_init (MAX_RETRIES);
+ snmp_engine_init (bind_address, MAX_RETRIES);
parse_argument (argv[0]);