Back to index

nagios-plugins  1.4.16
Defines | Functions | Variables
check_snmp.c File Reference
#include "common.h"
#include "utils.h"
#include "utils_cmd.h"
#include "regex.h"

Go to the source code of this file.

Defines

#define DEFAULT_COMMUNITY   "public"
#define DEFAULT_PORT   "161"
#define DEFAULT_MIBLIST   "ALL"
#define DEFAULT_PROTOCOL   "1"
#define DEFAULT_TIMEOUT   1
#define DEFAULT_RETRIES   5
#define DEFAULT_AUTH_PROTOCOL   "MD5"
#define DEFAULT_PRIV_PROTOCOL   "DES"
#define DEFAULT_DELIMITER   "="
#define DEFAULT_OUTPUT_DELIMITER   " "
#define mark(a)   ((a)!=0?"*":"")
#define CHECK_UNDEF   0
#define CRIT_PRESENT   1
#define CRIT_STRING   2
#define CRIT_REGEX   4
#define WARN_PRESENT   8
#define WARN_STRING   16
#define WARN_REGEX   32
#define MAX_OIDS   8
#define L_CALCULATE_RATE   CHAR_MAX+1
#define L_RATE_MULTIPLIER   CHAR_MAX+2
#define L_INVERT_SEARCH   CHAR_MAX+3
#define GOBBLE_TOS(c, s)   while(c[0]!='\0' && strchr(s, c[0])==NULL) { c++; }
#define COUNT_SEQ(c, bk, dq)

Functions

int process_arguments (int, char **)
int validate_arguments (void)
char * thisarg (char *str)
char * nextarg (char *str)
void print_usage (void)
void print_help (void)
int main (int argc, char **argv)

Variables

const char * progname = "check_snmp"
const char * copyright = "1999-2007"
const char * email = "nagiosplug-devel@lists.sourceforge.net"
char regex_expect [MAX_INPUT_BUFFER] = ""
regex_t preg
regmatch_t pmatch [10]
char errbuf [MAX_INPUT_BUFFER] = ""
char perfstr [MAX_INPUT_BUFFER] = "| "
int cflags = REG_EXTENDED | REG_NOSUB | REG_NEWLINE
int eflags = 0
int errcode
int excode
char * server_address = NULL
char * community = NULL
char ** authpriv = NULL
char * proto = NULL
char * seclevel = NULL
char * secname = NULL
char * authproto = NULL
char * privproto = NULL
char * authpasswd = NULL
char * privpasswd = NULL
char ** oids = NULL
char * label
char * units
char * port
char * snmpcmd
char string_value [MAX_INPUT_BUFFER] = ""
int invert_search = 0
char ** labels = NULL
char ** unitv = NULL
size_t nlabels = 0
size_t labels_size = 8
size_t nunits = 0
size_t unitv_size = 8
int numoids = 0
int numauthpriv = 0
int verbose = 0
int usesnmpgetnext = FALSE
char * warning_thresholds = NULL
char * critical_thresholds = NULL
thresholdsthlds [MAX_OIDS]
double response_value [MAX_OIDS]
int retries = 0
int eval_method [MAX_OIDS]
char * delimiter
char * output_delim
char * miblist = NULL
int needmibs = FALSE
int calculate_rate = 0
int rate_multiplier = 1
state_dataprevious_state
double previous_value [MAX_OIDS]
int perf_labels = 1

Define Documentation

#define CHECK_UNDEF   0

Definition at line 52 of file check_snmp.c.

#define COUNT_SEQ (   c,
  bk,
  dq 
)
Value:
switch(c[0]) {\
       case '\\': \
              if (bk) bk--; \
              else bk++; \
              break; \
       case '"': \
              if (!dq) { dq++; } \
              else if(!bk) { dq--; } \
              else { bk--; } \
              break; \
       }

Definition at line 72 of file check_snmp.c.

#define CRIT_PRESENT   1

Definition at line 53 of file check_snmp.c.

#define CRIT_REGEX   4

Definition at line 55 of file check_snmp.c.

#define CRIT_STRING   2

Definition at line 54 of file check_snmp.c.

#define DEFAULT_AUTH_PROTOCOL   "MD5"

Definition at line 45 of file check_snmp.c.

#define DEFAULT_COMMUNITY   "public"

Definition at line 39 of file check_snmp.c.

#define DEFAULT_DELIMITER   "="

Definition at line 47 of file check_snmp.c.

#define DEFAULT_MIBLIST   "ALL"

Definition at line 41 of file check_snmp.c.

#define DEFAULT_OUTPUT_DELIMITER   " "

Definition at line 48 of file check_snmp.c.

#define DEFAULT_PORT   "161"

Definition at line 40 of file check_snmp.c.

#define DEFAULT_PRIV_PROTOCOL   "DES"

Definition at line 46 of file check_snmp.c.

#define DEFAULT_PROTOCOL   "1"

Definition at line 42 of file check_snmp.c.

#define DEFAULT_RETRIES   5

Definition at line 44 of file check_snmp.c.

#define DEFAULT_TIMEOUT   1

Definition at line 43 of file check_snmp.c.

#define GOBBLE_TOS (   c,
 
)    while(c[0]!='\0' && strchr(s, c[0])==NULL) { c++; }

Definition at line 69 of file check_snmp.c.

#define L_CALCULATE_RATE   CHAR_MAX+1

Definition at line 63 of file check_snmp.c.

#define L_INVERT_SEARCH   CHAR_MAX+3

Definition at line 65 of file check_snmp.c.

#define L_RATE_MULTIPLIER   CHAR_MAX+2

Definition at line 64 of file check_snmp.c.

#define mark (   a)    ((a)!=0?"*":"")

Definition at line 50 of file check_snmp.c.

#define MAX_OIDS   8

Definition at line 60 of file check_snmp.c.

#define WARN_PRESENT   8

Definition at line 56 of file check_snmp.c.

#define WARN_REGEX   32

Definition at line 58 of file check_snmp.c.

#define WARN_STRING   16

Definition at line 57 of file check_snmp.c.


Function Documentation

int main ( int  argc,
char **  argv 
)

Definition at line 148 of file check_snmp.c.

{
       int i, len, line, total_oids;
       unsigned int bk_count = 0, dq_count = 0;
       int iresult = STATE_UNKNOWN;
       int result = STATE_UNKNOWN;
       int return_code = 0;
       int external_error = 0;
       char **command_line = NULL;
       char *cl_hidden_auth = NULL;
       char *oidname = NULL;
       char *response = NULL;
       char *mult_resp = NULL;
       char *outbuff;
       char *ptr = NULL;
       char *show = NULL;
       char *th_warn=NULL;
       char *th_crit=NULL;
       char type[8] = "";
       output chld_out, chld_err;
       char *previous_string=NULL;
       char *ap=NULL;
       char *state_string=NULL;
       size_t response_length, current_length, string_length;
       char *temp_string=NULL;
       char *quote_string=NULL;
       time_t current_time;
       double temp_double;
       time_t duration;
       char *conv = "12345678";
       int is_counter=0;

       setlocale (LC_ALL, "");
       bindtextdomain (PACKAGE, LOCALEDIR);
       textdomain (PACKAGE);

       labels = malloc (labels_size);
       unitv = malloc (unitv_size);
       for (i = 0; i < MAX_OIDS; i++)
              eval_method[i] = CHECK_UNDEF;

       label = strdup ("SNMP");
       units = strdup ("");
       port = strdup (DEFAULT_PORT);
       outbuff = strdup ("");
       delimiter = strdup (" = ");
       output_delim = strdup (DEFAULT_OUTPUT_DELIMITER);
       timeout_interval = DEFAULT_TIMEOUT;
       retries = DEFAULT_RETRIES;

       np_init( (char *) progname, argc, argv );

       /* Parse extra opts if any */
       argv=np_extra_opts (&argc, argv, progname);

       np_set_args(argc, argv);

       if (process_arguments (argc, argv) == ERROR)
              usage4 (_("Could not parse arguments"));

       if(calculate_rate) {
              if (!strcmp(label, "SNMP"))
                     label = strdup("SNMP RATE");
              time(&current_time);
              i=0;
              previous_state = np_state_read();
              if(previous_state!=NULL) {
                     /* Split colon separated values */
                     previous_string = strdup((char *) previous_state->data);
                     while((ap = strsep(&previous_string, ":")) != NULL) {
                            if(verbose>2)
                                   printf("State for %d=%s\n", i, ap);
                            previous_value[i++]=strtod(ap,NULL);
                     }
              }
       }

       /* Populate the thresholds */
       th_warn=warning_thresholds;
       th_crit=critical_thresholds;
       for (i=0; i<numoids; i++) {
              char *w = th_warn ? strndup(th_warn, strcspn(th_warn, ",")) : NULL;
              char *c = th_crit ? strndup(th_crit, strcspn(th_crit, ",")) : NULL;
              /* Skip empty thresholds, while avoiding segfault */
              set_thresholds(&thlds[i],
                             w ? strpbrk(w, NP_THRESHOLDS_CHARS) : NULL,
                             c ? strpbrk(c, NP_THRESHOLDS_CHARS) : NULL);
              if (w) {
                     th_warn=strchr(th_warn, ',');
                     if (th_warn) th_warn++;
                     free(w);
              }
              if (c) {
                     th_crit=strchr(th_crit, ',');
                     if (th_crit) th_crit++;
                     free(c);
              }
       }

       /* Create the command array to execute */
       if(usesnmpgetnext == TRUE) {
              snmpcmd = strdup (PATH_TO_SNMPGETNEXT);
       }else{
              snmpcmd = strdup (PATH_TO_SNMPGET);
       }

       /* 9 arguments to pass before authpriv options + 1 for host and numoids. Add one for terminating NULL */
       command_line = calloc (9 + numauthpriv + 1 + numoids + 1, sizeof (char *));
       command_line[0] = snmpcmd;
       command_line[1] = strdup ("-t");
       asprintf (&command_line[2], "%d", timeout_interval);
       command_line[3] = strdup ("-r");
       asprintf (&command_line[4], "%d", retries);
       command_line[5] = strdup ("-m");
       command_line[6] = strdup (miblist);
       command_line[7] = "-v";
       command_line[8] = strdup (proto);

       for (i = 0; i < numauthpriv; i++) {
              command_line[9 + i] = authpriv[i];
       }

       asprintf (&command_line[9 + numauthpriv], "%s:%s", server_address, port);

       /* This is just for display purposes, so it can remain a string */
       asprintf(&cl_hidden_auth, "%s -t %d -r %d -m %s -v %s %s %s:%s",
              snmpcmd, timeout_interval, retries, strlen(miblist) ? miblist : "''", proto, "[authpriv]",
              server_address, port);

       for (i = 0; i < numoids; i++) {
              command_line[9 + numauthpriv + 1 + i] = oids[i];
              asprintf(&cl_hidden_auth, "%s %s", cl_hidden_auth, oids[i]);   
       }

       command_line[9 + numauthpriv + 1 + numoids] = NULL;

       if (verbose)
              printf ("%s\n", cl_hidden_auth);

       /* Run the command */
       return_code = cmd_run_array (command_line, &chld_out, &chld_err, 0);

       /* Due to net-snmp sometimes showing stderr messages with poorly formed MIBs,
          only return state unknown if return code is non zero or there is no stdout.
          Do this way so that if there is stderr, will get added to output, which helps problem diagnosis
       */
       if (return_code != 0)
              external_error=1;
       if (chld_out.lines == 0)
              external_error=1;
       if (external_error) {
              if (chld_err.lines > 0) {
                     printf (_("External command error: %s\n"), chld_err.line[0]);
                     for (i = 1; i < chld_err.lines; i++) {
                            printf ("%s\n", chld_err.line[i]);
                     }
              } else {
                     printf(_("External command error with no output (return code: %d)\n"), return_code);
              }
              exit (STATE_UNKNOWN);
       }

       if (verbose) {
              for (i = 0; i < chld_out.lines; i++) {
                     printf ("%s\n", chld_out.line[i]);
              }
       }

       for (line=0, i=0; line < chld_out.lines; line++, i++) {
              if(calculate_rate)
                     conv = "%.10g";
              else
                     conv = "%.0f";

              ptr = chld_out.line[line];
              oidname = strpcpy (oidname, ptr, delimiter);
              response = strstr (ptr, delimiter);
              if (response == NULL)
                     break;

              if (verbose > 2) {
                     printf("Processing oid %i (line %i)\n  oidname: %s\n  response: %s\n", i+1, line+1, oidname, response);
              }

              /* Clean up type array - Sol10 does not necessarily zero it out */
              bzero(type, sizeof(type));

              is_counter=0;
              /* We strip out the datatype indicator for PHBs */
              if (strstr (response, "Gauge: ")) {
                     show = strstr (response, "Gauge: ") + 7;
              } 
              else if (strstr (response, "Gauge32: ")) {
                     show = strstr (response, "Gauge32: ") + 9;
              } 
              else if (strstr (response, "Counter32: ")) {
                     show = strstr (response, "Counter32: ") + 11;
                     is_counter=1;
                     if(!calculate_rate) 
                            strcpy(type, "c");
              }
              else if (strstr (response, "Counter64: ")) {
                     show = strstr (response, "Counter64: ") + 11;
                     is_counter=1;
                     if(!calculate_rate)
                            strcpy(type, "c");
              }
              else if (strstr (response, "INTEGER: ")) {
                     show = strstr (response, "INTEGER: ") + 9;
              }
              else if (strstr (response, "STRING: ")) {
                     show = strstr (response, "STRING: ") + 8;
                     conv = "%.10g";

                     /* Get the rest of the string on multi-line strings */
                     ptr = show;
                     COUNT_SEQ(ptr, bk_count, dq_count)
                     while (dq_count && ptr[0] != '\n' && ptr[0] != '\0') {
                            ptr++;
                            GOBBLE_TOS(ptr, "\n\"\\")
                            COUNT_SEQ(ptr, bk_count, dq_count)
                     }

                     if (dq_count) { /* unfinished line */
                            /* copy show verbatim first */
                            if (!mult_resp) mult_resp = strdup("");
                            asprintf (&mult_resp, "%s%s:\n%s\n", mult_resp, oids[i], show);
                            /* then strip out unmatched double-quote from single-line output */
                            if (show[0] == '"') show++;

                            /* Keep reading until we match end of double-quoted string */
                            for (line++; line < chld_out.lines; line++) {
                                   ptr = chld_out.line[line];
                                   asprintf (&mult_resp, "%s%s\n", mult_resp, ptr);

                                   COUNT_SEQ(ptr, bk_count, dq_count)
                                   while (dq_count && ptr[0] != '\n' && ptr[0] != '\0') {
                                          ptr++;
                                          GOBBLE_TOS(ptr, "\n\"\\")
                                          COUNT_SEQ(ptr, bk_count, dq_count)
                                   }
                                   /* Break for loop before next line increment when done */
                                   if (!dq_count) break;
                            }
                     }

              }
              else if (strstr (response, "Timeticks: ")) {
                     show = strstr (response, "Timeticks: ");
              }
              else
                     show = response;

              iresult = STATE_DEPENDENT;

              /* Process this block for numeric comparisons */
              /* Make some special values,like Timeticks numeric only if a threshold is defined */
              if (thlds[i]->warning || thlds[i]->critical || calculate_rate) {
                     ptr = strpbrk (show, "0123456789");
                     if (ptr == NULL)
                            die (STATE_UNKNOWN,_("No valid data returned"));
                     response_value[i] = strtod (ptr, NULL);

                     if(calculate_rate) {
                            if (previous_state!=NULL) {
                                   duration = current_time-previous_state->time;
                                   if(duration<=0)
                                          die(STATE_UNKNOWN,_("Time duration between plugin calls is invalid"));
                                   temp_double = response_value[i]-previous_value[i];
                                   /* Simple overflow catcher (same as in rrdtool, rrd_update.c) */
                                   if(is_counter) {
                                          if(temp_double<(double)0.0)
                                                 temp_double+=(double)4294967296.0; /* 2^32 */
                                          if(temp_double<(double)0.0)
                                                 temp_double+=(double)18446744069414584320.0; /* 2^64-2^32 */;
                                   }
                                   /* Convert to per second, then use multiplier */
                                   temp_double = temp_double/duration*rate_multiplier;
                                   iresult = get_status(temp_double, thlds[i]);
                                   asprintf (&show, conv, temp_double);
                            }
                     } else {
                            iresult = get_status(response_value[i], thlds[i]);
                            asprintf (&show, conv, response_value[i]);
                     }
              }

              /* Process this block for string matching */
              else if (eval_method[i] & CRIT_STRING) {
                     if (strcmp (show, string_value))
                            iresult = (invert_search==0) ? STATE_CRITICAL : STATE_OK;
                     else
                            iresult = (invert_search==0) ? STATE_OK : STATE_CRITICAL;
              }

              /* Process this block for regex matching */
              else if (eval_method[i] & CRIT_REGEX) {
                     excode = regexec (&preg, response, 10, pmatch, eflags);
                     if (excode == 0) {
                            iresult = (invert_search==0) ? STATE_OK : STATE_CRITICAL;
                     }
                     else if (excode != REG_NOMATCH) {
                            regerror (excode, &preg, errbuf, MAX_INPUT_BUFFER);
                            printf (_("Execute Error: %s\n"), errbuf);
                            exit (STATE_CRITICAL);
                     }
                     else {
                            iresult = (invert_search==0) ? STATE_CRITICAL : STATE_OK;
                     }
              }

              /* Process this block for existence-nonexistence checks */
              /* TV: Should this be outside of this else block? */
              else {
                     if (eval_method[i] & CRIT_PRESENT)
                            iresult = STATE_CRITICAL;
                     else if (eval_method[i] & WARN_PRESENT)
                            iresult = STATE_WARNING;
                     else if (response && iresult == STATE_DEPENDENT)
                            iresult = STATE_OK;
              }

              /* Result is the worst outcome of all the OIDs tested */
              result = max_state (result, iresult);

              /* Prepend a label for this OID if there is one */
              if (nlabels >= (size_t)1 && (size_t)i < nlabels && labels[i] != NULL)
                     asprintf (&outbuff, "%s%s%s %s%s%s", outbuff,
                            (i == 0) ? " " : output_delim,
                            labels[i], mark (iresult), show, mark (iresult));
              else
                     asprintf (&outbuff, "%s%s%s%s%s", outbuff, (i == 0) ? " " : output_delim,
                            mark (iresult), show, mark (iresult));

              /* Append a unit string for this OID if there is one */
              if (nunits > (size_t)0 && (size_t)i < nunits && unitv[i] != NULL)
                     asprintf (&outbuff, "%s %s", outbuff, unitv[i]);

              /* Write perfdata with whatever can be parsed by strtod, if possible */
              ptr = NULL;
              strtod(show, &ptr);
              if (ptr > show) {
                     if (perf_labels && nlabels >= (size_t)1 && (size_t)i < nlabels && labels[i] != NULL)
                            temp_string=labels[i];
                     else
                            temp_string=oidname;
                     if (strpbrk (temp_string, " ='\"") == NULL) {
                            strncat(perfstr, temp_string, sizeof(perfstr)-strlen(perfstr)-1);
                     } else {
                            if (strpbrk (temp_string, "'") == NULL) {
                                   quote_string="'";
                            } else {
                                   quote_string="\"";
                            }
                            strncat(perfstr, quote_string, sizeof(perfstr)-strlen(perfstr)-1);
                            strncat(perfstr, temp_string, sizeof(perfstr)-strlen(perfstr)-1);
                            strncat(perfstr, quote_string, sizeof(perfstr)-strlen(perfstr)-1);
                     }
                     strncat(perfstr, "=", sizeof(perfstr)-strlen(perfstr)-1);
                     len = sizeof(perfstr)-strlen(perfstr)-1;
                     strncat(perfstr, show, len>ptr-show ? ptr-show : len);

                     if (type)
                            strncat(perfstr, type, sizeof(perfstr)-strlen(perfstr)-1);
                     strncat(perfstr, " ", sizeof(perfstr)-strlen(perfstr)-1);
              }
       }
       total_oids=i;

       /* Save state data, as all data collected now */
       if(calculate_rate) {
              string_length=1024;
              state_string=malloc(string_length);
              if(state_string==NULL)
                     die(STATE_UNKNOWN, _("Cannot malloc"));
              
              current_length=0;
              for(i=0; i<total_oids; i++) {
                     asprintf(&temp_string,"%.0f",response_value[i]);
                     if(temp_string==NULL)
                            die(STATE_UNKNOWN,_("Cannot asprintf()"));
                     response_length = strlen(temp_string);
                     if(current_length+response_length>string_length) {
                            string_length=current_length+1024;
                            state_string=realloc(state_string,string_length);
                            if(state_string==NULL)
                                   die(STATE_UNKNOWN, _("Cannot realloc()"));
                     }
                     strcpy(&state_string[current_length],temp_string);
                     current_length=current_length+response_length;
                     state_string[current_length]=':';
                     current_length++;
                     free(temp_string);
              }
              state_string[--current_length]='\0';
              if (verbose > 2)
                     printf("State string=%s\n",state_string);
              
              /* This is not strictly the same as time now, but any subtle variations will cancel out */
              np_state_write_string(current_time, state_string );
              if(previous_state==NULL) {
                     /* Or should this be highest state? */
                     die( STATE_OK, _("No previous data to calculate rate - assume okay" ) );
              }
       }

       printf ("%s %s -%s %s\n", label, state_text (result), outbuff, perfstr);
       if (mult_resp) printf ("%s", mult_resp);

       return result;
}

Here is the call graph for this function:

char * nextarg ( char *  str)

Definition at line 969 of file check_snmp.c.

{
       if (str[0] == '\'') {
              str[0] = 0;
              if (strlen (str) > 1) {
                     str = strstr (str + 1, "'");
                     return (++str);
              }
              else {
                     return NULL;
              }
       }
       if (str[0] == ',') {
              str[0] = 0;
              if (strlen (str) > 1) {
                     return (++str);
              }
              else {
                     return NULL;
              }
       }
       if ((str = strstr (str, ",")) && strlen (str) > 1) {
              str[0] = 0;
              return (++str);
       }
       return NULL;
}

Here is the call graph for this function:

void print_help ( void  )
void print_usage ( void  )

Definition at line 389 of file check_cpqarray.c.

{
  printf("cpqarrayd [options]\n");
  printf("   -h         prints this text\n");
  printf("   -d         enables debugging\n");
}
int process_arguments ( int  argc,
char **  argv 
)
char * thisarg ( char *  str)

Definition at line 952 of file check_snmp.c.

{
       str += strspn (str, " \t\r\n");    /* trim any leading whitespace */
       if (str[0] == '\'') {       /* handle SIMPLE quoted strings */
              if (strlen (str) == 1 || !strstr (str + 1, "'"))
                     die (STATE_UNKNOWN, _("Unbalanced quotes\n"));
       }
       return str;
}

Here is the call graph for this function:

int validate_arguments ( void  )

Variable Documentation

char* authpasswd = NULL

Definition at line 111 of file check_snmp.c.

char** authpriv = NULL

Definition at line 105 of file check_snmp.c.

char* authproto = NULL

Definition at line 109 of file check_snmp.c.

int calculate_rate = 0

Definition at line 140 of file check_snmp.c.

Definition at line 99 of file check_snmp.c.

char* community = NULL

Definition at line 104 of file check_snmp.c.

const char* copyright = "1999-2007"

Definition at line 32 of file check_snmp.c.

Definition at line 131 of file check_snmp.c.

char* delimiter

Definition at line 136 of file check_snmp.c.

int eflags = 0

Definition at line 100 of file check_snmp.c.

const char* email = "nagiosplug-devel@lists.sourceforge.net"

Definition at line 33 of file check_snmp.c.

Definition at line 97 of file check_snmp.c.

int errcode

Definition at line 101 of file check_snmp.c.

Definition at line 135 of file check_snmp.c.

int excode

Definition at line 101 of file check_snmp.c.

int invert_search = 0

Definition at line 119 of file check_snmp.c.

char* label

Definition at line 114 of file check_snmp.c.

char** labels = NULL

Definition at line 120 of file check_snmp.c.

size_t labels_size = 8

Definition at line 123 of file check_snmp.c.

char* miblist = NULL

Definition at line 138 of file check_snmp.c.

int needmibs = FALSE

Definition at line 139 of file check_snmp.c.

size_t nlabels = 0

Definition at line 122 of file check_snmp.c.

int numauthpriv = 0

Definition at line 127 of file check_snmp.c.

int numoids = 0

Definition at line 126 of file check_snmp.c.

size_t nunits = 0

Definition at line 124 of file check_snmp.c.

char** oids = NULL

Definition at line 113 of file check_snmp.c.

char* output_delim

Definition at line 137 of file check_snmp.c.

int perf_labels = 1

Definition at line 144 of file check_snmp.c.

char perfstr[MAX_INPUT_BUFFER] = "| "

Definition at line 98 of file check_snmp.c.

Definition at line 96 of file check_snmp.c.

char* port

Definition at line 116 of file check_snmp.c.

regex_t preg

Definition at line 95 of file check_snmp.c.

Definition at line 142 of file check_snmp.c.

Definition at line 143 of file check_snmp.c.

char* privpasswd = NULL

Definition at line 112 of file check_snmp.c.

char* privproto = NULL

Definition at line 110 of file check_snmp.c.

const char* progname = "check_snmp"

Definition at line 31 of file check_snmp.c.

char* proto = NULL

Definition at line 106 of file check_snmp.c.

int rate_multiplier = 1

Definition at line 141 of file check_snmp.c.

Definition at line 94 of file check_snmp.c.

Definition at line 133 of file check_snmp.c.

int retries = 0

Definition at line 134 of file check_snmp.c.

char* seclevel = NULL

Definition at line 107 of file check_snmp.c.

char* secname = NULL

Definition at line 108 of file check_snmp.c.

Definition at line 103 of file check_snmp.c.

char* snmpcmd

Definition at line 117 of file check_snmp.c.

Definition at line 118 of file check_snmp.c.

Definition at line 132 of file check_snmp.c.

char* units

Definition at line 115 of file check_snmp.c.

char** unitv = NULL

Definition at line 121 of file check_snmp.c.

size_t unitv_size = 8

Definition at line 125 of file check_snmp.c.

Definition at line 129 of file check_snmp.c.

int verbose = 0

Definition at line 128 of file check_snmp.c.

Definition at line 130 of file check_snmp.c.