> ## Documentation Index
> Fetch the complete documentation index at: https://docs.megaport.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Monitoring NAT Gateway

> This help topic describes how to view Megaport NAT Gateway service logs and usage reports in the Megaport Portal.

export const Anchor = ({name}) => {
  const errorPrefix = '\x1b[31;1;4mERROR\x1b[0m: Anchor -';
  if (name === undefined || name === null || name === 'undefined') {
    console.error(`${errorPrefix} \`name\` must have a value — rendering an empty string instead`);
    return <></>;
  }
  const raw = typeof name === 'string' ? name : JSON.stringify(name);
  const id = raw.replace(/\s+/g, '-').replace(/[^A-Za-z0-9_-]/g, '').replace(/-+/g, '-').replace(/^-+|-+$/g, '');
  if (!id) {
    console.error(`${errorPrefix} \`name\` "${name}" sanitizes to an empty id — rendering an empty string instead`);
    return <></>;
  }
  return <a style={{
    scrollMarginTop: 'var(--scroll-mt)'
  }} id={id}></a>;
};

export const Link = ({href, children}) => {
  const errorPrefix = '\x1b[31;1;4mERROR\x1b[0m: Link -';
  if (typeof href !== 'string') {
    href = String(href);
  }
  if (!href || href === 'undefined') {
    console.error(`${errorPrefix} the \`href\` property is required — rendering an empty string instead`);
    return <></>;
  }
  if (href.includes('{') || href.toUpperCase().includes('%7B')) {
    console.error(`${errorPrefix} could not resolve a variable in href "${href}" — rendering an empty string instead`);
    return <></>;
  }
  const isExternal = (/^https?:\/\//).test(href);
  return <a href={href} className="link" target={isExternal ? '_blank' : undefined} rel={isExternal ? 'noreferrer' : undefined}>
      {children ?? href}
      {isExternal && <span className="sr-only"> (opens in a new tab)</span>}
    </a>;
};

export const Image = ({src, alt = '', caption, width, height, shadow}) => {
  const errorPrefix = '\x1b[31;1;4mERROR\x1b[0m: Image -';
  if (typeof src !== 'string') {
    src = String(src);
  }
  if (!src || src === 'undefined') {
    console.error(`${errorPrefix} \`src\` is required — rendering an empty string instead`);
    return <></>;
  }
  const img = <img className={['mega-image-style', shadow ? 'shadow' : ''].join(' ')} src={src} alt={alt} width={width} height={height} style={{
    display: 'block'
  }} />;
  return caption ? <figure>
      {img}
      <figcaption style={{
    textAlign: 'center',
    width
  }}>{caption}</figcaption>
    </figure> : img;
};

This topic describes how to view service logs and usage reports for a Megaport NAT Gateway (NAT Gateway) in the Megaport Portal. This information helps you troubleshoot issues and monitor the status, activity, and performance of your NAT Gateways.

Megaport offers a public API that you can use to access the services available available through the service logs and usage reports. For more information, see [Megaport API Overview](/api).

<Anchor name="service-logs" />

## Viewing service logs

Viewing the service logs is a simple way to monitor the activity and performance of your NAT Gateways. Megaport starts reporting metrics as soon as the NAT Gateway is live in the Megaport Portal.

You can also monitor the VXCs and BGP peering on NAT Gateway services, such as BGP session down, BGP authentication failure, and so on.

**To view service logs for a NAT Gateway**

1. Log in to the <Link href="https://portal.megaport.com">Megaport Portal</Link> and choose **Services**.
2. Click the gear icon next to the NAT Gateway.
   <Image src="/images/nat/button-nat-gateway-details.png" alt="The NAT Gateway Details button" shadow={true} width={250} />
3. On the NAT Gateway Details page, click **Logs**.\
   The 100 most recent events are displayed, including the time zone of the log entries. The standard time zone formatting for NAT Gateway log messages is UTC.
4. To view VXC and BGP events, click the gear icon next to the VXC and click **Logs** on the Connection Details page.
   <Image src="/images/monitoring/nat-service-logs.png" alt="Service Logs" shadow={true} width={900} />
   A green check mark indicates that the service is running as expected, or shows a non-critical event such as a speed change. A yellow warning icon indicates that there is a potential issue with the service.

<Note>
  Company Admins see an additional **Activity Logs** tab next to Service Logs. The Activity Logs tab displays user activity for the NAT Gateway, such as configuration changes and other administrative actions. For more information about activity logs, see [Viewing Activity Logs](/portal-admin/activity-logs).
</Note>

<Tip>
  For more information about investigating NAT Gateway issues, see [Troubleshooting a NAT Gateway Routing Issue](/troubleshooting/nat/routing).
</Tip>

<Anchor name="usage" />

## Viewing usage details

The Service Graph provides helpful information such as inbound/outbound traffic and packet rates. The graph is useful for comparing monthly usage on a NAT Gateway. You can export the NAT Gateway usage data in comma-separated values (CSV) format for analysis in spreadsheets and databases.

You can access a Service Graph from these locations:

* From the **Services** page, click the gear icon, then select **Telemetry**.\
  You will see Service Graphs for the selected service only.

* From **Monitoring & Diagnostics** > **Service Telemetry**.\
  This page shows usage for multiple services. You can filter the information for a specified date range and select a metric to display. For more information, see [Monitoring Services using the Service Telemetry Page](/monitoring/service-telemetry).

<Note>
  The Service Graph is updated every 5 minutes.
</Note>

**To view usage details for a NAT Gateway on the Services page**

1. Log in to the <Link href="https://portal.megaport.com">Megaport Portal</Link> and choose **Services**.

2. Click the gear icon next to the NAT Gateway.
   <Image src="/images/nat/button-nat-gateway-details.png" alt="The NAT Gateway Details button" shadow={true} width={250} />

3. On the NAT Gateway Details page, click **Telemetry**.\
   The Service Graph page appears, showing all available metric graphs.

   <Image src="/images/monitoring/mcr-usage-traffic.png" alt="Service Graph for a NAT Gateway" shadow={true} width={1000} />

   <Note>
     The controls above the graphs apply to all graphs at once. When you change a control, every graph updates together.
   </Note>

4. In the **Date Range** field, enter the range of dates for which to view usage details.\
   Select from the following options:

   * Last hour
   * Last 12 hours
   * Last 24 hours
   * Last week
   * Last month
   * Last 3 months
   * Last 6 months
   * Last 12 months
   * Custom - Enter a custom date range using the date picker.

   The default time range is the last 24 hours.

5. In the **Resolution** control, select the resolution for the graph data: **5 min**, **Daily**, or **Monthly**.

   <Note>
     The available resolutions depend on the selected date range:

     * **5 min** is available only for ranges of 3 months or less.
     * **Daily** is available for any range.
     * **Monthly** is available only for ranges greater than 3 months.

     Resolutions that the selected date range does not support are grayed out and unavailable, with a tooltip explaining why.
   </Note>

6. If you selected **Daily** or **Monthly** resolution, select one or more values in the **Aggregate** control to plot on the graph: **Average**, **Peak**, **95th percentile**, or **Minimum**. The **Aggregate** control is not shown for **5 min** resolution.

7. You can customize the graphs by selecting or clearing the **In pps**, **Out pps**, **In Mbps**, **Out Mbps**, and **Configured speed Mbps** check boxes to show or hide data.

   Use the mouse to hover over a specific data point to see the values and exact timestamp.

   | **Metric** | **Description**                                                                                                                                                                                     |
   | ---------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
   | Packets    | In pps - Incoming packet rate to the NAT Gateway, measured in packets per second.<br />Out pps - Outbound packet rate from the NAT Gateway, measured in packets per second.                         |
   | Traffic    | In Mbps - Number of inbound Megabits per second.<br />Out Mbps - Number of outbound Megabits per second.<br /> Configured speed Mbps - Configured speed of the NAT Gateway, in Megabits per second. |

8. Click **Export CSV** to download the NAT Gateway usage data for all metrics in a single CSV file.\
   You can use the CSV file to import the data into spreadsheets and databases. You can open the CSV file in any text editor. The exported data uses the selected resolution.

9. Click **UTC** or your local time zone to change the time zone.

For more information about usage information and service logs, see [Monitoring Ports, VXCs, Megaport Internet, and IXs](/monitoring/port-vxc-monitoring). For billing information for NAT Gateway VXCs, see [VXC, Megaport Internet, and IX Billing](/finance/billing-details).

## Helpful references

* [IX Telemetry](/ix/ix-telemetry)
* [Monitoring MCR](/monitoring/mcr-monitoring)
* [Monitoring MVE](/monitoring/mve-monitoring)
* [Monitoring Ports, VXCs, Megaport Internet, and IXs](/monitoring/port-vxc-monitoring)
* [Monitoring Service Activity in the Megaport Portal](/monitoring)
* [Monitoring Services for Status](/monitoring/service-status)
* [Monitoring Services using the Service Telemetry Page](/monitoring/service-telemetry)
* [Viewing Activity Logs](/portal-admin/activity-logs)
