From 0915b3ef56dfac3113cce55a59a5765dc94976be Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 28 Apr 2024 14:34:54 +0200 Subject: Adding upstream version 2.13.6. Signed-off-by: Daniel Baumann --- agent/windows-setup-agent/ServiceStatus.cs | 37 ++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 agent/windows-setup-agent/ServiceStatus.cs (limited to 'agent/windows-setup-agent/ServiceStatus.cs') diff --git a/agent/windows-setup-agent/ServiceStatus.cs b/agent/windows-setup-agent/ServiceStatus.cs new file mode 100644 index 0000000..c1272a9 --- /dev/null +++ b/agent/windows-setup-agent/ServiceStatus.cs @@ -0,0 +1,37 @@ +using System; +using System.Windows.Forms; +using System.ServiceProcess; +using System.Diagnostics; + +namespace Icinga +{ + public partial class ServiceStatus : Form + { + public ServiceStatus() + { + InitializeComponent(); + + try { + ServiceController sc = new ServiceController("icinga2"); + + txtStatus.Text = sc.Status.ToString(); + } catch (InvalidOperationException) { + txtStatus.Text = "Not Available"; + } + } + + private void btnReconfigure_Click(object sender, EventArgs e) + { + new SetupWizard().ShowDialog(this); + } + + private void btnOK_Click(object sender, EventArgs e) + { + Close(); + } + + private void btnOpenConfigDir_Click(object sender, EventArgs e) { + Process.Start("explorer.exe", Program.Icinga2DataDir); + } + } +} -- cgit v1.2.3