summaryrefslogtreecommitdiffstats
path: root/agent/windows-setup-agent/ServiceStatus.cs
diff options
context:
space:
mode:
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);
+ }
+ }
+}