From 0b6423f9c99d9edf8c96fefd0f6c453859395aa1 Mon Sep 17 00:00:00 2001 From: Holger Weiss Date: Mon, 30 Sep 2013 00:03:24 +0200 Subject: Import Nagios Plugins site Import the Nagios Plugins web site, Cronjobs, infrastructure scripts, and configuration files. --- web/attachments/221749-check_snmp_sourceip.patch | 78 ++++++++++++++++++++++++ 1 file changed, 78 insertions(+) create mode 100644 web/attachments/221749-check_snmp_sourceip.patch (limited to 'web/attachments/221749-check_snmp_sourceip.patch') diff --git a/web/attachments/221749-check_snmp_sourceip.patch b/web/attachments/221749-check_snmp_sourceip.patch new file mode 100644 index 0000000..2bba2f4 --- /dev/null +++ b/web/attachments/221749-check_snmp_sourceip.patch @@ -0,0 +1,78 @@ +--- check_snmp.c.orig 2007-03-22 15:24:22.000000000 +0100 ++++ check_snmp.c 2007-03-22 15:23:00.000000000 +0100 +@@ -103,6 +103,7 @@ + int errcode, excode; + + char *server_address = NULL; ++char *client_address = NULL; + char *community = NULL; + char *authpriv = NULL; + char *proto = NULL; +@@ -183,11 +184,22 @@ + + /* create the command line to execute */ + if(usesnmpgetnext == TRUE) { ++ if (client_address != NULL) ++ asprintf(&command_line, "%s --clientaddr=%s -t %d -r %d -m %s -v %s %s %s:%s %s", ++ PATH_TO_SNMPGETNEXT, client_address, timeout_interval, retries, miblist, proto, ++ authpriv, server_address, port, oid); ++ if (client_address == NULL) + asprintf(&command_line, "%s -t %d -r %d -m %s -v %s %s %s:%s %s", + PATH_TO_SNMPGETNEXT, timeout_interval, retries, miblist, proto, + authpriv, server_address, port, oid); + }else{ + ++ if (client_address != NULL) ++ asprintf (&command_line, "%s --clientaddr=%s -t %d -r %d -m %s -v %s %s %s:%s %s", ++ PATH_TO_SNMPGET, client_address, timeout_interval, retries, miblist, proto, ++ authpriv, server_address, port, oid); ++ ++ if (client_address == NULL) + asprintf (&command_line, "%s -t %d -r %d -m %s -v %s %s %s:%s %s", + PATH_TO_SNMPGET, timeout_interval, retries, miblist, proto, + authpriv, server_address, port, oid); +@@ -398,6 +410,7 @@ + static struct option longopts[] = { + STD_LONG_OPTS, + {"community", required_argument, 0, 'C'}, ++ {"source", required_argument, 0, 'S'}, + {"oid", required_argument, 0, 'o'}, + {"object", required_argument, 0, 'o'}, + {"delimiter", required_argument, 0, 'd'}, +@@ -436,7 +449,7 @@ + } + + while (1) { +- c = getopt_long (argc, argv, "nhvVt:c:w:H:C:o:e:E:d:D:s:t:R:r:l:u:p:m:P:L:U:a:A:X:", ++ c = getopt_long (argc, argv, "nhvVt:c:w:H:S:C:o:e:E:d:D:s:t:R:r:l:u:p:m:P:L:U:a:A:X:", + longopts, &option); + + if (c == -1 || c == EOF) +@@ -462,6 +475,9 @@ + case 'H': /* Host or server */ + server_address = optarg; + break; ++ case 'S': /* Client source address */ ++ client_address = optarg; ++ break; + case 'p': /* TCP port number */ + port = optarg; + break; +@@ -919,6 +935,8 @@ + /* SNMP and Authentication Protocol */ + printf (" %s\n", "-n, --next"); + printf (" %s\n", _("Use SNMP GETNEXT instead of SNMP GET")); ++ printf (" %s\n", "-S, --source=ADDRESS"); ++ printf (" %s\n", _("Specify SNMP client source address")); + printf (" %s\n", "-P, --protocol=[1|2c|3]"); + printf (" %s\n", _("SNMP protocol version")); + printf (" %s\n", "-L, --seclevel=[noAuthNoPriv|authNoPriv|authPriv]"); +@@ -1005,7 +1023,7 @@ + print_usage (void) + { + printf (_("Usage:")); +- printf ("%s -H -o [-w warn_range] [-c crit_range]\n",progname); ++ printf ("%s -H -o [-S source_ip_address] [-w warn_range] [-c crit_range]\n",progname); + printf ("[-C community] [-s string] [-r regex] [-R regexi] [-t timeout] [-e retries]\n"); + printf ("[-l label] [-u units] [-p port-number] [-d delimiter] [-D output-delimiter]\n"); + printf ("[-m miblist] [-P snmp version] [-L seclevel] [-U secname] [-a authproto]\n"); -- cgit v1.2.3-74-g34f1