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

3.12 Get Monitoring Check Status

By the method GetMonitoringServicesChecks you can retrieve the list of service about a specific monitoring check.

Parameters
getMonitoringServiceEntity
Type: GetMonitoringServiceEntity
contains all the attributes of service.
/// IWsMonitoring.GetMonitoringServicesChecksStatus Method (c# .NET)
public static string GetMonitoringServicesChecksStatus(WsMonitoringClient client,
        int monitoringServiceID)
{
    //specify the account login details 
    client.ClientCredentials.UserName.UserName = "ARU-0000";
    client.ClientCredentials.UserName.Password = "0123456789";

    StringBuilder stringBuilder = new StringBuilder();

    try
    {
        GetMonitoringServiceEntity getMonitoringServiceEntity = 
            new GetMonitoringServiceEntity();
        getMonitoringServiceEntity.MonitoringServiceID = monitoringServiceID;

        // call method GetMonitoringServicesChecks 
        // obtaining a WsResultOfArrayOfMonitoringServiceDetailsEntity item
        WsResultOfArrayOfMonitoringServiceDetailsEntity result =
                client.GetMonitoringServicesChecks(getMonitoringServiceEntity);

        //if the call is Success print values
        if (result.Success)
        {
            MonitoringServiceDetailsEntity[] items = result.Value;
                    
            foreach (MonitoringServiceDetailsEntity item in items )
            {
                stringBuilder.Append("\nMonitoringServiceID: ");
                stringBuilder.Append(item.MonitoringServiceID);
                stringBuilder.Append("\nMonitoringService CompanyID: ");
                stringBuilder.Append(item.CompanyID);
                stringBuilder.Append("\nMonitoringService CreationDate: ");
                stringBuilder.Append(item.CreationDate);
                stringBuilder.Append("\nMonitoringService DataCenterID: ");
                stringBuilder.Append(item.DataCenterID);
                stringBuilder.Append("\nMonitoringService DeletionDate: ");
                stringBuilder.Append(item.DeletionDate);
                stringBuilder.Append("\nMonitoringService LastUpdateDate: ");
                stringBuilder.Append(item.LastUpdateDate);
                stringBuilder.Append("\nMonitoringService MaxHourNotification : ");
                stringBuilder.Append(item.MaxHourNotification);
                stringBuilder.Append("\nMonitoringService Name: ");
                stringBuilder.Append(item.Name);
                stringBuilder.Append("\nMonitoringService ProductID: ");
                stringBuilder.Append(item.ProductID);
                stringBuilder.Append("\nMonitoringService ResourceID: ");
                stringBuilder.Append(item.ResourceID);

                foreach (MonitoringCheckDetailsEntity entity in item.MonitoringCheckDetails)
                {
                    stringBuilder.Append("\nMonitoringCheckDetails Id: ");
                    stringBuilder.Append(entity.MonitoringCheckID);
                    stringBuilder.Append("\nName: ");
                    stringBuilder.Append(entity.Name);
                    stringBuilder.Append("\nMonitoringCheckDetails Status: ");
                    stringBuilder.Append(entity.MonitoringStatus);
                }

                foreach (MonitoringCheckEntity entity in item.MonitoringChecks )
                {
                    stringBuilder.Append("\nMonitoringCheck Name: ");
                    stringBuilder.Append(entity.Name);
                    stringBuilder.Append("\nMonitoringCheck Id: ");
                    stringBuilder.Append(entity.MonitoringCheckID);
                    stringBuilder.Append("\nMonitoringCheck status: ");
                    stringBuilder.Append(entity.MonitoringStatus);
                }
            }
        }
        else
        {
            throw new ApplicationException(result.ResultMessage);
        }
    }
    catch (Exception ex)
    {
        // re-run the error
        throw new ApplicationException(ex.Message);
    }

    return stringBuilder.ToString();
}
/// IWsMonitoring.GetMonitoringServicesChecksStatus Method (Java)
public static String GetMonitoringServicesChecksStatus(IWsMonitoring client,
        Integer monitoringServiceID)
{
    //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
    {
        GetMonitoringServiceEntity getMonitoringServiceEntity =
                new GetMonitoringServiceEntity();
        getMonitoringServiceEntity.setMonitoringServiceID(monitoringServiceID);

        // call method GetMonitoringServicesChecks 
        // obtaining a WsResultOfArrayOfMonitoringServiceDetailsEntity item
        WsResultOfArrayOfMonitoringServiceDetailsEntity result =
                client.getMonitoringServicesChecks(getMonitoringServiceEntity);

        //if the call is Success print values
        if (result.isSuccess())
        {
            ArrayOfMonitoringServiceDetailsEntity items = result.getValue();
            List monitoringServiceDetailsEntity =
                    items.getMonitoringServiceDetailsEntity();

            for (Iterator it =
                    monitoringServiceDetailsEntity.iterator(); it.hasNext();)
            {
                MonitoringServiceDetailsEntity item = it.next();
                stringBuilder.append("\nMonitoringServiceID: ");
                stringBuilder.append(item.getMonitoringServiceID());
                ArrayOfMonitoringCheckEntity entity = item.getMonitoringChecks();
                List myList = entity.getMonitoringCheckEntity();
                for (Iterator it2 =
                        myList.iterator(); it2.hasNext();)
                {
                    MonitoringCheckEntity item2 = it2.next();
                    Integer monitoringCheckId = item2.getMonitoringCheckId();
                    MonitoringServiceStatus monitoringServiceStatus = item2.getMonitoringStatus();
                    stringBuilder.append("\nMonitoringCheckID ");
                    stringBuilder.append(monitoringCheckId );
                    stringBuilder.append("\nMonitoringCheckStatus ");
                    stringBuilder.append(monitoringServiceStatus);
                
                }
            }
        }
        else
        {
            throw new Exception(result.getResultMessage().getValue());
        }
    }
    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