X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fsnmp.c;h=8e72ce60d99a8349e7b33f8809ced26bf0a3a37f;hb=3b4201d2235c25ed21174c41c526c9b7894de539;hp=00df3779bb52907c001de892b5ffae6ce9c5a442;hpb=b5ed3c9b617ba78a98f3ef279bb3efa325536080;p=collectd.git diff --git a/src/snmp.c b/src/snmp.c index 00df3779..8e72ce60 100644 --- a/src/snmp.c +++ b/src/snmp.c @@ -754,7 +754,21 @@ static value_t csnmp_value_list_to_value (struct variable_list *vl, int type, } else { - WARNING ("snmp plugin: I don't know the ASN type `%i'", (int) vl->type); + char oid_buffer[1024]; + + memset (oid_buffer, 0, sizeof (oid_buffer)); + snprint_objid (oid_buffer, sizeof (oid_buffer) - 1, + vl->name, vl->name_length); + +#ifdef ASN_NULL + if (vl->type == ASN_NULL) + INFO ("snmp plugin: OID \"%s\" is undefined (type ASN_NULL)", + oid_buffer); + else +#endif + WARNING ("snmp plugin: I don't know the ASN type \"%i\" (OID: %s)", + (int) vl->type, oid_buffer); + defined = 0; } @@ -951,7 +965,7 @@ static int csnmp_strvbcopy (char *dst, /* {{{ */ for (i = 0; i < num_chars; i++) { /* Check for control characters. */ - if ((src[i] >= 0) && (src[i] < 32)) + if ((unsigned char)src[i] < 32) return (csnmp_strvbcopy_hexstring (dst, vb, dst_size)); dst[i] = src[i]; } @@ -1127,7 +1141,7 @@ static int csnmp_dispatch_table (host_definition_t *host, data_definition_t *dat char temp[DATA_MAX_NAME_LEN]; if (instance_list_ptr == NULL) - ssnprintf (temp, sizeof (temp), "%u", (uint32_t) subid); + ssnprintf (temp, sizeof (temp), "%"PRIu32, (uint32_t) subid); else sstrncpy (temp, instance_list_ptr->instance, sizeof (temp));