YPSI-SAS / centctl

Centctl is a Go CLI which allows to manage multiple Centreon servers.
MIT License
11 stars 4 forks source link

Export problem with double quotes #4

Closed kermith72 closed 3 years ago

kermith72 commented 3 years ago

Describe the bug I exported this command

./centctl --server=centos export command -r 'old$' -t check -f confignrpe3.csv

add,command,"OS-Windows-NRPE-Cpu-old","2","$USER1$/$_HOSTNRPECLIENT$ -H $HOSTADDRESS$ -p $_HOSTNRPEPORT$ -t $_HOSTNRPETIMEOUT$ $_HOSTNRPEEXTRAOPTIONS$ -c check_cpu -a '"warn=$_SERVICEWARNING$" "crit=$_SERVICECRITICAL$" $_SERVICEEXTRAOPTIONS$'"
modify,command,"OS-Windows-NRPE-Cpu-old",graph,
modify,command,"OS-Windows-NRPE-Cpu-old",example,
modify,command,"OS-Windows-NRPE-Cpu-old",comment,""
modify,command,"OS-Windows-NRPE-Cpu-old",activate,"1"
modify,command,"OS-Windows-NRPE-Cpu-old",enable_shell,"0"

When I import it, I get this error message

./centctl --server=centos import -f confignrpe3.csv 
ERROR: It missing an argument for the add command `OS-Windows-NRPE-Cpu-old` in the csv file

If I remove the double quotes in the command, the export works

./centctl --server=centos import -f test.csv 
INFO: The CMD OS-Windows-NRPE-Cpu-old is created

It should be possible to protect double quotes

ypilpre commented 3 years ago

Issue has been solved with 2.0.2 release.