コード例 #1
0
 protected void btnMonitor_Click(object sender, EventArgs e)
 {
     foreach (ListItem liEventCat in eventLogList.Items)
     {
         if (liEventCat.Selected)
         {
             try
             {
                 BCCMonitoringDataAccess da = new BCCMonitoringDataAccess();
                 da.CreateMonitoringEntry(ArtifactType.EventLog, liEventCat.Value);
                 new ActivityHelper().RaiseAuditEvent(this, lblCaption.Text, " setup monitoring for " + liEventCat.Value + " event log", 401);
             }
             catch (Exception ex)
             {
                 System.Diagnostics.Debug.Write(ex.Message + ex.StackTrace);
             }
         }
     }
 }
コード例 #2
0
    private void Monitor()
    {
        string sendPortName = string.Empty;

        // Iterate through the Gridview Rows property
        foreach (GridViewRow row in gridSendPort.Rows)
        {
            sendPortName = row.Cells[1].Text;
            // Access the CheckBox
            CheckBox cb = (CheckBox)row.FindControl("chkBoxSendPort");

            if (cb != null && cb.Checked)
            {
                try
                {
                    BCCMonitoringDataAccess da = new BCCMonitoringDataAccess();
                    da.CreateMonitoringEntry(ArtifactType.SendPort, sendPortName);
                    new ActivityHelper().RaiseAuditEvent(this, lblCaption.Text, " setup monitoring for send port " + sendPortName, 205);
                }
                catch (Exception e)
                {
                    System.Diagnostics.Debug.Write(e.Message + e.StackTrace);
                }
            }
        }
    }
コード例 #3
0
    private void Monitor()
    {
        string hostName = string.Empty;

        // Iterate through the Gridview Rows property
        foreach (GridViewRow row in gridHost.Rows)
        {
            hostName = row.Cells[2].Text;
            // Access the CheckBox
            CheckBox cb = (CheckBox)row.FindControl(CONTROL_NAME);

            if (cb != null && cb.Checked)
            {
                try
                {
                    BCCMonitoringDataAccess da = new BCCMonitoringDataAccess();
                    da.CreateMonitoringEntry(ArtifactType.HostInstance, hostName);
                    new ActivityHelper().RaiseAuditEvent(this, lblCaption.Text, " setup monitoring for host instance " + hostName, 202);
                }
                catch (Exception e)
                {
                    System.Diagnostics.Debug.Write(e.Message + e.StackTrace);
                }
            }
        }
    }
コード例 #4
0
    private void Monitor()
    {
        string machineName = System.Environment.MachineName;

        try
        {
            BCCMonitoringDataAccess da = new BCCMonitoringDataAccess();
            da.CreateMonitoringEntry(ArtifactType.ServiceInstance, machineName);
            new ActivityHelper().RaiseAuditEvent(this, lblCaption.Text, " setup monitoring for service instance on '" + machineName + "'", 204);
        }
        catch (Exception e)
        {
            System.Diagnostics.Debug.Write(e.Message + e.StackTrace);
        }
    }