Skip to content
Snippets Groups Projects
Commit b3e5bfe5 authored by ballen4705's avatar ballen4705
Browse files

prettyprinting

git-svn-id: https://smartmontools.svn.sourceforge.net/svnroot/smartmontools/trunk@104 4ea69e1a-61f1-4043-bf83-b5c94c648137
parent e7ae9545
No related branches found
No related tags found
No related merge requests found
...@@ -37,7 +37,7 @@ ...@@ -37,7 +37,7 @@
#include "ataprint.h" #include "ataprint.h"
extern const char *CVSid1, *CVSid2; extern const char *CVSid1, *CVSid2;
const char *CVSid3="$Id: smartd.c,v 1.20 2002/10/24 10:13:53 ballen4705 Exp $" const char *CVSid3="$Id: smartd.c,v 1.21 2002/10/24 10:18:27 ballen4705 Exp $"
CVSID1 CVSID4 CVSID7; CVSID1 CVSID4 CVSID7;
int daemon_init(void){ int daemon_init(void){
...@@ -130,11 +130,11 @@ void atadevicescan ( atadevices_t *devices){ ...@@ -130,11 +130,11 @@ void atadevicescan ( atadevices_t *devices){
strcpy(devices[numatadevices].devicename, device); strcpy(devices[numatadevices].devicename, device);
devices[numatadevices].drive = drive; devices[numatadevices].drive = drive;
if (ataReadSmartValues (fd,&devices[numatadevices].smartval)){ if (ataReadSmartValues (fd,&devices[numatadevices].smartval)){
printout(LOG_INFO,"Device: %s, Read Smart Values Failed\n",device); printout(LOG_INFO,"Device: %s, Read SMART Values Failed\n",device);
} }
if (ataReadSmartThresholds (fd,&devices[numatadevices].smartthres)){ if (ataReadSmartThresholds (fd,&devices[numatadevices].smartthres)){
printout(LOG_INFO,"Device: %s, Read Smart Thresholds Failed\n",device); printout(LOG_INFO,"Device: %s, Read SMART Thresholds Failed\n",device);
} }
printout(LOG_INFO,"%s Found and is SMART capable\n",device); printout(LOG_INFO,"%s Found and is SMART capable\n",device);
...@@ -220,7 +220,7 @@ void ataCompareSmartValues (atadevices_t *device, struct ata_smart_values new ){ ...@@ -220,7 +220,7 @@ void ataCompareSmartValues (atadevices_t *device, struct ata_smart_values new ){
// skip blank space in name // skip blank space in name
while (*loc && *loc==' ') while (*loc && *loc==' ')
loc++; loc++;
printout(LOG_INFO, "Device: %s, SMART Attribute %s Changed from %i to %i\n", printout(LOG_INFO, "Device: %s, SMART Attribute: %s changed from %i to %i\n",
device->devicename,loc,oldval,newval); device->devicename,loc,oldval,newval);
} }
} }
...@@ -237,11 +237,11 @@ int ataCheckDevice( atadevices_t *drive){ ...@@ -237,11 +237,11 @@ int ataCheckDevice( atadevices_t *drive){
// Coming into this function, *drive contains the last values measured, // Coming into this function, *drive contains the last values measured,
// and we read the NEW values into tempsmartval // and we read the NEW values into tempsmartval
if (ataReadSmartValues(drive->fd,&tempsmartval)) if (ataReadSmartValues(drive->fd,&tempsmartval))
printout(LOG_INFO, "%s:Failed to read smart values\n", drive->devicename); printout(LOG_INFO, "%s:Failed to read SMART values\n", drive->devicename);
// and we read the new thresholds into tempsmartthres // and we read the new thresholds into tempsmartthres
if (ataReadSmartThresholds (drive->fd, &tempsmartthres)) if (ataReadSmartThresholds (drive->fd, &tempsmartthres))
printout(LOG_INFO, "%s:Failed to read smart thresholds\n",drive->devicename); printout(LOG_INFO, "%s:Failed to read SMART thresholds\n",drive->devicename);
// See if any vendor attributes are below minimum, and print them out // See if any vendor attributes are below minimum, and print them out
if ((failed=ataCheckSmart(tempsmartval,tempsmartthres,1))){ if ((failed=ataCheckSmart(tempsmartval,tempsmartthres,1))){
...@@ -250,7 +250,7 @@ int ataCheckDevice( atadevices_t *drive){ ...@@ -250,7 +250,7 @@ int ataCheckDevice( atadevices_t *drive){
loc=attributename; loc=attributename;
while (*loc && *loc==' ') while (*loc && *loc==' ')
loc++; loc++;
printout(LOG_CRIT,"Device: %s, Failed attribute %s. Investigate with smartctl -v.\n", printout(LOG_CRIT,"Device: %s, Failed SMART attribute: %s. Use smartctl -v.\n",
drive->devicename,loc); drive->devicename,loc);
} }
...@@ -278,10 +278,10 @@ int scsiCheckDevice( scsidevices_t *drive) ...@@ -278,10 +278,10 @@ int scsiCheckDevice( scsidevices_t *drive)
currenttemp = triptemp = 0; currenttemp = triptemp = 0;
if (scsiCheckSmart( drive->fd, drive->SmartPageSupported, &returnvalue, &currenttemp, &triptemp ) != 0) if (scsiCheckSmart( drive->fd, drive->SmartPageSupported, &returnvalue, &currenttemp, &triptemp ) != 0)
printout(LOG_INFO, "%s:Failed to read smart values\n", drive->devicename); printout(LOG_INFO, "%s:Failed to read SMART values\n", drive->devicename);
if (returnvalue) if (returnvalue)
printout(LOG_CRIT, "Device: %s, S.M.A.R.T. Failure: (%02x) %s\n", drive->devicename, printout(LOG_CRIT, "Device: %s, SMART Failure: (%02x) %s\n", drive->devicename,
returnvalue, scsiSmartGetSenseCode( returnvalue) ); returnvalue, scsiSmartGetSenseCode( returnvalue) );
else else
printout(LOG_INFO,"Device: %s, Acceptable attribute: %d\n", drive->devicename, returnvalue); printout(LOG_INFO,"Device: %s, Acceptable attribute: %d\n", drive->devicename, returnvalue);
......
...@@ -37,7 +37,7 @@ ...@@ -37,7 +37,7 @@
#include "ataprint.h" #include "ataprint.h"
extern const char *CVSid1, *CVSid2; extern const char *CVSid1, *CVSid2;
const char *CVSid3="$Id: smartd.cpp,v 1.20 2002/10/24 10:13:53 ballen4705 Exp $" const char *CVSid3="$Id: smartd.cpp,v 1.21 2002/10/24 10:18:27 ballen4705 Exp $"
CVSID1 CVSID4 CVSID7; CVSID1 CVSID4 CVSID7;
int daemon_init(void){ int daemon_init(void){
...@@ -130,11 +130,11 @@ void atadevicescan ( atadevices_t *devices){ ...@@ -130,11 +130,11 @@ void atadevicescan ( atadevices_t *devices){
strcpy(devices[numatadevices].devicename, device); strcpy(devices[numatadevices].devicename, device);
devices[numatadevices].drive = drive; devices[numatadevices].drive = drive;
if (ataReadSmartValues (fd,&devices[numatadevices].smartval)){ if (ataReadSmartValues (fd,&devices[numatadevices].smartval)){
printout(LOG_INFO,"Device: %s, Read Smart Values Failed\n",device); printout(LOG_INFO,"Device: %s, Read SMART Values Failed\n",device);
} }
if (ataReadSmartThresholds (fd,&devices[numatadevices].smartthres)){ if (ataReadSmartThresholds (fd,&devices[numatadevices].smartthres)){
printout(LOG_INFO,"Device: %s, Read Smart Thresholds Failed\n",device); printout(LOG_INFO,"Device: %s, Read SMART Thresholds Failed\n",device);
} }
printout(LOG_INFO,"%s Found and is SMART capable\n",device); printout(LOG_INFO,"%s Found and is SMART capable\n",device);
...@@ -220,7 +220,7 @@ void ataCompareSmartValues (atadevices_t *device, struct ata_smart_values new ){ ...@@ -220,7 +220,7 @@ void ataCompareSmartValues (atadevices_t *device, struct ata_smart_values new ){
// skip blank space in name // skip blank space in name
while (*loc && *loc==' ') while (*loc && *loc==' ')
loc++; loc++;
printout(LOG_INFO, "Device: %s, SMART Attribute %s Changed from %i to %i\n", printout(LOG_INFO, "Device: %s, SMART Attribute: %s changed from %i to %i\n",
device->devicename,loc,oldval,newval); device->devicename,loc,oldval,newval);
} }
} }
...@@ -237,11 +237,11 @@ int ataCheckDevice( atadevices_t *drive){ ...@@ -237,11 +237,11 @@ int ataCheckDevice( atadevices_t *drive){
// Coming into this function, *drive contains the last values measured, // Coming into this function, *drive contains the last values measured,
// and we read the NEW values into tempsmartval // and we read the NEW values into tempsmartval
if (ataReadSmartValues(drive->fd,&tempsmartval)) if (ataReadSmartValues(drive->fd,&tempsmartval))
printout(LOG_INFO, "%s:Failed to read smart values\n", drive->devicename); printout(LOG_INFO, "%s:Failed to read SMART values\n", drive->devicename);
// and we read the new thresholds into tempsmartthres // and we read the new thresholds into tempsmartthres
if (ataReadSmartThresholds (drive->fd, &tempsmartthres)) if (ataReadSmartThresholds (drive->fd, &tempsmartthres))
printout(LOG_INFO, "%s:Failed to read smart thresholds\n",drive->devicename); printout(LOG_INFO, "%s:Failed to read SMART thresholds\n",drive->devicename);
// See if any vendor attributes are below minimum, and print them out // See if any vendor attributes are below minimum, and print them out
if ((failed=ataCheckSmart(tempsmartval,tempsmartthres,1))){ if ((failed=ataCheckSmart(tempsmartval,tempsmartthres,1))){
...@@ -250,7 +250,7 @@ int ataCheckDevice( atadevices_t *drive){ ...@@ -250,7 +250,7 @@ int ataCheckDevice( atadevices_t *drive){
loc=attributename; loc=attributename;
while (*loc && *loc==' ') while (*loc && *loc==' ')
loc++; loc++;
printout(LOG_CRIT,"Device: %s, Failed attribute %s. Investigate with smartctl -v.\n", printout(LOG_CRIT,"Device: %s, Failed SMART attribute: %s. Use smartctl -v.\n",
drive->devicename,loc); drive->devicename,loc);
} }
...@@ -278,10 +278,10 @@ int scsiCheckDevice( scsidevices_t *drive) ...@@ -278,10 +278,10 @@ int scsiCheckDevice( scsidevices_t *drive)
currenttemp = triptemp = 0; currenttemp = triptemp = 0;
if (scsiCheckSmart( drive->fd, drive->SmartPageSupported, &returnvalue, &currenttemp, &triptemp ) != 0) if (scsiCheckSmart( drive->fd, drive->SmartPageSupported, &returnvalue, &currenttemp, &triptemp ) != 0)
printout(LOG_INFO, "%s:Failed to read smart values\n", drive->devicename); printout(LOG_INFO, "%s:Failed to read SMART values\n", drive->devicename);
if (returnvalue) if (returnvalue)
printout(LOG_CRIT, "Device: %s, S.M.A.R.T. Failure: (%02x) %s\n", drive->devicename, printout(LOG_CRIT, "Device: %s, SMART Failure: (%02x) %s\n", drive->devicename,
returnvalue, scsiSmartGetSenseCode( returnvalue) ); returnvalue, scsiSmartGetSenseCode( returnvalue) );
else else
printout(LOG_INFO,"Device: %s, Acceptable attribute: %d\n", drive->devicename, returnvalue); printout(LOG_INFO,"Device: %s, Acceptable attribute: %d\n", drive->devicename, returnvalue);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment