Monitoring > 3 - Management Monitoring Services Checks > Get Monitoring Check Events

3.11 Get Monitoring Check Events

By the method GetMonitoringCheckEvents you can retrieve the list of events about a specific monitoring check.

Parameters
getMonitoringCheckEventsEntity
Type: GetMonitoringCheckEventsEntity
contains all the attributes of an event.
/// WsMonitoring.GetMonitoringCheckEvents Method (c# .NET)
public static string GetMonitoringCheckEvents(WsMonitoringClient client,
   GetMonitoringCheckEventsEntity getMonitoringCheckEventsEntity)
{
    //specify the account login details 
    client.ClientCredentials.UserName.UserName = "ARU-0000";
    client.ClientCredentials.UserName.Password = "0123456789";

    StringBuilder stringBuilder = new StringBuilder();

    try
    {
 // call method GetMonitoringCheckEvents 
 // obtaining a WsResultOfArrayOfMonitoringCheckEventsEntity item
 WsResultOfArrayOfMonitoringCheckEventsEntity result =
     client.GetMonitoringCheckEvents(getMonitoringCheckEventsEntity);

 //if the call is Success print value
 if (result.Success)
 {
     stringBuilder.Append("Operation ends successfully\n");

     // get Value returned from server
     MonitoringCheckEventsEntity[] items = result.Value;

     // for each item print the information
     foreach (MonitoringCheckEventsEntity item in items)
     {
  stringBuilder.Append("\nMonitoringCheckID: ");
  stringBuilder.Append(item.MonitoringCheckID);
  stringBuilder.Append("\nMonitoringCheckID: ");
  stringBuilder.Append(item.MonitoringCheckID);
     }
 }
 else
 {
     throw new ApplicationException(result.ResultMessage);
 }
    }
    catch (Exception ex)
    {
 // re-run the error
 throw new ApplicationException(ex.Message);
    }

    return stringBuilder.ToString();
}
/// WsMonitoring.GetMonitoringCheckEvents Method (JAVA)
public static String GetMonitoringCheckEvents(IWsMonitoring client, 
    GetMonitoringCheckEventsEntity getMonitoringCheckEventsEntity) 
{
    //specify the account login details 
    ((BindingProvider) client).getRequestContext()
 .put(BindingProvider.USERNAME_PROPERTY, "ARU-0000");
    ((BindingProvider) client).getRequestContext()
 .put(BindingProvider.PASSWORD_PROPERTY, "0123456789");

    StringBuilder stringBuilder = new StringBuilder();

    try 
    {
        // call method GetMonitoringCheckEvents 
        // obtaining a WsResultOfArrayOfMonitoringCheckEventsEntity item
        WsResultOfArrayOfMonitoringCheckEventsEntity result = 
     client.getMonitoringCheckEvents(getMonitoringCheckEventsEntity);

        //if the call is Success print values
        if (result.isSuccess()) 
 {
     ArrayOfMonitoringCheckEventsEntity items = result.getValue(); 
     List monitoringCheckEventsEntity = 
  items.getMonitoringCheckEventsEntity();
 
     for (Iterator it = 
  monitoringCheckEventsEntity.iterator(); it.hasNext();)
     {
         MonitoringCheckEventsEntity item = it.next();
         stringBuilder.append("\nMonitoringCheckID: ");
         stringBuilder.append(item.getMonitoringCheckID());
         stringBuilder.append("\nMonitoringCheckID: ");
         stringBuilder.append(item.getMonitoringCheckID());
     }
        } 
 else 
 {
     throw new Exception(result.getResultMessage());
        }
    } 
    catch (Exception ex) 
    {
        System.out.println(ex);
    }

return stringBuilder.toString();
}
Version
API: v2.8 URL:https://api.services.cloud.it/wsMonitoring/v2.8/wsMonitoring.svc?wsdl

See also