- if (sk_disk_smart_get_power_on(d, &poweron) < 0) {
- WARNING("smart plugin: unable to get milliseconds since power on for %s.",
- dev);
- } else
- smart_submit(shortname, "smart_poweron", "", poweron / 1000.);
-
- if (sk_disk_smart_get_power_cycle(d, &powercycles) < 0) {
- WARNING("smart plugin: unable to get number of power cycles for %s.", dev);
- } else
- smart_submit(shortname, "smart_powercycles", "", powercycles);
-
- if (sk_disk_smart_get_bad(d, &badsectors) < 0) {
- WARNING("smart plugin: unable to get number of bad sectors for %s.", dev);
- } else
- smart_submit(shortname, "smart_badsectors", "", badsectors);
-
- if (sk_disk_smart_get_temperature(d, &temperature) < 0) {
- WARNING("smart plugin: unable to get temperature for %s.", dev);
- } else
- smart_submit(shortname, "smart_temperature", "",
- temperature / 1000. - 273.15);
+ uint64_t value;
+ if (sk_disk_smart_get_power_on(d, &value) >= 0)
+ smart_submit(name, "smart_poweron", "", ((gauge_t)value) / 1000.);
+ else
+ DEBUG("smart plugin: unable to get milliseconds since power on for %s.",
+ name);
+
+ if (sk_disk_smart_get_power_cycle(d, &value) >= 0)
+ smart_submit(name, "smart_powercycles", "", (gauge_t)value);
+ else
+ DEBUG("smart plugin: unable to get number of power cycles for %s.", name);
+
+ if (sk_disk_smart_get_bad(d, &value) >= 0)
+ smart_submit(name, "smart_badsectors", "", (gauge_t)value);
+ else
+ DEBUG("smart plugin: unable to get number of bad sectors for %s.", name);
+
+ if (sk_disk_smart_get_temperature(d, &value) >= 0)
+ smart_submit(name, "smart_temperature", "",
+ ((gauge_t)value) / 1000. - 273.15);
+ else
+ DEBUG("smart plugin: unable to get temperature for %s.", name);