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

3.10 Get Monitoring Check Notifications

By the method GetMonitoringCheckNotifications you can retrieve the list of notifications about a specific monitoring check.

Parameters
getMonitoringCheckNotificationsEntity
Type: GetMonitoringCheckNotificationsEntity
contains all the attributes of a notification.
/// WsMonitoring.GetMonitoringCheckNotifications Method (c# .NET)
public static string GetMonitoringCheckNotifications(WsMonitoringClient client,
   GetMonitoringCheckNotificationsEntity getMonitoringCheckNotificationsEntity)
{
    //specify the account login details
    client.ClientCredentials.UserName.UserName = "ARU-0000";
    client.ClientCredentials.UserName.Password = "0123456789";

    StringBuilder stringBuilder = new StringBuilder();

    try
    {
 // call method GetMonitoringCheckNotifications
 // obtaining a WsResultOfMonitoringCheckNotificationsEntity item
 WsResultOfMonitoringCheckNotificationsEntity result =
     client.GetMonitoringCheckNotifications
                (getMonitoringCheckNotificationsEntity);

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

     // get Value returned from server
     MonitoringCheckNotificationsEntity item= result.Value;

     stringBuilder.Append("\nmonitoringCheckId: ");
     stringBuilder.Append(item.MonitoringCheckID);
     stringBuilder.Append("\nmonitoringServiceId: ");
     stringBuilder.Append(item.MonitoringServiceID);

     foreach (CheckNotificationEntity item2 in item.CheckEvents)
     {
  stringBuilder.Append("\nNotificationEventType: ");
  stringBuilder.Append(item2.NotificationEventType);
  stringBuilder.Append("\nNotificationType: ");
  stringBuilder.Append(item2.NotificationType);
  stringBuilder.Append("\nProductID: ");
  stringBuilder.Append(item2.ProductID);
     }                   
 }
 else
 {
     throw new ApplicationException(result.ResultMessage);
 }
    }
    catch (Exception ex)
    {
 // re-run the error
 throw new ApplicationException(ex.Message);
    }

    return stringBuilder.ToString();
}
/// WsMonitoring.GetMonitoringCheckNotifications Method (JAVA)
public static String GetMonitoringCheckNotifications(IWsMonitoring client, 
    GetMonitoringCheckNotificationsEntity getMonitoringCheckNotificationsEntity) 
{
    //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 GetMonitoringCheckNotifications 
    // obtaining a WsResultOfMonitoringCheckNotificationsEntity item
        WsResultOfMonitoringCheckNotificationsEntity result = 
     client.getMonitoringCheckNotifications
     (getMonitoringCheckNotificationsEntity);

        //if the call is Success print values
        if (result.isSuccess()) 
        {
     MonitoringCheckNotificationsEntity items = result.getValue(); 
     ArrayOfCheckNotificationEntity arrayOfCheckNotificationsEntity = 
  items.getCheckEvents();
     List checkNotificationsEntityList = 
  arrayOfCheckNotificationsEntity.getCheckNotificationEntity();
     Integer monitoringCheckId = items.getMonitoringCheckID();
     Integer monitoringServiceId = items.getMonitoringServiceID();
     stringBuilder.append("\nmonitoringCheckId: ");
     stringBuilder.append(monitoringCheckId);
     stringBuilder.append("\nmonitoringServiceId: ");
     stringBuilder.append(monitoringServiceId);                
     for (Iterator it = 
  checkNotificationsEntityList.iterator(); it.hasNext();)
     {
         CheckNotificationEntity item = it.next();
         stringBuilder.append("\nNotificationEventType: ");
         stringBuilder.append(item.getNotificationEventType());
         stringBuilder.append("\nNotificationType: ");
         stringBuilder.append(item.getNotificationType());
         stringBuilder.append("\nProductID: ");
         stringBuilder.append(item.getProductID());
     }
        } 
 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