summaryrefslogtreecommitdiffstats
path: root/agent/windows-setup-agent/ServiceStatus.cs
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-13 11:32:39 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-13 11:32:39 +0000
commit56ae875861ab260b80a030f50c4aff9f9dc8fff0 (patch)
tree531412110fc901a5918c7f7442202804a83cada9 /agent/windows-setup-agent/ServiceStatus.cs
parentInitial commit. (diff)
downloadicinga2-56ae875861ab260b80a030f50c4aff9f9dc8fff0.tar.xz
icinga2-56ae875861ab260b80a030f50c4aff9f9dc8fff0.zip
Adding upstream version 2.14.2.upstream/2.14.2upstream
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);
+ }
+ }
+}