phpsysinfo / phpsysinfo

phpSysInfo: a customizable PHP script that displays information about your system nicely
http://phpsysinfo.github.io/phpsysinfo
GNU General Public License v2.0
1.38k stars 234 forks source link

No SMART reports #329

Closed microchip8 closed 2 years ago

microchip8 commented 2 years ago

Describe the bug My server has an SATA SSD of 1 TB (Crucial-Micron MX500 1 TB). In phpsysinfo I have SMART enabled yet it does not get displayed on the page. I've given smartctl a permissiion of chmod +s /usr/sbin/smartctl - this I have in phpsysinfo.ini

DEVICES="/dev/sda"

IDS="005-RAW_VALUE,194-RAW_VALUE,009-RAW_VALUE,012-RAW_VALUE,193-RAW_VALUE-225,001-RAW_VALUE,007-RAW_VALUE,200-RAW_VALUE,197-RAW_VALUE,198-RAW_VALUE,0-RAW_VALUE"

namiltd commented 2 years ago

Edit in phpsysinfo.ini: DEBUG=true

Paste output of: http://phpsysinfo_location/xml.php?plugin=smart

microchip8 commented 2 years ago

This is what I get for https://teambelgium.net/phpsysinfo/xml.php?plugin=smart

``

``
namiltd commented 2 years ago

Please also the result of the command: smartctl --all /dev/sda

microchip8 commented 2 years ago

smartctl 7.2 2020-12-30 r5155 [x86_64-linux-5.3.18-59.37-default] (SUSE RPM)
Copyright (C) 2002-20, Bruce Allen, Christian Franke, www.smartmontools.org

=== START OF INFORMATION SECTION ===
Model Family:     Crucial/Micron Client SSDs
Device Model:     CT1000MX500SSD1
Serial Number:    XXXXXXXXXXX
LU WWN Device Id: 5 00a075 1e1dd8d80
Firmware Version: M3CR023
User Capacity:    1.000.204.886.016 bytes [1,00 TB]
Sector Sizes:     512 bytes logical, 4096 bytes physical
Rotation Rate:    Solid State Device
Form Factor:      2.5 inches
TRIM Command:     Available
Device is:        In smartctl database [for details use: -P show]
ATA Version is:   ACS-3 T13/2161-D revision 5
SATA Version is:  SATA 3.3, 6.0 Gb/s (current: 6.0 Gb/s)
Local Time is:    Sat Jan 15 12:24:51 2022 CET
SMART support is: Available - device has SMART capability.
SMART support is: Enabled

=== START OF READ SMART DATA SECTION ===
SMART overall-health self-assessment test result: PASSED

General SMART Values:
Offline data collection status:  (0x82) Offline data collection activity
                                        was completed without error.
                                        Auto Offline Data Collection: Enabled.
Self-test execution status:      (   0) The previous self-test routine completed
                                        without error or no self-test has ever 
                                        been run.
Total time to complete Offline 
data collection:                (    0) seconds.
Offline data collection
capabilities:                    (0x7b) SMART execute Offline immediate.
                                        Auto Offline data collection on/off support.
                                        Suspend Offline collection upon new
                                        command.
                                        Offline surface scan supported.
                                        Self-test supported.
                                        Conveyance Self-test supported.
                                        Selective Self-test supported.
SMART capabilities:            (0x0003) Saves SMART data before entering
                                        power-saving mode.
                                        Supports SMART auto save timer.
Error logging capability:        (0x01) Error logging supported.
                                        General Purpose Logging supported.
Short self-test routine 
recommended polling time:        (   2) minutes.
Extended self-test routine
recommended polling time:        (  30) minutes.
Conveyance self-test routine
recommended polling time:        (   2) minutes.
SCT capabilities:              (0x0031) SCT Status supported.
                                        SCT Feature Control supported.
                                        SCT Data Table supported.

SMART Attributes Data Structure revision number: 16
Vendor Specific SMART Attributes with Thresholds:
ID# ATTRIBUTE_NAME          FLAG     VALUE WORST THRESH TYPE      UPDATED  WHEN_FAILED RAW_VALUE
  1 Raw_Read_Error_Rate     0x002f   100   100   000    Pre-fail  Always       -       0
  5 Reallocate_NAND_Blk_Cnt 0x0032   100   100   010    Old_age   Always       -       0
  9 Power_On_Hours          0x0032   100   100   000    Old_age   Always       -       20181
 12 Power_Cycle_Count       0x0032   100   100   000    Old_age   Always       -       46
171 Program_Fail_Count      0x0032   100   100   000    Old_age   Always       -       0
172 Erase_Fail_Count        0x0032   100   100   000    Old_age   Always       -       0
173 Ave_Block-Erase_Count   0x0032   075   075   000    Old_age   Always       -       388
174 Unexpect_Power_Loss_Ct  0x0032   100   100   000    Old_age   Always       -       6
180 Unused_Reserve_NAND_Blk 0x0033   000   000   000    Pre-fail  Always       -       48
183 SATA_Interfac_Downshift 0x0032   100   100   000    Old_age   Always       -       0
184 Error_Correction_Count  0x0032   100   100   000    Old_age   Always       -       0
187 Reported_Uncorrect      0x0032   100   100   000    Old_age   Always       -       0
194 Temperature_Celsius     0x0022   067   046   000    Old_age   Always       -       33 (Min/Max 0/54)
196 Reallocated_Event_Count 0x0032   100   100   000    Old_age   Always       -       0
197 Current_Pending_ECC_Cnt 0x0032   100   100   000    Old_age   Always       -       0
198 Offline_Uncorrectable   0x0030   100   100   000    Old_age   Offline      -       0
199 UDMA_CRC_Error_Count    0x0032   100   100   000    Old_age   Always       -       0
202 Percent_Lifetime_Remain 0x0030   075   075   001    Old_age   Offline      -       25
206 Write_Error_Rate        0x000e   100   100   000    Old_age   Always       -       0
210 Success_RAIN_Recov_Cnt  0x0032   100   100   000    Old_age   Always       -       0
246 Total_LBAs_Written      0x0032   100   100   000    Old_age   Always       -       23736939045
247 Host_Program_Page_Count 0x0032   100   100   000    Old_age   Always       -       463852002
248 FTL_Program_Page_Count  0x0032   100   100   000    Old_age   Always       -       12242002863

SMART Error Log Version: 1
Warning: ATA error count 0 inconsistent with error log pointer 4

ATA Error Count: 0
        CR = Command Register [HEX]
        FR = Features Register [HEX]
        SC = Sector Count Register [HEX]
        SN = Sector Number Register [HEX]
        CL = Cylinder Low Register [HEX]
        CH = Cylinder High Register [HEX]
        DH = Device/Head Register [HEX]
        DC = Device Command Register [HEX]
        ER = Error register [HEX]
        ST = Status register [HEX]
Powered_Up_Time is measured from power on, and printed as
DDd+hh:mm:SS.sss where DD=days, hh=hours, mm=minutes,
SS=sec, and sss=millisec. It "wraps" after 49.710 days.

Error -3 occurred at disk power-on lifetime: 0 hours (0 days + 0 hours)
  When the command that caused the error occurred, the device was in an unknown state.

  After command completion occurred, registers were:
  ER ST SC SN CL CH DH
  -- -- -- -- -- -- --
  00 ec 00 00 00 00 00

  Commands leading to the command that caused the error were:
  CR FR SC SN CL CH DH DC   Powered_Up_Time  Command/Feature_Name
  -- -- -- -- -- -- -- --  ----------------  --------------------
  ec 00 00 00 00 00 00 00      00:00:00.000  IDENTIFY DEVICE
  ec 00 00 00 00 00 00 00      00:00:00.000  IDENTIFY DEVICE
  ec 00 00 00 00 00 00 00      00:00:00.000  IDENTIFY DEVICE
  ec 00 00 00 00 00 00 00      00:00:00.000  IDENTIFY DEVICE
  c8 00 00 00 00 00 00 00      00:00:00.000  READ DMA

SMART Self-test log structure revision number 1
Num  Test_Description    Status                  Remaining  LifeTime(hours)  LBA_of_first_error
# 1  Short offline       Completed without error       00%      5887         -
# 2  Short offline       Completed without error       00%      5870         -
# 3  Short offline       Completed without error       00%      5852         -
# 4  Short offline       Completed without error       00%      5831         -
# 5  Short offline       Completed without error       00%      5810         -
# 6  Short offline       Completed without error       00%      5789         -
# 7  Short offline       Completed without error       00%      5768         -
# 8  Short offline       Completed without error       00%      5747         -
# 9  Short offline       Completed without error       00%      5726         -
#10  Short offline       Completed without error       00%      5706         -
#11  Short offline       Completed without error       00%      5686         -
#12  Short offline       Completed without error       00%      5665         -
#13  Short offline       Completed without error       00%      5645         -
#14  Short offline       Completed without error       00%      5625         -
#15  Short offline       Completed without error       00%      5604         -
#16  Short offline       Completed without error       00%      5584         -
#17  Short offline       Completed without error       00%      5565         -
#18  Short offline       Completed without error       00%      5548         -
#19  Short offline       Completed without error       00%      5529         -
#20  Short offline       Completed without error       00%      5512         -
#21  Short offline       Completed without error       00%      5492         -

SMART Selective self-test log data structure revision number 1
 SPAN  MIN_LBA  MAX_LBA  CURRENT_TEST_STATUS
    1        0        0  Not_testing
    2        0        0  Not_testing
    3        0        0  Not_testing
    4        0        0  Not_testing
    5        0        0  Not_testing
Selective self-test flags (0x0):
  After scanning selected spans, do NOT read-scan remainder of disk.
If Selective self-test is pending on power-up, resume after 0 minute delay.
namiltd commented 2 years ago

What about SELinux and /var/log/audit/audit.log?

microchip8 commented 2 years ago

There is no SELinux or AppArmor enabled. audit.log shows nothing about smartd/smartctl. I stopped it with systemctl stop auditd. Same result

namiltd commented 2 years ago

Temporary add line 152 to file \plugins\smart\class.smart.inc.php:


var_dump($buffer);
microchip8 commented 2 years ago

I get an error "Error loading XML document for Plugin SMART"

namiltd commented 2 years ago

Temporary change line 151:


if (trim($diskname != "") && (CommonFunctions::executeProgram('smartctl', '--all'.' '.$diskdev.' '.$diskname.' 2>&1', $buffer, PSI_DEBUG))) {
microchip8 commented 2 years ago

None of the changes yoou proposed, worked. I can open /dev/sda with smartctl just fine

namiltd commented 2 years ago

"smartctl 7.2 2020-12-30 r5155 [x86_64-linux-5.3.18-59.37-default] (SUSE RPM) Copyright (C) 2002-20, Bruce Allen, Christian Franke, www.smartmontools.org

Smartctl open device: /dev/sda failed: No such device"

This indicates a problem accessing /dev/sda from non-root. I suggest to use the access="data" option and generate a smart0.tmp file via cron.

microchip8 commented 2 years ago

"smartctl 7.2 2020-12-30 r5155 [x86_64-linux-5.3.18-59.37-default] (SUSE RPM) Copyright (C) 2002-20, Bruce Allen, Christian Franke, www.smartmontools.org

Smartctl open device: /dev/sda failed: No such device"

This indicates a problem accessing /dev/sda from non-root. I suggest to use the access="data" option and generate a smart0.tmp file via cron.

Yes! this works now. Many thanks!