Enumera las direcciones IP del servidor de verificación de tiempo de actividad
Organiza tus páginas con colecciones
Guarda y categoriza el contenido según tus preferencias.
En este documento, se muestra cómo obtener una lista de las direcciones IP que usan los servidores de verificación de tiempo de actividad y cómo puedes identificar el tráfico de los servidores de verificación de tiempo de actividad en tus registros.
Enumera direcciones IP
Cuando verificas un servicio que está detrás de un firewall, puedes configurar el firewall de tu servicio para que acepte tráfico del conjunto actual de direcciones IP que se usan para la verificación del tiempo de actividad. Para obtener estas direcciones IP, sigue las siguientes instrucciones:
Console
En la consola de Google Cloud , ve a la página Verificaciones de tiempo de actividad:
Si usas la barra de búsqueda para encontrar esta página, selecciona el resultado cuyo subtítulo es Monitoring.
En la barra de herramientas de la consola de Google Cloud , selecciona tu proyecto Google Cloud . Para las configuraciones de App Hub, selecciona el proyecto host de App Hub o el proyecto de administración de la carpeta habilitada para apps.
En el menú Verificaciones de tiempo de actividad, haz clic en get_appDescargar.
Se descarga un archivo uptime-source-ips.txt que contiene las direcciones IP.
// listIPs is an example of listing uptime check IPs.funclistIPs(wio.Writer)error{ctx:=context.Background()client,err:=monitoring.NewUptimeCheckClient(ctx)iferr!=nil{returnfmt.Errorf("NewUptimeCheckClient: %w",err)}deferclient.Close()req:=&monitoringpb.ListUptimeCheckIpsRequest{}it:=client.ListUptimeCheckIps(ctx,req)for{config,err:=it.Next()iferr==iterator.Done{break}iferr!=nil{returnfmt.Errorf("ListUptimeCheckIps: %w",err)}fmt.Fprintln(w,config)}fmt.Fprintln(w,"Done listing uptime check IPs")returnnil}
// Imports the Google Cloud client libraryconstmonitoring=require('@google-cloud/monitoring');// Creates a clientconstclient=newmonitoring.UptimeCheckServiceClient();// List uptime check IPsconst[uptimeCheckIps]=awaitclient.listUptimeCheckIps();uptimeCheckIps.forEach(uptimeCheckIp=>{console.log(uptimeCheckIp.region,uptimeCheckIp.location,uptimeCheckIp.ipAddress);});
deflist_uptime_check_ips()-> pagers.ListUptimeCheckIpsPager:"""Gets all locations and IP addresses used by uptime check servers Returns: A list of locations and IP addresses of uptime check servers. Iterating over this object will yield results and resolve additional pages automatically. """client=monitoring_v3.UptimeCheckServiceClient()ips=client.list_uptime_check_ips(request={})print(tabulate.tabulate([(ip.region,ip.location,ip.ip_address)foripinips],("region","location","ip_address"),))returnips
gem"google-cloud-monitoring"require"google/cloud/monitoring"deflist_ipsclient=Google::Cloud::Monitoring.uptime_check_service# Iterate over all results.client.list_uptime_check_ips({}).eachdo|element|puts"#{element.location}#{element.ip_address}"endend
Las verificaciones de tiempo de actividad pueden provenir de cualquiera de las direcciones IP, aunque solo se usa una dirección de cada ubicación geográfica para cada intervalo de tiempo. Las ubicaciones geográficas se enumeran en el panel de verificaciones de tiempo de actividad, como se muestra en la sección anterior. También puedes usar servicios gratuitos basados en la Web para identificar las ubicaciones registradas de las direcciones IP que descargaste.
Identifica el tráfico de la verificación de tiempo de actividad en los registros
Puedes identificar solicitudes de los servidores de verificación de tiempo de actividad mediante la siguiente información en los registros de solicitud de tu servicio:
ip: El campo ip contiene una de las direcciones que usan los servidores de verificación de tiempo de actividad. Para obtener información sobre cómo enumerar todas las direcciones IP, consulta Enumera direcciones IP.
User-Agent: El valor del encabezado User-Agent es siempre el siguiente:
[[["Fácil de comprender","easyToUnderstand","thumb-up"],["Resolvió mi problema","solvedMyProblem","thumb-up"],["Otro","otherUp","thumb-up"]],[["Difícil de entender","hardToUnderstand","thumb-down"],["Información o código de muestra incorrectos","incorrectInformationOrSampleCode","thumb-down"],["Faltan la información o los ejemplos que necesito","missingTheInformationSamplesINeed","thumb-down"],["Problema de traducción","translationIssue","thumb-down"],["Otro","otherDown","thumb-down"]],["Última actualización: 2025-09-05 (UTC)"],[],[],null,["This document shows you how to get a list of IP addresses used by uptime-check\nservers, and how you can identify traffic from the uptime-check servers in\nyour logs.\n\nList IP addresses\n\nWhen you're checking a service that is behind a firewall, you can configure your\nservice's firewall to accept traffic from the current set of IP addresses used\nfor uptime checking. To get these IP addresses, use the following instructions: \n\nConsole\n\n1. In the Google Cloud console, go to the **Uptime checks** page:\n\n [Go to **Uptime checks**](https://console.cloud.google.com/monitoring/uptime)\n\n \u003cbr /\u003e\n\n If you use the search bar to find this page, then select the result whose subheading is\n **Monitoring**.\n2. In the toolbar of the Google Cloud console, select your Google Cloud project. For [App Hub](/app-hub/docs/overview) configurations, select the App Hub host project or the app-enabled folder's management project.\n3. In the **Uptime checks** menu, click *get_app* **Download** . A file `uptime-source-ips.txt` is downloaded and contains the IP addresses.\n\ngcloud\n\nRun the [`gcloud monitoring uptime list-ips`](/sdk/gcloud/reference/monitoring/uptime/list-ips) command: \n\n gcloud monitoring uptime list-ips\n\nThe method returns the following information for each IP address:\n\n- The IP address, not a range, in IPv4 or IPv6 format.\n- The region: `USA`, `EUROPE`, `SOUTH_AMERICA`, or `ASIA_PACIFIC`.\n- The location within the region.\n\nAPI\n\nCall the\n[`uptimeCheckIps.list`](/monitoring/api/ref_v3/rest/v3/uptimeCheckIps/list)\nmethod of the Monitoring API.\n\nThe method returns the following information for each IP address:\n\n- The region: `USA`, `EUROPE`, `SOUTH_AMERICA`, or `ASIA_PACIFIC`.\n- A more specific location within the region.\n- The IP address, not a range, in IPv4 or IPv6 format.\n\nC#\n\n\nTo authenticate to Monitoring, set up Application Default Credentials.\nFor more information, see\n\n[Set up authentication for a local development environment](/docs/authentication/set-up-adc-local-dev-environment).\n\n public static object ListUptimeCheckIps()\n {\n var client = UptimeCheckServiceClient.Create();\n var ips = client.ListUptimeCheckIps(new ListUptimeCheckIpsRequest());\n foreach (UptimeCheckIp ip in ips)\n {\n Console.WriteLine(\"{0,20} {1}\", ip.IpAddress, ip.Location);\n }\n return 0;\n }\n\nJava\n\n\nTo authenticate to Monitoring, set up Application Default Credentials.\nFor more information, see\n\n[Set up authentication for a local development environment](/docs/authentication/set-up-adc-local-dev-environment).\n\n private static void listUptimeCheckIps() throws IOException {\n try (UptimeCheckServiceClient client = UptimeCheckServiceClient.create()) {\n ListUptimeCheckIpsPagedResponse response =\n client.listUptimeCheckIps(ListUptimeCheckIpsRequest.newBuilder().build());\n for (UptimeCheckIp config : response.iterateAll()) {\n System.out.println(config.getRegion() + \" - \" + config.getIpAddress());\n }\n } catch (Exception e) {\n usage(\"Exception listing uptime IPs: \" + e.toString());\n throw e;\n }\n }\n\nGo\n\n\nTo authenticate to Monitoring, set up Application Default Credentials.\nFor more information, see\n\n[Set up authentication for a local development environment](/docs/authentication/set-up-adc-local-dev-environment).\n\n\n // listIPs is an example of listing uptime check IPs.\n func listIPs(w io.Writer) error {\n \tctx := context.Background()\n \tclient, err := monitoring.NewUptimeCheckClient(ctx)\n \tif err != nil {\n \t\treturn fmt.Errorf(\"NewUptimeCheckClient: %w\", err)\n \t}\n \tdefer client.Close()\n \treq := &monitoringpb.ListUptimeCheckIpsRequest{}\n \tit := client.ListUptimeCheckIps(ctx, req)\n \tfor {\n \t\tconfig, err := it.Next()\n \t\tif err == iterator.Done {\n \t\t\tbreak\n \t\t}\n \t\tif err != nil {\n \t\t\treturn fmt.Errorf(\"ListUptimeCheckIps: %w\", err)\n \t\t}\n \t\tfmt.Fprintln(w, config)\n \t}\n \tfmt.Fprintln(w, \"Done listing uptime check IPs\")\n \treturn nil\n }\n\nNode.js\n\n\nTo authenticate to Monitoring, set up Application Default Credentials.\nFor more information, see\n\n[Set up authentication for a local development environment](/docs/authentication/set-up-adc-local-dev-environment).\n\n // Imports the Google Cloud client library\n const monitoring = require('https://cloud.google.com/nodejs/docs/reference/monitoring/latest/overview.html');\n\n // Creates a client\n const client = new monitoring.https://cloud.google.com/nodejs/docs/reference/monitoring/latest/overview.html();\n\n // List uptime check IPs\n const [uptimeCheckIps] = await client.listUptimeCheckIps();\n uptimeCheckIps.forEach(uptimeCheckIp =\u003e {\n console.log(\n uptimeCheckIp.region,\n uptimeCheckIp.location,\n uptimeCheckIp.ipAddress\n );\n });\n\nPHP\n\n\nTo authenticate to Monitoring, set up Application Default Credentials.\nFor more information, see\n\n[Set up authentication for a local development environment](/docs/authentication/set-up-adc-local-dev-environment).\n\n use Google\\Cloud\\Monitoring\\V3\\Client\\UptimeCheckServiceClient;\n use Google\\Cloud\\Monitoring\\V3\\ListUptimeCheckIpsRequest;\n\n /**\n * Example:\n * ```\n * list_uptime_check_ips($projectId);\n * ```\n */\n function list_uptime_check_ips(string $projectId): void\n {\n $uptimeCheckClient = new UptimeCheckServiceClient([\n 'projectId' =\u003e $projectId,\n ]);\n $listUptimeCheckIpsRequest = new ListUptimeCheckIpsRequest();\n\n $pages = $uptimeCheckClient-\u003elistUptimeCheckIps($listUptimeCheckIpsRequest);\n\n foreach ($pages-\u003eiteratePages() as $page) {\n $ips = $page-\u003egetResponseObject()-\u003egetUptimeCheckIps();\n foreach ($ips as $ip) {\n printf(\n 'ip address: %s, region: %s, location: %s' . PHP_EOL,\n $ip-\u003egetIpAddress(),\n $ip-\u003egetRegion(),\n $ip-\u003egetLocation()\n );\n }\n }\n }\n\nPython\n\n\nTo authenticate to Monitoring, set up Application Default Credentials.\nFor more information, see\n\n[Set up authentication for a local development environment](/docs/authentication/set-up-adc-local-dev-environment).\n\n def list_uptime_check_ips() -\u003e pagers.ListUptimeCheckIpsPager:\n \"\"\"Gets all locations and IP addresses used by uptime check servers\n\n Returns:\n A list of locations and IP addresses of uptime check servers.\n Iterating over this object will yield results and resolve additional pages automatically.\n \"\"\"\n client = monitoring_v3.UptimeCheckServiceClient()\n ips = client.list_uptime_check_ips(request={})\n print(\n tabulate.tabulate(\n [(ip.region, ip.location, ip.ip_address) for ip in ips],\n (\"region\", \"location\", \"ip_address\"),\n )\n )\n return ips\n\nRuby\n\n\nTo authenticate to Monitoring, set up Application Default Credentials.\nFor more information, see\n\n[Set up authentication for a local development environment](/docs/authentication/set-up-adc-local-dev-environment).\n\n gem \"google-cloud-monitoring\"\n require \"google/cloud/monitoring\"\n\n def list_ips\n client = Google::Cloud::https://cloud.google.com/ruby/docs/reference/google-cloud-monitoring/latest/Google-Cloud-Monitoring.html.https://cloud.google.com/ruby/docs/reference/google-cloud-monitoring/latest/Google-Cloud-Monitoring.html\n\n # Iterate over all results.\n client.list_uptime_check_ips({}).each do |element|\n puts \"#{element.location} #{element.https://cloud.google.com/ruby/docs/reference/google-cloud-monitoring-v3/latest/Google-Cloud-Monitoring-V3-UptimeCheckIp.html}\"\n end\n end\n\n\u003cbr /\u003e\n\nUptime checks can come from any of the IP addresses, but only one address from\neach geographic location is used for each time interval. The geographic\nlocations are listed in the uptime checks dashboard, as shown in the previous\nsection. You can also use free, web-based services to identify the registered\nlocations of the IP addresses you downloaded.\n\nIdentify uptime-check traffic in logs\n\nYou can identify requests from the uptime-check servers by the following\ninformation in your service's [request logs](/logging/docs/view/logs-explorer-interface):\n\n- **ip** : The `ip` field contains one of the addresses used by the uptime-check servers. For information about how to list all IP addresses, see [List IP addresses](#get-ips).\n- **User-Agent** : The `User-Agent` header value is always the following:\n\n GoogleStackdriverMonitoring-UptimeChecks(https://cloud.google.com/monitoring)\n\n Specifying a `User-Agent` custom header results in a form validation error\n and prevents the check configuration from being saved.\n\nWhat's next\n\n- [Manage uptime checks](/monitoring/uptime-checks/manage)\n- [Create alerting policies for uptime checks](/monitoring/uptime-checks/uptime-alerting-policies)\n- [Chart uptime-check metrics](/monitoring/charts/uptime-charts)"]]