summaryrefslogtreecommitdiffstats
path: root/agent/windows-setup-agent/ServiceStatus.cs
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-28 12:34:54 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-28 12:34:54 +0000
commit0915b3ef56dfac3113cce55a59a5765dc94976be (patch)
treea8fea11d50b4f083e1bf0f90025ece7f0824784a /agent/windows-setup-agent/ServiceStatus.cs
parentInitial commit. (diff)
downloadicinga2-0915b3ef56dfac3113cce55a59a5765dc94976be.tar.xz
icinga2-0915b3ef56dfac3113cce55a59a5765dc94976be.zip
Adding upstream version 2.13.6.upstream/2.13.6upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'agent/windows-setup-agent/ServiceStatus.cs')
-rw-r--r--agent/windows-setup-agent/ServiceStatus.cs37
1 files changed, 37 insertions, 0 deletions
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);
+ }
+ }
+}