Skip to content
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

[BUG]Strugling to get HP SmartArray controller work with scrutiny #700

Open
kotso opened this issue Oct 6, 2024 · 3 comments
Open

[BUG]Strugling to get HP SmartArray controller work with scrutiny #700

kotso opened this issue Oct 6, 2024 · 3 comments
Labels
bug Something isn't working good first issue Good for newcomers help wanted Extra attention is needed

Comments

@kotso
Copy link

kotso commented Oct 6, 2024

I have 1x raid array made of 12x disks.

Here is my configuration file:

version: 1

host:
  id: "***"


devices:
  - device: /dev/sda
    type:
      - 'cciss,0'
      - 'cciss,1'

When running collector from command line to see whats happening in debug, I see that device info is collected correctly but smarty attributes are collected with wrong parameters, it uses device sat every time so It cant get any smart attribute.

root@90c6238da1f2:/opt/scrutiny# /opt/scrutiny/bin/scrutiny-collector-metrics run
2024/10/06 19:07:53 Loading configuration file: /opt/scrutiny/config/collector.yaml

 ___   ___  ____  __  __  ____  ____  _  _  _  _
/ __) / __)(  _ \(  )(  )(_  _)(_  _)( \( )( \/ )
\__ \( (__  )   / )(__)(   )(   _)(_  )  (  \  /
(___/ \___)(_)\_)(______) (__) (____)(_)\_) (__)
AnalogJ/scrutiny/metrics                                dev-0.8.1

INFO[0000] Verifying required tools                      type=metrics
INFO[0000] Executing command: smartctl --scan --json     type=metrics
INFO[0000] Executing command: smartctl --info --json --device cciss,0 /dev/sda  type=metrics
INFO[0000] Generating WWN                                type=metrics
INFO[0000] Executing command: smartctl --info --json --device cciss,1 /dev/sda  type=metrics
INFO[0000] Generating WWN                                type=metrics
INFO[0000] Sending detected devices to API, for filtering & validation  type=metrics
INFO[0000] Collecting smartctl results for sda           type=metrics
INFO[0000] Executing command: smartctl --xall --json --device sat /dev/sda  type=metrics
ERRO[0000] smartctl returned an error code (2) while processing sda  type=metrics
ERRO[0000] smartctl could not open device                type=metrics
INFO[0000] Publishing smartctl results for 0x5000cca26fe8bd79  type=metrics
INFO[0000] Collecting smartctl results for sda           type=metrics
INFO[0000] Executing command: smartctl --xall --json --device sat /dev/sda  type=metrics
ERRO[0000] smartctl returned an error code (2) while processing sda  type=metrics
ERRO[0000] smartctl could not open device                type=metrics
INFO[0000] Publishing smartctl results for 0x5000cca270c3bb14  type=metrics
INFO[0000] Main: Completed                               type=metrics

If I change --device sat to correct --device cciss,0 (0 and 1 and others) then all data is displayed correctly by smartctl, but what I see is scrutiny calls smartctl with wrong parameters in second part.

@kotso kotso added the bug Something isn't working label Oct 6, 2024
@kotso
Copy link
Author

kotso commented Oct 6, 2024

All running in docker.

@AnalogJ
Copy link
Owner

AnalogJ commented Jan 4, 2025

weird, so it's correctly using the --device cciss,0 flag for your smartctl --info calls, but not for the smartctl --xall calls?

It definitely shouldn't be doing that.

@AnalogJ AnalogJ added help wanted Extra attention is needed good first issue Good for newcomers labels Jan 4, 2025
@maxencevm
Copy link

I have the same problem.

version: 1

# The host id is a label used for identifying groups of disks running on the same host
# Primiarly used for hub/spoke deployments (can be left empty if using all-in-one image).
host:
  id: "HP-Server"


# This block allows you to override/customize the settings for devices detected by
# Scrutiny via `smartctl --scan`
# See the "--device=TYPE" section of https://linux.die.net/man/8/smartctl
# type can be a 'string' or a 'list'
devices:
  - device: /dev/sg1
    type:
      - 'cciss,0'
      - 'cciss,1'
time="2025-02-07T15:01:57Z" level=debug msg="{\n\t\"allow_listed_devices\": [],\n\t\"api\": {\n\t\t\"endpoint\": \"http://scrutiny-web:8080/\"\n\t},\n\t\"commands\": {\n\t\t\"metrics_info_args\": \"--info --json\",\n\t\t\"metrics_scan_args\": \"--scan --json\",\n\t\t\"metrics_smart_args\": \"--xall --json\",\n\t\t\"metrics_smartctl_bin\": \"smartctl\",\n\t\t\"metrics_smartctl_wait\": 0\n\t},\n\t\"devices\": [\n\t\t{\n\t\t\t\"device\": \"/dev/sg1\",\n\t\t\t\"type\": [\n\t\t\t\t\"cciss,0\",\n\t\t\t\t\"cciss,1\"\n\t\t\t]\n\t\t}\n\t],\n\t\"host\": {\n\t\t\"id\": \"scrutiny-collector-hostname\"\n\t},\n\t\"log\": {\n\t\t\"file\": \"/logs/collector.log\",\n\t\t\"level\": \"DEBUG\"\n\t},\n\t\"version\": 1\n}<nil>" type=metrics
time="2025-02-07T15:01:57Z" level=info msg="Verifying required tools" type=metrics
time="2025-02-07T15:01:57Z" level=info msg="Executing command: smartctl --scan --json" type=metrics
{
  "json_format_version": [
    1,
    0
  ],
  "smartctl": {
    "version": [
      7,
      3
    ],
    "svn_revision": "5338",
    "platform_info": "x86_64-linux-6.8.0-52-generic",
    "build_info": "(local build)",
    "argv": [
      "smartctl",
      "--scan",
      "--json"
    ],
    "exit_status": 0
  }
}
time="2025-02-07T15:01:57Z" level=info msg="Executing command: smartctl --info --json --device cciss,0 /dev/sg1" type=metrics
{
  "json_format_version": [
    1,
    0
  ],
  "smartctl": {
    "version": [
      7,
      3
    ],
    "svn_revision": "5338",
    "platform_info": "x86_64-linux-6.8.0-52-generic",
    "build_info": "(local build)",
    "argv": [
      "smartctl",
      "--info",
      "--json",
      "--device",
      "cciss,0",
      "/dev/sg1"
    ],
    "drive_database_version": {
      "string": "7.3/5319"
    },
    "exit_status": 0
  },
  "local_time": {
    "time_t": 1738940517,
    "asctime": "Fri Feb  7 15:01:57 2025 UTC"
  },
  "device": {
    "name": "/dev/sg1",
    "info_name": "/dev/sg1 [cciss_disk_00] [SAT]",
    "type": "sat",
    "protocol": "ATA"
  },
  "model_family": "Western Digital Scorpio Blue Serial ATA",
  "model_name": "WDC WD5000BEVT-22ZAT0",
  "serial_number": "WD-WXN109LZ7944",
  "wwn": {
    "naa": 5,
    "oui": 5358,
    "id": 10064099041
  },
  "firmware_version": "01.01A01",
  "user_capacity": {
    "blocks": 976773168,
    "bytes": 500107862016
  },
  "logical_block_size": 512,
  "physical_block_size": 512,
  "rotation_rate": 5400,
  "trim": {
    "supported": false
  },
  "in_smartctl_database": true,
  "ata_version": {
    "string": "ATA8-ACS (minor revision not indicated)",
    "major_value": 510,
    "minor_value": 0
  },
  "sata_version": {
    "string": "SATA 2.6",
    "value": 30
  },
  "interface_speed": {
    "max": {
      "sata_value": 6,
      "string": "3.0 Gb/s",
      "units_per_second": 30,
      "bits_per_unit": 100000000
    }
  },
  "smart_support": {
    "available": true,
    "enabled": true
  }
}
time="2025-02-07T15:01:57Z" level=info msg="Generating WWN" type=metrics
time="2025-02-07T15:01:57Z" level=debug msg="NAA: 5 OUI: 5358 Id: 10064099041 => WWN: 0x50014ee257ddf6e1" type=metrics
time="2025-02-07T15:01:57Z" level=info msg="Executing command: smartctl --info --json --device cciss,1 /dev/sg1" type=metrics
{
  "json_format_version": [
    1,
    0
  ],
  "smartctl": {
    "version": [
      7,
      3
    ],
    "svn_revision": "5338",
    "platform_info": "x86_64-linux-6.8.0-52-generic",
    "build_info": "(local build)",
    "argv": [
      "smartctl",
      "--info",
      "--json",
      "--device",
      "cciss,1",
      "/dev/sg1"
    ],
    "drive_database_version": {
      "string": "7.3/5319"
    },
    "exit_status": 0
  },
  "local_time": {
    "time_t": 1738940517,
    "asctime": "Fri Feb  7 15:01:57 2025 UTC"
  },
  "device": {
    "name": "/dev/sg1",
    "info_name": "/dev/sg1 [cciss_disk_01] [SAT]",
    "type": "sat",
    "protocol": "ATA"
  },
  "model_family": "Western Digital Scorpio Blue Serial ATA (AF)",
  "model_name": "WDC WD5000BPVT-55HXZT2",
  "serial_number": "WD-WXF1A6180790",
  "wwn": {
    "naa": 5,
    "oui": 5358,
    "id": 25795139755
  },
  "firmware_version": "01.01A01",
  "user_capacity": {
    "blocks": 976773168,
    "bytes": 500107862016
  },
  "logical_block_size": 512,
  "physical_block_size": 512,
  "rotation_rate": 5400,
  "trim": {
    "supported": false
  },
  "in_smartctl_database": true,
  "ata_version": {
    "string": "ATA8-ACS (minor revision not indicated)",
    "major_value": 510,
    "minor_value": 0
  },
  "sata_version": {
    "string": "SATA 2.6",
    "value": 30
  },
  "interface_speed": {
    "max": {
      "sata_value": 6,
      "string": "3.0 Gb/s",
      "units_per_second": 30,
      "bits_per_unit": 100000000
    }
  },
  "smart_support": {
    "available": true,
    "enabled": true
  }
}
time="2025-02-07T15:01:57Z" level=info msg="Generating WWN" type=metrics
time="2025-02-07T15:01:57Z" level=debug msg="NAA: 5 OUI: 5358 Id: 25795139755 => WWN: 0x50014ee6018298ab" type=metrics
time="2025-02-07T15:01:57Z" level=info msg="Sending detected devices to API, for filtering & validation" type=metrics
time="2025-02-07T15:01:57Z" level=debug msg="Detected devices: [{\"wwn\":\"0x50014ee257ddf6e1\",\"device_name\":\"sg1\",\"device_uuid\":\"\",\"device_serial_id\":\"\",\"device_label\":\"\",\"manufacturer\":\"\",\"model_name\":\"WDC WD5000BEVT-22ZAT0\",\"interface_type\":\"\",\"interface_speed\":\"\",\"serial_number\":\"WD-WXN109LZ7944\",\"firmware\":\"01.01A01\",\"rotational_speed\":5400,\"capacity\":500107862016,\"form_factor\":\"\",\"smart_support\":false,\"device_protocol\":\"ATA\",\"device_type\":\"sat\",\"label\":\"\",\"host_id\":\"scrutiny-collector-hostname\"},{\"wwn\":\"0x50014ee6018298ab\",\"device_name\":\"sg1\",\"device_uuid\":\"\",\"device_serial_id\":\"\",\"device_label\":\"\",\"manufacturer\":\"\",\"model_name\":\"WDC WD5000BPVT-55HXZT2\",\"interface_type\":\"\",\"interface_speed\":\"\",\"serial_number\":\"WD-WXF1A6180790\",\"firmware\":\"01.01A01\",\"rotational_speed\":5400,\"capacity\":500107862016,\"form_factor\":\"\",\"smart_support\":false,\"device_protocol\":\"ATA\",\"device_type\":\"sat\",\"label\":\"\",\"host_id\":\"scrutiny-collector-hostname\"}]" type=metrics
time="2025-02-07T15:01:57Z" level=debug msg="&{true [] [{0x50014ee257ddf6e1 sg1     WDC WD5000BEVT-22ZAT0   WD-WXN109LZ7944 01.01A01 5400 500107862016  false ATA sat  scrutiny-collector-hostname} {0x50014ee6018298ab sg1     WDC WD5000BPVT-55HXZT2   WD-WXF1A6180790 01.01A01 5400 500107862016  false ATA sat  scrutiny-collector-hostname}]}" type=metrics
time="2025-02-07T15:01:57Z" level=info msg="Collecting smartctl results for sg1\n" type=metrics
time="2025-02-07T15:01:57Z" level=info msg="Executing command: smartctl --xall --json --device sat /dev/sg1" type=metrics
{
  "json_format_version": [
    1,
    0
  ],
  "smartctl": {
    "version": [
      7,
      3
    ],
    "svn_revision": "5338",
    "platform_info": "x86_64-linux-6.8.0-52-generic",
    "build_info": "(local build)",
    "argv": [
      "smartctl",
      "--xall",
      "--json",
      "--device",
      "sat",
      "/dev/sg1"
    ],
    "exit_status": 2
  },
  "local_time": {
    "time_t": 1738940517,
    "asctime": "Fri Feb  7 15:01:57 2025 UTC"
  },
  "device": {
    "name": "/dev/sg1",
    "info_name": "/dev/sg1 [SAT]",
    "type": "sat",
    "protocol": "ATA"
  }
}
time="2025-02-07T15:01:57Z" level=error msg="smartctl returned an error code (2) while processing sg1\n" type=metrics
time="2025-02-07T15:01:57Z" level=error msg="smartctl could not open device" type=metrics
time="2025-02-07T15:01:57Z" level=info msg="Publishing smartctl results for 0x50014ee257ddf6e1\n" type=metrics
time="2025-02-07T15:01:58Z" level=info msg="Collecting smartctl results for sg1\n" type=metrics
time="2025-02-07T15:01:58Z" level=info msg="Executing command: smartctl --xall --json --device sat /dev/sg1" type=metrics
{
  "json_format_version": [
    1,
    0
  ],
  "smartctl": {
    "version": [
      7,
      3
    ],
    "svn_revision": "5338",
    "platform_info": "x86_64-linux-6.8.0-52-generic",
    "build_info": "(local build)",
    "argv": [
      "smartctl",
      "--xall",
      "--json",
      "--device",
      "sat",
      "/dev/sg1"
    ],
    "exit_status": 2
  },
  "local_time": {
    "time_t": 1738940518,
    "asctime": "Fri Feb  7 15:01:58 2025 UTC"
  },
  "device": {
    "name": "/dev/sg1",
    "info_name": "/dev/sg1 [SAT]",
    "type": "sat",
    "protocol": "ATA"
  }
}
time="2025-02-07T15:01:58Z" level=error msg="smartctl returned an error code (2) while processing sg1\n" type=metrics
time="2025-02-07T15:01:58Z" level=error msg="smartctl could not open device" type=metrics
time="2025-02-07T15:01:58Z" level=info msg="Publishing smartctl results for 0x50014ee6018298ab\n" type=metrics
time="2025-02-07T15:01:58Z" level=info msg="Main: Completed" type=metrics

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants