Skip to content

Default Setting "Device Threads" will not be saved correctly #4279

@browniebraun

Description

@browniebraun

Describe the bug

Instead of the real selected value Cacti stores the selected index of the dropdown menu.
But within scripts like /CLI/add_device.php the value will be directly used with

$device_threads = read_config_option('device_threads');

To Reproduce

Set the default number of threads to 4 for example, log in to MySQL and read the value from settings:

select * from settings where name = 'device_threads';

MySQL will return 3 in this case.

Expected behavior

select * from settings where name = 'device_threads' will return 4, not 3.

Bug is in

1.2.16, 17 ...

located in /include/global_settings.php, ~ line 578

'device_threads' => array( 'friendly_name' => __('Device Threads'), 'description' => __('The default number of Device Threads. This is only applicable when using the Spine Data Collector.'), 'method' => 'drop_array', 'default' => '1', 'array' => array(1, 2, 3, 4, 5, 6) ),

'array' => definition should start with index 1 not 0. ( 1=>1, .... )

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugUndesired behaviourresolvedA fixed issue

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions