| 180 | } |
| 181 | |
| 182 | private void ConfigureService() |
| 183 | { |
| 184 | SetConfigureStatus(0, "Updating configuration files..."); |
| 185 | |
| 186 | string output; |
| 187 | |
| 188 | string args = ""; |
| 189 | |
| 190 | Invoke((MethodInvoker)delegate |
| 191 | { |
| 192 | string master_host, master_port; |
| 193 | GetMasterHostPort(out master_host, out master_port); |
| 194 | |
| 195 | args += " --master_host " + master_host + "," + master_port; |
| 196 | |
| 197 | foreach (ListViewItem lvi in lvwEndpoints.Items) { |
| 198 | args += " --endpoint " + lvi.SubItems[0].Text.Trim(); |
| 199 | |
| 200 | if (lvi.SubItems.Count > 1) |
| 201 | args += "," + lvi.SubItems[1].Text.Trim() + "," + lvi.SubItems[2].Text.Trim(); |
| 202 | } |
| 203 | }); |
| 204 | |
| 205 | if (rdoListener.Checked) |
| 206 | args += " --listen ::," + txtListenerPort.Text.Trim(); |
| 207 | |
| 208 | if (chkAcceptConfig.Checked) |
| 209 | args += " --accept-config"; |
| 210 | |
| 211 | if (chkAcceptCommands.Checked) |
| 212 | args += " --accept-commands"; |
| 213 | |
| 214 | string ticket = txtTicket.Text.Trim(); |
| 215 | |
| 216 | if (ticket.Length > 0) |
| 217 | args += " --ticket \"" + ticket + "\""; |
| 218 | |
| 219 | args += " --trustedcert \"" + _TrustedFile + "\""; |
| 220 | args += " --cn \"" + txtInstanceName.Text.Trim() + "\""; |
| 221 | args += " --zone \"" + txtInstanceName.Text.Trim() + "\""; |
| 222 | |
| 223 | foreach (ListViewItem lvi in lvwGlobalZones.Items) { |
| 224 | args += " --global_zones " + lvi.SubItems[0].Text.Trim(); |
| 225 | } |
| 226 | |
| 227 | if (chkDisableConf.Checked) |
| 228 | args += " --disable-confd"; |
| 229 | |
| 230 | if (!RunProcess(Program.Icinga2InstallDir + "\\sbin\\icinga2.exe", |
| 231 | "node setup" + args, |
| 232 | out output)) { |
| 233 | ShowErrorText("Running command 'icinga2.exe " + "node setup" + args + "' produced the following output:\n" + output); |
| 234 | return; |
| 235 | } |
| 236 | |
| 237 | SetConfigureStatus(50, "Setting ACLs for the Icinga 2 directory..."); |
| 238 | |
| 239 | string serviceUser = txtUser.Text.Trim(); |