-
-
Notifications
You must be signed in to change notification settings - Fork 609
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add new module for SMART monitoring #397
Comments
libatasmart #include <stdio.h>
#include <string.h>
#include <errno.h>
#include <atasmart.h>
int main(void) {
uint64_t mkelvin = 0;
const char *device = "/dev/sda";
SkDisk *d = NULL;
if (-1 == (sk_disk_open(device, &d))) {
fprintf(stderr, "Failed to open disk %s: %s\n", device, strerror(errno));
return 1;
}
if (-1 == (sk_disk_smart_read_data(d))) {
fprintf(stderr, "Failed to read SMART data: %s\n", strerror(errno));
goto finish;
}
if (-1 == (sk_disk_smart_get_temperature(d, &mkelvin))) {
fprintf(stderr, "Failed to get temperature: %s\n", strerror(errno));
goto finish;
}
printf("%llu\n", (unsigned long long)mkelvin);
finish:
if (NULL != d) {
sk_disk_free(d);
}
return 0;
} smartmontools are cross-platform available and the *BSD flavours would benefit from it too. Those like me that do not use init systemd will be forced to install additional dependencies. |
visudo computer_name ALL=NOPASSWD:/usr/bin/program_name |
@fonic OMFG. I can't wait to see this implemented. 😱 |
This issue is stale because it has been open 365 days with no activity. Remove stale label or comment, or this issue will be closed in 30 days. |
This issue was closed because it has been stalled for 30 days with no activity. |
I'm thinking about creating a new module for SMART disk monitoring. As far as I can tell, there are three options to implement this:
I'd prefer to use libatasmart as this would add native support with only a single additional dependency.
Does anyone know if it is possible to use libatasmart without root privileges?
The text was updated successfully, but these errors were encountered: