{ "module": "sensors", "version": "1", "capabilities": [ "package-manager", "service-manager" ], "tools": [ "sensors_summary", "sensors_temperatures", "sensors_fans", "sensors_drives", "sensors_faults", "sensors_health" ], "resources": [ { "id": "smartmontools", "type": "package", "package": "smartmontools" }, { "id": "smartd-conf", "type": "file", "path": "/etc/smartd.conf", "mode": "0644", "content": "# The mesh's (module sensors, novox/hq ADR 0256): what smartd watches. Written whole at every push;\n# an edit here is overwritten.\n#\n# Every drive smartd can find, with every check (-a). A drive in standby is skipped, never woken to be\n# checked, and the skip is not logged (-n standby,q): a server's spinning drives may sleep. No mail is\n# sent (no -m): what smartd finds goes to the journal, and the module's watch reads each drive's health\n# for the mesh's tools and its health check.\nDEVICESCAN -a -n standby,q\n" }, { "id": "smartd-drop-ins", "type": "directory", "path": "/etc/systemd/system/smartd.service.d", "mode": "0755" }, { "id": "smartd-drop-in", "type": "file", "path": "/etc/systemd/system/smartd.service.d/10-mesh.conf", "mode": "0644", "content": "# The mesh's (module sensors, novox/hq ADR 0256). Written whole at every push; edit nothing here.\n#\n# smartd runs on every machine the module is assigned to, a virtual machine included, where the package's\n# unit would not start; and it stays up on a machine with no drive it can watch (-q never), where it\n# would otherwise exit, because the mesh judges this service as one that stays up.\n[Unit]\nConditionVirtualization=\n\n[Service]\nExecStart=\nExecStart=/usr/bin/smartd -n -q never\n" }, { "id": "smartd", "type": "service", "unit": "smartd.service", "state": "running", "boot": "enabled", "restart-on": [ "smartd-conf", "smartd-drop-in" ], "health": { "kind": "unit" } }, { "id": "watch", "type": "process", "name": "sensors-watch", "artifact": "tools", "run": [ "./sensors", "watch" ], "health": { "kind": "tool", "tool": "sensors_health", "interval": "60s", "timeout": "10s", "looks": 2, "grace": "60s" } } ], "build": { "artifacts": [ { "name": "tools", "kind": "bundle", "language": "go", "system": "arch", "from": "cmd/sensors", "binary": "sensors", "loads": [ "sensors" ] } ] } }