From: Ruben Kerkhof Date: Fri, 25 Dec 2015 09:54:47 +0000 (+0100) Subject: uuid plugin: also look in /sys/class/dmi for uuid X-Git-Tag: collectd-5.6.0~87^2~4 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=da920bb48c6769e7c58cf358cdfb43983af55056;p=collectd.git uuid plugin: also look in /sys/class/dmi for uuid Recent Linux kernels store the uuid in /sys/class/dmi/id/product_uuid. --- diff --git a/src/uuid.c b/src/uuid.c index 223bfd54..e837ca72 100644 --- a/src/uuid.c +++ b/src/uuid.c @@ -192,10 +192,14 @@ uuid_get_local(void) if ((uuid = uuid_get_from_file(uuidfile ? uuidfile : "/etc/uuid")) != NULL) return (uuid); +#if defined(__linux__) + if ((uuid = uuid_get_from_file("/sys/class/dmi/id/product_uuid")) != NULL) + return (uuid); +#endif + #if HAVE_LIBHAL_H - if ((uuid = uuid_get_from_hal()) != NULL) { - return uuid; - } + if ((uuid = uuid_get_from_hal()) != NULL) + return (uuid); #endif if ((uuid = uuid_get_from_dmidecode()) != NULL)