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

Support scraping multiple controllers. #27

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

sebbov
Copy link

@sebbov sebbov commented Jan 8, 2025

Why? #26 (comment)

Why not auto-detect the controllers? To remain in the spirit of the current behavior of the exporter. Although a list is shown in the CLI along with usage help when run without any argument, there is no explicit CLI command to return the number of controllers. Running e.g. sys info for an increasing controller index until failure is noticed works but it is difficult to disambiguate a non-existing controller from a failed run (which are metric reported and skipped) without introducing fragility. It seems simpler and sufficient to have this number specified.

numctrl=<n> param support appears present in all CLI versions found at ftp://ftp.areca.com.tw/.

Tested, on system with 3 controllers:

  • default, --controllers 2, --controllers 3 works as expected. All areca_... metrics (but the implicit areca_exporter_build_info) are reported with a new controller_index=<n> label (controller_index was preferred over controller b/c there's an existing controller_name). E.g.:
areca_disk_state{controller_index="2",device_location="Enclosure#2 SLOT 01",device_type="SATA(5001B4D50FA6201C)",disk_capacity="3000.6GB",firmware_rev="MKAOAA10",model_name="Hitachi HUA723030ALA640",num="9",security_capability="N.A.",serial_number="MK0371YVKJR45K"} 0[...]areca_sys_info{boot_rom_version="V1.50 2012-01-30",controller_index="1",controller_name="ARC-1882IX-24",cpu_dcache_size="32KB",cpu_icache_size="32KB",cpu_scache_size="1024KB",current_ip_address="192.168.1.158",firmware_version="V1.52 2014-12-26",main_processor="800MHz",serial_number="Y205CADHAR800006",system_memory="1024MB/1333MHz/ECC"} 1
areca_sys_info{boot_rom_version="V1.52 2014-02-07",controller_index="2",controller_name="ARC-1882",cpu_dcache_size="32KB",cpu_icache_size="32KB",cpu_scache_size="1024KB",current_ip_address="192.168.1.100",firmware_version="V1.52 2014-02-07",main_processor="800MHz",serial_number="A228CADFAR300104",system_memory="4096MB/1333MHz"} 1
areca_sys_info{boot_rom_version="V1.52 2014-02-07",controller_index="3",controller_name="ARC-1882",cpu_dcache_size="32KB",cpu_icache_size="32KB",cpu_scache_size="1024KB",current_ip_address="192.168.1.100",firmware_version="V1.52 2014-02-07",main_processor="800MHz",serial_number="Y321CADFAR310359",system_memory="4096MB/1333MHz"} 1
  • --controllers 4 behaves like --controllers 3 but with additional error logs and metrics for the fourth controller:
level=error ts=2025-01-08T22:50:04.906Z caller=areca_exporter.go:53 err="exit status 1" msg="ErrMsg: Invalid Controller#.\n"

[...]

areca_up{collector="disk_info",controller_index="1"} 0
areca_up{collector="disk_info",controller_index="2"} 0
areca_up{collector="disk_info",controller_index="3"} 0
areca_up{collector="disk_info",controller_index="4"} 1
areca_up{collector="rsf_info",controller_index="1"} 0
areca_up{collector="rsf_info",controller_index="2"} 0
areca_up{collector="rsf_info",controller_index="3"} 0
areca_up{collector="rsf_info",controller_index="4"} 1
areca_up{collector="sys_info",controller_index="1"} 0
areca_up{collector="sys_info",controller_index="2"} 0
areca_up{collector="sys_info",controller_index="3"} 0
areca_up{collector="sys_info",controller_index="4"} 1

Why? vilhelmprytz#26 (comment)

Why not auto-detect the controllers? To remain in the spirit of the current behavior of the exporter. Although a list is shown in the CLI along with usage help when run without any argument, there is no explicit CLI command to return the number of controllers. Running e.g. `sys info` for an increasing controller index until failure is noticed works but it is difficult to disambiguate a non-existing controller from a failed run (which are metric reported and skipped) without introducing fragility. It seems simpler and sufficient to have this number specified.

Tested, on system with 3 controllers:
- default, `--controllers 2`, `--controllers 3` works as expected. All `areca_...` metrics (but the implicit `areca_exporter_build_info`) are reported with a new `controller_index=<n>` label (`controller_index` was preferred over `controller` b/c there's an existing `controller_name`). E.g.:

```
areca_disk_state{controller_index="2",device_location="Enclosure#2 SLOT 01",device_type="SATA(5001B4D50FA6201C)",disk_capacity="3000.6GB",firmware_rev="MKAOAA10",model_name="Hitachi HUA723030ALA640",num="9",security_capability="N.A.",serial_number="MK0371YVKJR45K"} 0[...]areca_sys_info{boot_rom_version="V1.50 2012-01-30",controller_index="1",controller_name="ARC-1882IX-24",cpu_dcache_size="32KB",cpu_icache_size="32KB",cpu_scache_size="1024KB",current_ip_address="192.168.1.158",firmware_version="V1.52 2014-12-26",main_processor="800MHz",serial_number="Y205CADHAR800006",system_memory="1024MB/1333MHz/ECC"} 1
areca_sys_info{boot_rom_version="V1.52 2014-02-07",controller_index="2",controller_name="ARC-1882",cpu_dcache_size="32KB",cpu_icache_size="32KB",cpu_scache_size="1024KB",current_ip_address="192.168.1.100",firmware_version="V1.52 2014-02-07",main_processor="800MHz",serial_number="A228CADFAR300104",system_memory="4096MB/1333MHz"} 1
areca_sys_info{boot_rom_version="V1.52 2014-02-07",controller_index="3",controller_name="ARC-1882",cpu_dcache_size="32KB",cpu_icache_size="32KB",cpu_scache_size="1024KB",current_ip_address="192.168.1.100",firmware_version="V1.52 2014-02-07",main_processor="800MHz",serial_number="Y321CADFAR310359",system_memory="4096MB/1333MHz"} 1
```

- `--controllers 4` behaves like `--controllers 3` but with additional error logs and metrics for the fourth controller:
```
level=error ts=2025-01-08T22:50:04.906Z caller=areca_exporter.go:53 err="exit status 1" msg="ErrMsg: Invalid Controller#.\n"

[...]

areca_up{collector="disk_info",controller_index="1"} 0
areca_up{collector="disk_info",controller_index="2"} 0
areca_up{collector="disk_info",controller_index="3"} 0
areca_up{collector="disk_info",controller_index="4"} 1
areca_up{collector="rsf_info",controller_index="1"} 0
areca_up{collector="rsf_info",controller_index="2"} 0
areca_up{collector="rsf_info",controller_index="3"} 0
areca_up{collector="rsf_info",controller_index="4"} 1
areca_up{collector="sys_info",controller_index="1"} 0
areca_up{collector="sys_info",controller_index="2"} 0
areca_up{collector="sys_info",controller_index="3"} 0
areca_up{collector="sys_info",controller_index="4"} 1
```
@sebbov
Copy link
Author

sebbov commented Jan 13, 2025

@vilhelmprytz gentle ping, thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant