Merge pull request #6170 from Icinga/feature/windows-global-zones

Add option to windows installer to add global zones
This commit is contained in:
Michael Friedrich 2018-04-03 17:19:49 +02:00 committed by GitHub
commit e08231f4df
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
11 changed files with 457 additions and 34 deletions

View File

@ -0,0 +1,117 @@
namespace Icinga
{
partial class GlobalZonesInputBox
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.btnOK = new System.Windows.Forms.Button();
this.btnCancel = new System.Windows.Forms.Button();
this.label1 = new System.Windows.Forms.Label();
this.lblGlobalZoneName = new System.Windows.Forms.Label();
this.txtGlobalZoneName = new System.Windows.Forms.TextBox();
this.SuspendLayout();
//
// btnOK
//
this.btnOK.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.btnOK.Location = new System.Drawing.Point(191, 76);
this.btnOK.Name = "btnOK";
this.btnOK.Size = new System.Drawing.Size(75, 23);
this.btnOK.TabIndex = 0;
this.btnOK.Text = "OK";
this.btnOK.UseVisualStyleBackColor = true;
this.btnOK.Click += new System.EventHandler(this.btnOK_Click);
//
// btnCancel
//
this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.btnCancel.Location = new System.Drawing.Point(272, 76);
this.btnCancel.Name = "btnCancel";
this.btnCancel.Size = new System.Drawing.Size(75, 23);
this.btnCancel.TabIndex = 1;
this.btnCancel.Text = "Cancel";
this.btnCancel.UseVisualStyleBackColor = true;
//
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(13, 13);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(231, 13);
this.label1.TabIndex = 2;
this.label1.Text = "Please enter the name for the new global Zone:";
//
// lblGlobalZoneName
//
this.lblGlobalZoneName.AutoSize = true;
this.lblGlobalZoneName.Location = new System.Drawing.Point(16, 46);
this.lblGlobalZoneName.Name = "lblGlobalZoneName";
this.lblGlobalZoneName.Size = new System.Drawing.Size(68, 13);
this.lblGlobalZoneName.TabIndex = 3;
this.lblGlobalZoneName.Text = "Global Zone:";
//
// txtGlobalZoneName
//
this.txtGlobalZoneName.Location = new System.Drawing.Point(90, 43);
this.txtGlobalZoneName.Name = "txtGlobalZoneName";
this.txtGlobalZoneName.Size = new System.Drawing.Size(257, 20);
this.txtGlobalZoneName.TabIndex = 0;
//
// GlobalZonesInputBox
//
this.AcceptButton = this.btnOK;
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.CancelButton = this.btnCancel;
this.ClientSize = new System.Drawing.Size(359, 111);
this.Controls.Add(this.txtGlobalZoneName);
this.Controls.Add(this.lblGlobalZoneName);
this.Controls.Add(this.label1);
this.Controls.Add(this.btnCancel);
this.Controls.Add(this.btnOK);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "GlobalZonesInputBox";
this.ShowIcon = false;
this.ShowInTaskbar = false;
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
this.Text = "Add Global Zones";
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.Button btnOK;
private System.Windows.Forms.Button btnCancel;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.Label lblGlobalZoneName;
public System.Windows.Forms.TextBox txtGlobalZoneName;
}
}

View File

@ -0,0 +1,46 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
namespace Icinga
{
public partial class GlobalZonesInputBox : Form
{
private ListView.ListViewItemCollection globalZonesItems;
public GlobalZonesInputBox(ListView.ListViewItemCollection globalZonesItems)
{
InitializeComponent();
this.globalZonesItems = globalZonesItems;
}
private void Warning(string message)
{
MessageBox.Show(this, message, Text, MessageBoxButtons.OK, MessageBoxIcon.Warning);
}
private void btnOK_Click(object sender, EventArgs e)
{
if (txtGlobalZoneName.Text == "global-templates" || txtGlobalZoneName.Text == "director-global") {
Warning("This global zone is configured by default.");
return;
}
foreach (ListViewItem lvw in globalZonesItems) {
if (txtGlobalZoneName.Text == lvw.Text) {
Warning("This global zone is already defined.");
return;
}
}
DialogResult = DialogResult.OK;
Close();
}
}
}

View File

@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

View File

@ -117,6 +117,12 @@
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="GlobalZonesInputBox.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="GlobalZonesInputBox.Designer.cs">
<DependentUpon>GlobalZonesInputBox.cs</DependentUpon>
</Compile>
<Compile Include="ServiceStatus.cs">
<SubType>Form</SubType>
</Compile>
@ -137,6 +143,9 @@
</Compile>
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<EmbeddedResource Include="GlobalZonesInputBox.resx">
<DependentUpon>GlobalZonesInputBox.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="ServiceStatus.resx">
<DependentUpon>ServiceStatus.cs</DependentUpon>
</EmbeddedResource>
@ -201,4 +210,4 @@
<Target Name="AfterBuild">
</Target>
-->
</Project>
</Project>

View File

@ -38,6 +38,13 @@
this.lblConfigStatus = new System.Windows.Forms.Label();
this.prgConfig = new System.Windows.Forms.ProgressBar();
this.tabParameters = new System.Windows.Forms.TabPage();
this.groupBox4 = new System.Windows.Forms.GroupBox();
this.btnEditGlobalZone = new System.Windows.Forms.Button();
this.btnRemoveGlobalZone = new System.Windows.Forms.Button();
this.btnAddGlobalZone = new System.Windows.Forms.Button();
this.lvwGlobalZones = new System.Windows.Forms.ListView();
this.colGlobalZoneName = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.introduction1 = new System.Windows.Forms.Label();
this.groupBox3 = new System.Windows.Forms.GroupBox();
this.txtUser = new System.Windows.Forms.TextBox();
this.chkRunServiceAsThisUser = new System.Windows.Forms.CheckBox();
@ -80,10 +87,10 @@
this.txtError = new System.Windows.Forms.TextBox();
this.lblError = new System.Windows.Forms.Label();
this.picBanner = new System.Windows.Forms.PictureBox();
this.introduction1 = new System.Windows.Forms.Label();
this.tabFinish.SuspendLayout();
this.tabConfigure.SuspendLayout();
this.tabParameters.SuspendLayout();
this.groupBox4.SuspendLayout();
this.groupBox3.SuspendLayout();
this.groupBox2.SuspendLayout();
this.groupBox1.SuspendLayout();
@ -98,7 +105,7 @@
// btnBack
//
this.btnBack.Enabled = false;
this.btnBack.Location = new System.Drawing.Point(367, 592);
this.btnBack.Location = new System.Drawing.Point(376, 556);
this.btnBack.Name = "btnBack";
this.btnBack.Size = new System.Drawing.Size(75, 23);
this.btnBack.TabIndex = 1;
@ -108,7 +115,7 @@
//
// btnNext
//
this.btnNext.Location = new System.Drawing.Point(448, 592);
this.btnNext.Location = new System.Drawing.Point(457, 556);
this.btnNext.Name = "btnNext";
this.btnNext.Size = new System.Drawing.Size(75, 23);
this.btnNext.TabIndex = 2;
@ -119,7 +126,7 @@
// btnCancel
//
this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.btnCancel.Location = new System.Drawing.Point(538, 592);
this.btnCancel.Location = new System.Drawing.Point(538, 556);
this.btnCancel.Name = "btnCancel";
this.btnCancel.Size = new System.Drawing.Size(75, 23);
this.btnCancel.TabIndex = 3;
@ -133,7 +140,7 @@
this.tabFinish.Location = new System.Drawing.Point(4, 5);
this.tabFinish.Name = "tabFinish";
this.tabFinish.Padding = new System.Windows.Forms.Padding(3);
this.tabFinish.Size = new System.Drawing.Size(617, 500);
this.tabFinish.Size = new System.Drawing.Size(617, 471);
this.tabFinish.TabIndex = 5;
this.tabFinish.Text = "Finish";
this.tabFinish.UseVisualStyleBackColor = true;
@ -154,7 +161,7 @@
this.tabConfigure.Location = new System.Drawing.Point(4, 5);
this.tabConfigure.Name = "tabConfigure";
this.tabConfigure.Padding = new System.Windows.Forms.Padding(3);
this.tabConfigure.Size = new System.Drawing.Size(617, 500);
this.tabConfigure.Size = new System.Drawing.Size(617, 471);
this.tabConfigure.TabIndex = 4;
this.tabConfigure.Text = "Configure Icinga 2";
this.tabConfigure.UseVisualStyleBackColor = true;
@ -177,6 +184,7 @@
//
// tabParameters
//
this.tabParameters.Controls.Add(this.groupBox4);
this.tabParameters.Controls.Add(this.introduction1);
this.tabParameters.Controls.Add(this.groupBox3);
this.tabParameters.Controls.Add(this.txtTicket);
@ -188,11 +196,83 @@
this.tabParameters.Location = new System.Drawing.Point(4, 5);
this.tabParameters.Name = "tabParameters";
this.tabParameters.Padding = new System.Windows.Forms.Padding(3);
this.tabParameters.Size = new System.Drawing.Size(617, 500);
this.tabParameters.Size = new System.Drawing.Size(617, 471);
this.tabParameters.TabIndex = 3;
this.tabParameters.Text = "Agent Parameters";
this.tabParameters.UseVisualStyleBackColor = true;
//
// groupBox4
//
this.groupBox4.Controls.Add(this.btnEditGlobalZone);
this.groupBox4.Controls.Add(this.btnRemoveGlobalZone);
this.groupBox4.Controls.Add(this.btnAddGlobalZone);
this.groupBox4.Controls.Add(this.lvwGlobalZones);
this.groupBox4.Location = new System.Drawing.Point(8, 210);
this.groupBox4.Name = "groupBox4";
this.groupBox4.Size = new System.Drawing.Size(601, 110);
this.groupBox4.TabIndex = 9;
this.groupBox4.TabStop = false;
this.groupBox4.Text = "Global Zones";
//
// btnEditGlobalZone
//
this.btnEditGlobalZone.Enabled = false;
this.btnEditGlobalZone.Location = new System.Drawing.Point(520, 48);
this.btnEditGlobalZone.Name = "btnEditGlobalZone";
this.btnEditGlobalZone.Size = new System.Drawing.Size(75, 23);
this.btnEditGlobalZone.TabIndex = 7;
this.btnEditGlobalZone.Text = "Edit";
this.btnEditGlobalZone.UseVisualStyleBackColor = true;
this.btnEditGlobalZone.Click += new System.EventHandler(this.btnEditGlobalZone_Click);
//
// btnRemoveGlobalZone
//
this.btnRemoveGlobalZone.Enabled = false;
this.btnRemoveGlobalZone.Location = new System.Drawing.Point(520, 77);
this.btnRemoveGlobalZone.Name = "btnRemoveGlobalZone";
this.btnRemoveGlobalZone.Size = new System.Drawing.Size(75, 23);
this.btnRemoveGlobalZone.TabIndex = 6;
this.btnRemoveGlobalZone.Text = "Remove";
this.btnRemoveGlobalZone.UseVisualStyleBackColor = true;
this.btnRemoveGlobalZone.Click += new System.EventHandler(this.btnRemoveGlobalZone_Click);
//
// btnAddGlobalZone
//
this.btnAddGlobalZone.Location = new System.Drawing.Point(520, 19);
this.btnAddGlobalZone.Name = "btnAddGlobalZone";
this.btnAddGlobalZone.Size = new System.Drawing.Size(75, 23);
this.btnAddGlobalZone.TabIndex = 5;
this.btnAddGlobalZone.Text = "Add";
this.btnAddGlobalZone.UseVisualStyleBackColor = true;
this.btnAddGlobalZone.Click += new System.EventHandler(this.btnAddGlobalZone_Click);
//
// lvwGlobalZones
//
this.lvwGlobalZones.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
this.colGlobalZoneName});
this.lvwGlobalZones.FullRowSelect = true;
this.lvwGlobalZones.Location = new System.Drawing.Point(6, 19);
this.lvwGlobalZones.Name = "lvwGlobalZones";
this.lvwGlobalZones.Size = new System.Drawing.Size(500, 81);
this.lvwGlobalZones.TabIndex = 4;
this.lvwGlobalZones.UseCompatibleStateImageBehavior = false;
this.lvwGlobalZones.View = System.Windows.Forms.View.Details;
this.lvwGlobalZones.SelectedIndexChanged += new System.EventHandler(this.lvwGlobalZones_SelectedIndexChanged);
//
// colGlobalZoneName
//
this.colGlobalZoneName.Text = "Zone Name";
this.colGlobalZoneName.Width = 496;
//
// introduction1
//
this.introduction1.AutoSize = true;
this.introduction1.Location = new System.Drawing.Point(11, 3);
this.introduction1.Name = "introduction1";
this.introduction1.Size = new System.Drawing.Size(269, 13);
this.introduction1.TabIndex = 6;
this.introduction1.Text = "Welcome to the Icinga 2 Windows Client Setup Wizard!";
//
// groupBox3
//
this.groupBox3.Controls.Add(this.txtUser);
@ -200,9 +280,9 @@
this.groupBox3.Controls.Add(this.chkInstallNSCP);
this.groupBox3.Controls.Add(this.chkAcceptConfig);
this.groupBox3.Controls.Add(this.chkAcceptCommands);
this.groupBox3.Location = new System.Drawing.Point(308, 291);
this.groupBox3.Location = new System.Drawing.Point(308, 326);
this.groupBox3.Name = "groupBox3";
this.groupBox3.Size = new System.Drawing.Size(301, 188);
this.groupBox3.Size = new System.Drawing.Size(301, 139);
this.groupBox3.TabIndex = 5;
this.groupBox3.TabStop = false;
this.groupBox3.Text = "Advanced Options";
@ -295,9 +375,9 @@
this.groupBox2.Controls.Add(this.txtListenerPort);
this.groupBox2.Controls.Add(this.lblListenerPort);
this.groupBox2.Controls.Add(this.rdoListener);
this.groupBox2.Location = new System.Drawing.Point(8, 291);
this.groupBox2.Location = new System.Drawing.Point(8, 326);
this.groupBox2.Name = "groupBox2";
this.groupBox2.Size = new System.Drawing.Size(298, 188);
this.groupBox2.Size = new System.Drawing.Size(298, 139);
this.groupBox2.TabIndex = 2;
this.groupBox2.TabStop = false;
this.groupBox2.Text = "TCP Listener";
@ -352,7 +432,7 @@
this.groupBox1.Controls.Add(this.lvwEndpoints);
this.groupBox1.Location = new System.Drawing.Point(8, 94);
this.groupBox1.Name = "groupBox1";
this.groupBox1.Size = new System.Drawing.Size(601, 191);
this.groupBox1.Size = new System.Drawing.Size(601, 110);
this.groupBox1.TabIndex = 1;
this.groupBox1.TabStop = false;
this.groupBox1.Text = "Parent master/satellite instance(s) for this client";
@ -392,13 +472,13 @@
// lvwEndpoints
//
this.lvwEndpoints.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
this.colInstanceName,
this.colHost,
this.colPort});
this.colInstanceName,
this.colHost,
this.colPort});
this.lvwEndpoints.FullRowSelect = true;
this.lvwEndpoints.Location = new System.Drawing.Point(6, 19);
this.lvwEndpoints.Name = "lvwEndpoints";
this.lvwEndpoints.Size = new System.Drawing.Size(500, 166);
this.lvwEndpoints.Size = new System.Drawing.Size(500, 81);
this.lvwEndpoints.TabIndex = 4;
this.lvwEndpoints.UseCompatibleStateImageBehavior = false;
this.lvwEndpoints.View = System.Windows.Forms.View.Details;
@ -433,7 +513,7 @@
this.tbcPages.Margin = new System.Windows.Forms.Padding(0);
this.tbcPages.Name = "tbcPages";
this.tbcPages.SelectedIndex = 0;
this.tbcPages.Size = new System.Drawing.Size(625, 509);
this.tbcPages.Size = new System.Drawing.Size(625, 480);
this.tbcPages.SizeMode = System.Windows.Forms.TabSizeMode.Fixed;
this.tbcPages.TabIndex = 0;
this.tbcPages.SelectedIndexChanged += new System.EventHandler(this.tbcPages_SelectedIndexChanged);
@ -445,7 +525,7 @@
this.tabRetrieveCertificate.Location = new System.Drawing.Point(4, 5);
this.tabRetrieveCertificate.Name = "tabRetrieveCertificate";
this.tabRetrieveCertificate.Padding = new System.Windows.Forms.Padding(3);
this.tabRetrieveCertificate.Size = new System.Drawing.Size(617, 500);
this.tabRetrieveCertificate.Size = new System.Drawing.Size(617, 471);
this.tabRetrieveCertificate.TabIndex = 7;
this.tabRetrieveCertificate.Text = "Checking Certificate";
this.tabRetrieveCertificate.UseVisualStyleBackColor = true;
@ -477,7 +557,7 @@
this.tabVerifyCertificate.Location = new System.Drawing.Point(4, 5);
this.tabVerifyCertificate.Name = "tabVerifyCertificate";
this.tabVerifyCertificate.Padding = new System.Windows.Forms.Padding(3);
this.tabVerifyCertificate.Size = new System.Drawing.Size(617, 500);
this.tabVerifyCertificate.Size = new System.Drawing.Size(617, 471);
this.tabVerifyCertificate.TabIndex = 6;
this.tabVerifyCertificate.Text = "Verify Certificate";
this.tabVerifyCertificate.UseVisualStyleBackColor = true;
@ -507,8 +587,8 @@
// lvwX509Fields
//
this.lvwX509Fields.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
this.colField,
this.colValue});
this.colField,
this.colValue});
this.lvwX509Fields.Location = new System.Drawing.Point(6, 19);
this.lvwX509Fields.Name = "lvwX509Fields";
this.lvwX509Fields.Size = new System.Drawing.Size(586, 172);
@ -566,7 +646,7 @@
this.lblX509Prompt.AutoSize = true;
this.lblX509Prompt.Location = new System.Drawing.Point(8, 15);
this.lblX509Prompt.Name = "lblX509Prompt";
this.lblX509Prompt.Size = new System.Drawing.Size(201, 13);
this.lblX509Prompt.Size = new System.Drawing.Size(241, 13);
this.lblX509Prompt.TabIndex = 0;
this.lblX509Prompt.Text = "Please verify the master/satellite\'s SSL certificate:";
//
@ -577,7 +657,7 @@
this.tabError.Location = new System.Drawing.Point(4, 5);
this.tabError.Name = "tabError";
this.tabError.Padding = new System.Windows.Forms.Padding(3);
this.tabError.Size = new System.Drawing.Size(617, 500);
this.tabError.Size = new System.Drawing.Size(617, 471);
this.tabError.TabIndex = 8;
this.tabError.Text = "Error";
this.tabError.UseVisualStyleBackColor = true;
@ -611,22 +691,13 @@
this.picBanner.TabIndex = 1;
this.picBanner.TabStop = false;
//
// introduction1
//
this.introduction1.AutoSize = true;
this.introduction1.Location = new System.Drawing.Point(11, 3);
this.introduction1.Name = "introduction1";
this.introduction1.Size = new System.Drawing.Size(269, 13);
this.introduction1.TabIndex = 6;
this.introduction1.Text = "Welcome to the Icinga 2 Windows Client Setup Wizard!";
//
// SetupWizard
//
this.AcceptButton = this.btnNext;
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.CancelButton = this.btnCancel;
this.ClientSize = new System.Drawing.Size(625, 624);
this.ClientSize = new System.Drawing.Size(625, 587);
this.Controls.Add(this.btnCancel);
this.Controls.Add(this.btnNext);
this.Controls.Add(this.btnBack);
@ -643,6 +714,7 @@
this.tabConfigure.PerformLayout();
this.tabParameters.ResumeLayout(false);
this.tabParameters.PerformLayout();
this.groupBox4.ResumeLayout(false);
this.groupBox3.ResumeLayout(false);
this.groupBox3.PerformLayout();
this.groupBox2.ResumeLayout(false);
@ -716,6 +788,12 @@
private System.Windows.Forms.CheckBox chkRunServiceAsThisUser;
private System.Windows.Forms.Button btnEditEndpoint;
private System.Windows.Forms.Label introduction1;
private System.Windows.Forms.GroupBox groupBox4;
private System.Windows.Forms.Button btnEditGlobalZone;
private System.Windows.Forms.Button btnRemoveGlobalZone;
private System.Windows.Forms.Button btnAddGlobalZone;
private System.Windows.Forms.ListView lvwGlobalZones;
private System.Windows.Forms.ColumnHeader colGlobalZoneName;
}
}

View File

@ -222,6 +222,10 @@ namespace Icinga
args += " --cn \"" + txtInstanceName.Text.Trim() + "\"";
args += " --zone \"" + txtInstanceName.Text.Trim() + "\"";
foreach (ListViewItem lvi in lvwGlobalZones.Items) {
args += " --global_zones " + lvi.SubItems[0].Text.Trim();
}
if (!RunProcess(Program.Icinga2InstallDir + "\\sbin\\icinga2.exe",
"node setup" + args,
out output)) {
@ -516,6 +520,51 @@ namespace Icinga
lvwEndpoints.Items.Add(lvi2);
}
private void btnAddGlobalZone_Click(object sender, EventArgs e)
{
GlobalZonesInputBox gzib = new GlobalZonesInputBox(lvwGlobalZones.Items);
if (gzib.ShowDialog(this) == DialogResult.Cancel)
return;
ListViewItem lvi = new ListViewItem();
lvi.Text = gzib.txtGlobalZoneName.Text;
lvwGlobalZones.Items.Add(lvi);
}
private void btnRemoveGlobalZone_Click(object sender, EventArgs e)
{
while (lvwGlobalZones.SelectedItems.Count > 0) {
lvwGlobalZones.Items.Remove(lvwGlobalZones.SelectedItems[0]);
}
}
private void lvwGlobalZones_SelectedIndexChanged(object sender, EventArgs e)
{
btnEditGlobalZone.Enabled = lvwGlobalZones.SelectedItems.Count > 0;
btnRemoveGlobalZone.Enabled = lvwGlobalZones.SelectedItems.Count > 0;
}
private void btnEditGlobalZone_Click(object sender, EventArgs e)
{
ListViewItem lvi = lvwGlobalZones.SelectedItems[0];
GlobalZonesInputBox gzib = new GlobalZonesInputBox(lvwGlobalZones.Items);
gzib.Text = "Edit Global Zone";
gzib.txtGlobalZoneName.Text = lvi.SubItems[0].Text;
if (gzib.ShowDialog(this) == DialogResult.Cancel)
return;
lvwGlobalZones.Items.Remove(lvi);
ListViewItem lvi2 = new ListViewItem();
lvi2.Text = gzib.txtGlobalZoneName.Text;
lvwGlobalZones.Items.Add(lvi2);
}
}
}

View File

@ -663,6 +663,10 @@ Add the following details:
![Icinga 2 Windows Setup](images/distributed-monitoring/icinga2_windows_setup_wizard_02.png)
When needed you can add an additional global zone (the zones `global-templates` and `director-global` are added by default):
![Icinga 2 Windows Setup](images/distributed-monitoring/icinga2_windows_setup_wizard_02_global_zone.png)
Optionally enable the following settings:
Parameter | Description

Binary file not shown.

Before

Width:  |  Height:  |  Size: 24 KiB

After

Width:  |  Height:  |  Size: 31 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 33 KiB

After

Width:  |  Height:  |  Size: 41 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 40 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 25 KiB

After

Width:  |  Height:  |  Size: 33 KiB