Server-IP-Adressen für die Verfügbarkeitsdiagnose auflisten
Mit Sammlungen den Überblick behalten
Sie können Inhalte basierend auf Ihren Einstellungen speichern und kategorisieren.
In diesem Dokument erfahren Sie, wie Sie eine Liste der IP-Adressen abrufen, die von Servern für die Verfügbarkeitsdiagnose verwendet werden, und wie Sie Traffic von den Servern für die Verfügbarkeitsdiagnose in Ihren Logs identifizieren können.
IP-Adressen auflisten
Wenn Sie einen Dienst prüfen, der sich hinter einer Firewall befindet, können Sie die Firewall des Dienstes so konfigurieren, dass sie Traffic von den aktuell für die Verfügbarkeitsdiagnose verwendeten IP-Adressen akzeptiert. So rufen Sie diese IP-Adressen ab:
Console
Rufen Sie in der Google Cloud Console die Seite Uptime-Prüfungen auf:
Wenn Sie diese Seite über die Suchleiste suchen, wählen Sie das Ergebnis aus, dessen Zwischenüberschrift Monitoring ist.
Wählen Sie in der Symbolleiste der Google Cloud -Console Ihr Google Cloud -Projekt aus. Wählen Sie für App Hub-Konfigurationen das App Hub-Hostprojekt oder das Verwaltungsprojekt des für Apps aktivierten Ordners aus.
Klicken Sie im Menü Verfügbarkeitsdiagnosen auf get_appHerunterladen.
Die Datei uptime-source-ips.txt wird heruntergeladen und enthält die IP-Adressen.
// 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
Verfügbarkeitsdiagnosen können von jeder der IP-Adressen stammen. Pro Zeitintervall wird jedoch nur eine einzige Adresse von jedem geografischen Standort verwendet. Die Standorte sind im Dashboard zur Verfügbarkeitsdiagnose aufgeführt, wie im vorherigen Abschnitt dargestellt. Sie können die registrierten Standorte der heruntergeladenen IP-Adressen auch mithilfe von kostenlosen, webbasierten Diensten identifizieren.
Verfügbarkeitsdiagnose-Traffic in Logs identifizieren
Folgen Sie zum Identifizieren der Anfragen von den Verfügbarkeitsdiagnose-Servern den Angaben in den Anfrage-Logs des Dienstes:
ip: Das Feld ip enthält eine der von den Verfügbarkeitsdiagnose-Servern verwendeten Adressen. Informationen zum Auflisten aller IP-Adressen finden Sie unter IP-Adressen auflisten.
User-Agent: Der Header User-Agent hat immer den folgenden Wert:
Wenn Sie für User-Agent einen benutzerdefinierten Header angeben, wird ein Formularvalidierungsfehler ausgegeben und die Diagnosekonfiguration kann nicht gespeichert werden.
[[["Leicht verständlich","easyToUnderstand","thumb-up"],["Mein Problem wurde gelöst","solvedMyProblem","thumb-up"],["Sonstiges","otherUp","thumb-up"]],[["Schwer verständlich","hardToUnderstand","thumb-down"],["Informationen oder Beispielcode falsch","incorrectInformationOrSampleCode","thumb-down"],["Benötigte Informationen/Beispiele nicht gefunden","missingTheInformationSamplesINeed","thumb-down"],["Problem mit der Übersetzung","translationIssue","thumb-down"],["Sonstiges","otherDown","thumb-down"]],["Zuletzt aktualisiert: 2025-08-28 (UTC)."],[],[],null,["# List uptime-check server IP addresses\n\nThis 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-----------------\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\n### Console\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\n### gcloud\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\n### API\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\n### C#\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\n### Java\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\n### Go\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\n### Node.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\n### PHP\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\n### Python\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\n### Ruby\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-dashboard-v1/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-------------------------------------\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\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)"]]