author | Florian Forster <octo@leeloo.lan.home.verplant.org> | |
Tue, 10 Nov 2009 19:17:36 +0000 (20:17 +0100) | ||
committer | Florian Forster <octo@leeloo.lan.home.verplant.org> | |
Tue, 10 Nov 2009 19:17:36 +0000 (20:17 +0100) |
Conflicts:
src/snmp.c
src/snmp.c
1 | 2 | |||
---|---|---|---|---|
src/Makefile.am | patch | | diff1 | | diff2 | | blob | history |
src/rrdcached.c | patch | | diff1 | | diff2 | | blob | history |
src/snmp.c | patch | | diff1 | | diff2 | | blob | history |
diff --cc src/Makefile.am
Simple merge
diff --cc src/rrdcached.c
Simple merge
diff --cc src/snmp.c
index 7568cf67be39070dc8ec885d14edd4e195dde341,5ccc93ab545a4971629676872db2de790231af3a..ee40263836f047072a6468936d1ec29c849541cb
--- 1/src/snmp.c
--- 2/src/snmp.c
+++ b/src/snmp.c
}
}
- /* Check if an error occurred */
- if ((vl->val.string == NULL) || (endptr == (char *) vl->val.string))
+ if (status != 0)
{
- if (type == DS_TYPE_COUNTER)
- ret.counter = 0;
- else if (type == DS_TYPE_GAUGE)
- ret.gauge = NAN;
+ switch (type)
+ {
+ case DS_TYPE_COUNTER:
+ case DS_TYPE_DERIVE:
+ case DS_TYPE_ABSOLUTE:
+ memset (&ret, 0, sizeof (ret));
+ break;
+
+ case DS_TYPE_GAUGE:
+ ret.gauge = NAN;
+ break;
+
+ default:
+ ERROR ("snmp plugin: csnmp_value_list_to_value: Unknown "
+ "data source type: %i.", type);
+ ret.gauge = NAN;
+ }
}
- }
+ } /* if (vl->type == ASN_OCTET_STR) */
else if (type == DS_TYPE_COUNTER)
- ret.counter = temp;
+ {
+ ret.counter = tmp_unsigned;
+ }
else if (type == DS_TYPE_GAUGE)
{
ret.gauge = NAN;
if (defined != 0)
- ret.gauge = (scale * temp) + shift;
+ ret.gauge = (scale * tmp_signed) + shift;
}
+ else if (type == DS_TYPE_DERIVE)
+ ret.derive = (derive_t) temp;
+ else if (type == DS_TYPE_ABSOLUTE)
+ ret.absolute = (absolute_t) temp;
+ else
+ {
+ ERROR ("snmp plugin: csnmp_value_list_to_value: Unknown data source "
+ "type: %i.", type);
+ ret.gauge = NAN;
+ }
return (ret);
} /* value_t csnmp_value_list_to_value */