ITRS-Group / cordial

Cordial comprises a set of interrelated programs, integrations, libraries and packages for Geneos, principally written in Go.
Other
7 stars 0 forks source link

geneos move does not work when specifying a type #192

Open rcanillas-itrs opened 8 months ago

rcanillas-itrs commented 8 months ago

Versions:

[rcanillas@MNLP179-alma:~]$ cat /etc/centos-release
AlmaLinux release 8.9 (Midnight Oncilla)
[rcanillas@MNLP179-alma:~]$ geneos -v
geneos version v1.11.2

Current running instances:

[rcanillas@MNLP179-alma:~]$ geneos ps
Type      Name          Host       PID  Ports        User       Group      Starttime                  Version                Home
gateway   MNLP179-alma  localhost  870  [7039]       rcanillas  rcanillas  2023-12-21T15:18:50+08:00  active_prod:6.6.0+el8  /home/rcanillas/geneos/gateway/gateways/MNLP179-alma
licd      MNLP179-alma  localhost  876  [7041 7853]  rcanillas  rcanillas  2023-12-21T15:18:51+08:00  active_prod:6.5.0+el8  /home/rcanillas/geneos/licd/licds/MNLP179-alma
netprobe  localhost     localhost  756  [7036]       rcanillas  rcanillas  2023-12-21T13:36:09+08:00  active_prod:6.6.0+el8  /home/rcanillas/geneos/netprobe/netprobes/localhost

Trying to rename the MNLP179-alma Gateway to gw-MNLP179 but getting error:

[rcanillas@MNLP179-alma:~]$ geneos move gateway MNLP179-alma gw-MNLP179
Error: invalid arguments
[rcanillas@MNLP179-alma:~]$ geneos rename gateway MNLP179-alma gw-MNLP179
Error: invalid arguments

From the helptext, it should be possible to specify a type:

[rcanillas@MNLP179-alma:~]$ geneos move -h
Usage:
  geneos move [TYPE] SOURCE DESTINATION [KEY=VALUE...]

Aliases:
  move, mv, rename

Global Flags:
  -G, --config string   config file (defaults are $HOME/.config/geneos.json, /etc/geneos/geneos.json)
  -H, --host HOSTNAME   Limit actions to HOSTNAME (not for commands given instance@host parameters) (default "all")
rcanillas-itrs commented 8 months ago

Found out how to print debug statements so here is a re-run:

Current netprobes:

[rcanillas@MNLP179-alma:~]$ geneos ls netprobe
Type      Name         Host       Flags  Port  Version                Home
netprobe  316495       localhost  A      7100  6.5.1+el8:6.5.1+el8    /home/rcanillas/geneos/netprobe/netprobes/316495
netprobe  np-MNLP179   localhost  A      7036  active_prod:6.6.0+el8  /home/rcanillas/geneos/netprobe/netprobes/np-MNLP179
netprobe  rename_test  localhost  A      7101  active_prod:6.6.0+el8  /home/rcanillas/geneos/netprobe/netprobes/rename_test

Want to rename rename_test to something else:

[rcanillas@MNLP179-alma:~]$ geneos move netprobe rename_test new_name
Error: invalid arguments

Debug:

[rcanillas@MNLP179-alma:~]$ geneos move netprobe rename_test new_name --debug
2024-01-17T11:35:31+08:00 DEBUG: tools/geneos/cmd/root.go:276 cmd.initConfig() > cordial: cordial 'geneos' running as 'geneos', version v1.11.2
2024-01-17T11:35:31+08:00 DEBUG: tools/geneos/cmd/parseargs.go:102 cmd.ParseArgs() > cordial: rawargs: [netprobe rename_test new_name]
2024-01-17T11:35:31+08:00 DEBUG: tools/geneos/cmd/parseargs.go:117 cmd.ParseArgs() > cordial: args [netprobe rename_test new_name], params [], ct
2024-01-17T11:35:31+08:00 DEBUG: tools/geneos/cmd/parseargs.go:148 cmd.ParseArgs() > cordial: matching [rename_test new_name]
2024-01-17T11:35:31+08:00 DEBUG: tools/geneos/cmd/parseargs.go:247 cmd.ParseArgs() > cordial: ct netprobe, args [rename_test], params []
2024-01-17T11:35:31+08:00 DEBUG: tools/geneos/internal/instance/instance.go:79 instance.ReservedName() > cordial: checking "rename_test"
Error: invalid arguments