You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

16 lines
615 B

  1. local labels = {
  2. domainname = "",
  3. nodename = "",
  4. release = string.sub(get_contents("/proc/sys/kernel/osrelease"), 1, -2),
  5. sysname = string.sub(get_contents("/proc/sys/kernel/ostype"), 1, -2),
  6. version = string.sub(get_contents("/proc/sys/kernel/version"), 1, -2),
  7. machine = string.sub(io.popen("uname -m"):read("*a"), 1, -2)
  8. }
  9. local function scrape()
  10. labels["domainname"] = string.sub(get_contents("/proc/sys/kernel/domainname"), 1, -2)
  11. labels["nodename"] = string.sub(get_contents("/proc/sys/kernel/hostname"), 1, -2)
  12. metric("node_uname_info", "gauge", labels, 1)
  13. end
  14. return { scrape = scrape }