]> granicus.if.org Git - icinga2/blob - agent/windows-setup-agent/ServiceStatus.cs
3f9ae1ada100fa20a9342cfb554b42f30edcbd5e
[icinga2] / agent / windows-setup-agent / ServiceStatus.cs
1 using System;
2 using System.Collections.Generic;
3 using System.ComponentModel;
4 using System.Data;
5 using System.Drawing;
6 using System.Text;
7 using System.Windows.Forms;
8 using System.ServiceProcess;
9
10 namespace Icinga
11 {
12         public partial class ServiceStatus : Form
13         {
14                 public ServiceStatus()
15                 {
16                         InitializeComponent();
17
18                         try {
19                                 ServiceController sc = new ServiceController("icinga2");
20
21                                 txtStatus.Text = sc.Status.ToString();
22                         } catch (InvalidOperationException) {
23                                 txtStatus.Text = "Not Available";
24                         }
25                 }
26
27                 private void btnReconfigure_Click(object sender, EventArgs e)
28                 {
29                         new SetupWizard().ShowDialog(this);
30                 }
31
32                 private void btnOK_Click(object sender, EventArgs e)
33                 {
34                         Close();
35                 }
36         }
37 }