Skip to content

Commit

Permalink
Add Completed and In-Progress Offline Cases
Browse files Browse the repository at this point in the history
  • Loading branch information
Simon Murray committed Jan 7, 2016
1 parent 23fe915 commit 5a7aec6
Showing 1 changed file with 22 additions and 10 deletions.
32 changes: 22 additions & 10 deletions check_scsi_smart.c
Original file line number Diff line number Diff line change
Expand Up @@ -511,16 +511,28 @@ int main(int argc, char** argv) {
smart_data sd;
ata_smart_read_data(fd, (unsigned char*)&sd);

if((sd.offline_data_collection_status & 0x7f) == SMART_OFF_LINE_STATUS_NEVER_STARTED) {
printf("Off-line data collection: never started\n\n");
} else if((sd.offline_data_collection_status & 0x7f) == SMART_OFF_LINE_STATUS_SUSPENDED) {
printf("Off-line data collection: suspended\n\n");
} else if((sd.offline_data_collection_status & 0x7f) == SMART_OFF_LINE_STATUS_ABORTED_HOST) {
printf("Off-line data collection: aborted by host\n\n");
} else if((sd.offline_data_collection_status & 0x7f) == SMART_OFF_LINE_STATUS_ABORTED_DEVICE) {
printf("Off-line data collection: aborted by device\n\n");
} else {
printf("Off-line data collection: unknown state\n\n");
switch(sd.offline_data_collection_status & 0x7f) {
case SMART_OFF_LINE_STATUS_NEVER_STARTED:
printf("Off-line data collection: never started\n\n");
break;
case SMART_OFF_LINE_STATUS_COMPLETED:
printf("Off-line data collection: completed\n\n");
break;
case SMART_OFF_LINE_STATUS_IN_PROGRESS:
printf("Off-line data collection: in progress\n\n");
break;
case SMART_OFF_LINE_STATUS_SUSPENDED:
printf("Off-line data collection: suspended\n\n");
break;
case SMART_OFF_LINE_STATUS_ABORTED_HOST:
printf("Off-line data collection: aborted by host\n\n");
break;
case SMART_OFF_LINE_STATUS_ABORTED_DEVICE:
printf("Off-line data collection: aborted by device\n\n");
break;
default:
printf("Off-line data collection: unknown state\n\n");
break;
}

/* Perform actual SMART threshold checks */
Expand Down

0 comments on commit 5a7aec6

Please sign in to comment.