Linux::AtaSmart

XS wrapper around libatasmart
Download

Linux::AtaSmart Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Perl Artistic License
  • Price:
  • FREE
  • Publisher Name:
  • Ioan Rogers
  • Publisher web site:
  • http://search.cpan.org/~ioanr/

Linux::AtaSmart Tags


Linux::AtaSmart Description

Linux::AtaSmart is an XS wrapper around the Linux-only library, libatasmart. To read SMART info from a drive you will need to run as root, or have CAP_RAW_IO (which you will most likely have to set on your perl binary). HAVING GROUP WRITE PERMISSIONS IS NOT ENOUGH!SYNOPSIS use v5.10.1; use Linux::AtaSmart; use Linux::AtaSmart::Constants qw/:all/; my $atasmart = Linux::AtaSmart->new('/dev/sda'); if (!$atasmart->smart_is_available) { die "Drive not SMART capable"; } say 'Disk size in bytes: ', $atasmart->get_size; say 'Awake: ' . ($atasmart->check_sleep_mode ? 'YES' : 'NO'); say 'Status: ' . ($atasmart->smart_status ? 'GOOD' : 'BAD'); say 'Bad Sectors: ' . $atasmart->get_bad; say 'Temperature °C: ' . $atasmart->get_temperature; say "Power Cycles: " . $atasmart->get_power_cycle; say "Powered On: " . $atasmart->get_power_on->pretty; my $status = $atasmart->get_overall; if ($status != OVERALL_GOOD) { say "STATUS NOT GOOD!"; } # all of the above and more $atasmart->dump; $atasmart->self_test(TEST_SHORT);Product's homepage


Linux::AtaSmart Related Software