Cacti / cacti

Cacti ™
http://www.cacti.net
GNU General Public License v2.0
1.61k stars 399 forks source link

When importing packages via command line, data source profile could not be selected #5628

Closed ddb4github closed 5 months ago

ddb4github commented 7 months ago

Describe the bug


$ php -q cli/import_package.php -h
Cacti Import Template Utility, Version 1.2.26 (DB: 1.2.26), Copyright (C) 2004-2023 The Cacti Group

usage: import_package.php --filename=[filename] [--info] [--remove-orphans] [--replace-svalues] [--with-profile] [--profile-id=N

A utility to allow signed Cacti Packages to be imported from the command line.

Required:
    --filename              The name of the gzipped package file to import

Optional:
    --info            Output the info section of the package, do not import
    --preview         Preview the Template Import, do not import
    --with-profile    Use the default system Data Source Profile
    --profile-id=N    Use the specific profile id when importing
    --remove-orphans  If importing a new version of the template, old
                      elements will be removed, if they do not exist
                      in the new version of the template.
    --replace-svalues If replacing an old version of either a Device
                      Template with Data Queries or a Data Query, when
                      you select this option, all Data Query Suggested
                      Value Patterns will be replaced with that of the
                      Package Data Queries.
$ php -q cli/import_package.php --filename=install/templates/PING_Advanced_Ping.xml.gz --with-profile
ERROR: Invalid Argument: (--with-profile)
ddb4github commented 7 months ago

For this issue,I'm not sure "design" want to remove "with-profile", or miss to support it

TheWitness commented 6 months ago

Did you consider a pull request @ddb4github ?

TheWitness commented 6 months ago

I've got this one.