3838# -v, --version Centreon version (24.10 or 25.10, default: 24.10)
3939# -c, --encryption Encryption mode: full, insecure, or no (default: no)
4040# -r, --reverse Enable poller-initiated (reversed) connection mode
41- # -a, --ca-cert Path to CA certificate file (required if encryption=full/insecure, non-reverse)
42- # -N, --ca -name CA common name (optional, used with encryption=full/insecure)
41+ # -a, --ca Path to CA certificate file (required if encryption=full/insecure, non-reverse)
42+ # -N, --common -name CA common name (optional, used with encryption=full/insecure)
4343# -C, --cert Path to public certificate file (required if encryption=full/insecure, reverse mode)
4444# -k, --key Path to private key file (required if encryption=full/insecure, reverse mode)
4545# -f, --fingerprint Certificate fingerprint for validation
4848# -l, --log-level Log level: off, critical, error, warning, info, debug, trace (default: info)
4949# -M, --max-file-size Maximum log file size in bytes (used with log-type=file)
5050# -m, --max-number Maximum number of log files for rotation (used with log-type=file)
51- # -x, --custom-check Path to custom check configuration file
52- # -p, --components Comma-separated list of components to install: agent,plugin (default: agent,plugin )
51+ # -x, --custom-check-file Path to custom check configuration file
52+ # -p, --components Comma-separated list of components to install: agent,plugins (default: agent,plugins )
5353# -H, --host-template Host template to use in Centreon (optional , default : OS-Linux-Centreon-Monitoring-Agent-custom)
5454# -d, --dry-run Show what would be done without making changes
5555# -h, --help Display this help message
5959# ./install_cma.sh -e "192.168.1.100:4317" -t "my-auth-token"
6060#
6161# # Installation with plugins and custom hostname
62- # ./install_cma.sh -e "poller.example.com:4317" -t "my-token" -n "web-server-01" -p "agent,plugin "
62+ # ./install_cma.sh -e "poller.example.com:4317" -t "my-token" -n "web-server-01" -p "agent,plugins "
6363#
6464# # Installation with full encryption (agent-initiated)
6565# ./install_cma.sh -e "192.168.1.100:4317" -t "my-token" -c full -a /path/to/ca.crt
@@ -89,7 +89,7 @@ DEFAULT_LOG_LEVEL="error"
8989DEFAULT_LOG_TYPE=" file"
9090DEFAULT_LOG_FILE=" /var/log/centreon-monitoring-agent/centagent.log"
9191DEFAULT_MAX_FILE_SIZE=" 10"
92- DEFAULT_MAX_NUMBER=" 3 "
92+ DEFAULT_MAX_NUMBER=" 10 "
9393DEFAULT_HOST_TEMPLATE=" OS-Linux-Centreon-Monitoring-Agent-custom"
9494
9595# Configuration paths
@@ -122,7 +122,7 @@ LOG_LEVEL="${DEFAULT_LOG_LEVEL}"
122122MAX_FILE_SIZE=" ${DEFAULT_MAX_FILE_SIZE} "
123123MAX_NUMBER=" ${DEFAULT_MAX_NUMBER} "
124124CUSTOM_CHECK_FILE=" "
125- COMPONENTS=" agent,plugin "
125+ COMPONENTS=" agent,plugins "
126126DRY_RUN=false
127127OUTPUT_CONFIG=false
128128GITHUB_TOKEN=" ${GITHUB_TOKEN:- } " # Optional GitHub token for API authentication
@@ -174,8 +174,8 @@ OPTIONAL OPTIONS:
174174 -v, --version <VERSION> Centreon version: 24.10 or 25.10 (default: ${DEFAULT_CENTREON_VERSION} )
175175 -c, --encryption <MODE> Encryption mode: full, insecure, or no (default: ${DEFAULT_ENCRYPTION} )
176176 -r, --reverse Enable poller-initiated (reversed) connection mode
177- -a, --ca-cert <PATH> Path to CA certificate file (used with encryption=full/insecure)
178- -N, --ca -name <NAME> CA common name (optional, used with encryption=full/insecure)
177+ -a, --ca <PATH> Path to CA certificate file (used with encryption=full/insecure)
178+ -N, --common -name <NAME> CA common name (optional, used with encryption=full/insecure)
179179 -C, --cert <PATH> Path to public certificate file (required for TLS in reverse mode)
180180 -k, --key <PATH> Path to private key file (required for TLS in reverse mode)
181181 -f, --fingerprint <STRING> Certificate fingerprint for validation
@@ -184,8 +184,8 @@ OPTIONAL OPTIONS:
184184 -l, --log-level <LEVEL> Log level: off, critical, error, warning, info, debug, trace (default: ${DEFAULT_LOG_LEVEL} )
185185 -M, --max-file-size <BYTES> Maximum log file size in bytes (used with log-type=file)
186186 -m, --max-number <NUM> Maximum number of log files for rotation
187- -x, --custom-check <PATH> Path to custom check configuration file
188- -p, --components <LIST> Comma-separated list of components to install: agent,plugin (default: agent,plugin )
187+ -x, --custom-check-file <PATH> Path to custom check configuration file
188+ -p, --components <LIST> Comma-separated list of components to install: agent,plugins (default: agent,plugins )
189189 -H, --host-template <STRING> Host template to use in Centreon (optional)
190190 -d, --dry-run Show what would be done without making changes
191191 -h, --help Display this help message
@@ -195,7 +195,7 @@ EXAMPLES:
195195 ${SCRIPT_NAME} -e "192.168.1.100:4317" -t "my-auth-token"
196196
197197 # Installation with plugins and custom hostname
198- ${SCRIPT_NAME} -e "poller.example.com:4317" -t "my-token" -n "web-server-01" -p "agent,plugin "
198+ ${SCRIPT_NAME} -e "poller.example.com:4317" -t "my-token" -n "web-server-01" -p "agent,plugins "
199199
200200 # Installation with full encryption (agent-initiated)
201201 ${SCRIPT_NAME} -e "192.168.1.100:4317" -t "my-token" -c full -a /path/to/ca.crt
@@ -931,7 +931,7 @@ install_cma_agent() {
931931
932932install_centreon_plugins () {
933933 # Check if "plugin" is in the COMPONENTS list
934- if [[ ! " ${COMPONENTS} " =~ (^| ,)plugin (,| $) ]]; then
934+ if [[ ! " ${COMPONENTS} " =~ (^| ,)plugins (,| $) ]]; then
935935 return 0
936936 fi
937937
@@ -1034,7 +1034,7 @@ generate_config_json() {
10341034 if [[ " ${ENCRYPTION} " == " full" || " ${ENCRYPTION} " == " insecure" ]]; then
10351035 if [[ " ${REVERSE_MODE} " == " true" ]]; then
10361036 if [[ -n " ${PUBLIC_CERT} " ]]; then
1037- config_json+=$' \n ' " \" certificate \" : \" ${PUBLIC_CERT} \" ,"
1037+ config_json+=$' \n ' " \" public_cert \" : \" ${PUBLIC_CERT} \" ,"
10381038 fi
10391039 if [[ -n " ${PRIVATE_KEY} " ]]; then
10401040 config_json+=$' \n ' " \" private_key\" : \" ${PRIVATE_KEY} \" ,"
@@ -1054,7 +1054,7 @@ generate_config_json() {
10541054 fi
10551055
10561056 if [[ -n " ${CUSTOM_CHECK_FILE} " ]]; then
1057- config_json+=$' \n ' " \" check_file \" : \" ${CUSTOM_CHECK_FILE} \" ,"
1057+ config_json+=$' \n ' " \" custom_check_file \" : \" ${CUSTOM_CHECK_FILE} \" ,"
10581058 fi
10591059
10601060 config_json=" ${config_json% ,} "
@@ -1131,7 +1131,7 @@ parse_arguments() {
11311131 CA_CERT=" $2 "
11321132 shift 2
11331133 ;;
1134- -N|--commonname )
1134+ -N|--common-name )
11351135 CA_COMMON_NAME=" $2 "
11361136 shift 2
11371137 ;;
@@ -1147,16 +1147,16 @@ parse_arguments() {
11471147 FINGERPRINT=" $2 "
11481148 shift 2
11491149 ;;
1150- -T|--logtype )
1150+ -T|--log-type )
11511151 LOG_TYPE=" $2 "
11521152 validate_log_type " ${LOG_TYPE} "
11531153 shift 2
11541154 ;;
1155- -L|--logfile )
1155+ -L|--log-file )
11561156 LOG_FILE=" $2 "
11571157 shift 2
11581158 ;;
1159- -l|--loglevel )
1159+ -l|--log-level )
11601160 LOG_LEVEL=" $2 "
11611161 validate_log_level " ${LOG_LEVEL} "
11621162 shift 2
@@ -1169,7 +1169,7 @@ parse_arguments() {
11691169 MAX_NUMBER=" $2 "
11701170 shift 2
11711171 ;;
1172- -x|--custom-check)
1172+ -x|--custom-check-file )
11731173 CUSTOM_CHECK_FILE=" $2 "
11741174 shift 2
11751175 ;;
@@ -1185,7 +1185,7 @@ parse_arguments() {
11851185 DRY_RUN=true
11861186 shift
11871187 ;;
1188- -H| --host-template)
1188+ -H|--host-template)
11891189 HOST_TEMPLATE=" $2 "
11901190 shift 2
11911191 ;;
0 commit comments