# 外部監視

## 概要

RADIUSaaS インスタンスの監視エンドポイントを使用すると、サードパーティ製の監視ソリューションで次のタスクを実行できます:

* RadSec エンドポイントの稼働時間を監視します。
* RADIUS プロキシの稼働時間を監視します。
* RADIUS サーバー証明書およびそれを発行した CA の有効期限を監視します。

監視ソリューションで可能であれば、これらの監視を基に集計とメトリクスを作成し、自動アラートをトリガーできます。&#x20;

## API スキーマの定義

以下を参照してください: [API ドキュメント](/ja/sono/rest-api.md#api-reference) RADIUSaaS 管理ポータル内の、 `/status` エンドポイントのスキーマに関する詳細情報。

## API の例

{% hint style="info" %}
なお、サードパーティ製の監視ソリューションに対するサポートは提供できません。本記事の範囲外となるため、必要な知識はご自身でご用意ください。&#x20;
{% endhint %}

{% stepper %}
{% step %}

### 以下の手順に従ってアクセス トークンを作成します [こちら](/ja/ptaru/settings/permissions.md#access-tokens).

{% endstep %}

{% step %}

### データの取得

API エンドポイントからデータを取得するには、前述のアクセス トークンを使用して要求を認証します:

{% tabs %}
{% tab title="PowerShell" %}

1. **アクセス トークンを保存する**

参照しやすいように、アクセス トークンを PowerShell 変数に保存します。次を置き換えてください: `your_access_token` 実際のトークンに。

```powershell
$accessToken = "your_access_token"
```

2. **API リクエストを実行する**

PowerShell の `Invoke-RestMethod` を使用して、目的の API に要求を送信します。要求ヘッダーにアクセス トークンを含めるようにしてください。

```powershell
$url = "https://contoso.radius-as-a-service.com/api/status"
$headers = @{
    Authorization = "Bearer $accessToken"
}
$response = Invoke-RestMethod -Uri $url -Headers $headers -Method Get
```

{% endtab %}

{% tab title="cURL" %}

```
curl -i https://contoso.radius-as-a-service.com/api/status \ -H "Authorization: Bearer [your_access_token]"
```

{% endtab %}

{% tab title="Python" %}

```
import requests

url = "https://contoso.radius-as-a-service.com/api/status"
headers = {
    "Authorization": "Bearer your_access_token"
}

response = requests.get(url, headers=headers)

print(response.status_code)
print(response.text)
```

{% endtab %}
{% endtabs %}
{% endstep %}

{% step %}

### 必要に応じてデータを処理します

#### 例 1 - RadSec サーバーに関する情報を表示します:

```
$response.radsecservers

cluster_name                     : eu1
ip                               : 20.113.8.151
name                             : radius-server-contoso-main
radius-server-contoso-main-state : True
state                            : True
```

#### 例 2 - RADIUS プロキシに関する情報を表示します:

```
$response.proxies

ip                                       : 142.93.161.44
location                                 : Europe (Frankfurt)
name                                     : radius-proxy-contoso-142.93.161.44
radius-proxy-contoso-142.93.161.44-state : True
state                                    : True

ip                                     : 209.38.81.0
location                               : Australia (Sydney)
name                                   : radius-proxy-contoso-209.38.81.0
radius-proxy-contoso-209.38.81.0-state : True
state                                  : True
```

#### 例 3 - 証明書情報を表示します:

```
$response.certificates | Format-List

contoso-certificate--Proxycertificate-state : True
name                                        : contoso-certificate--Proxycertificate
state                                       : True
validity_days_left                          : 2570

contoso-certificate-Customer-CA-state : True
name                                  : contoso-certificate-Customer-CA
state                                 : True
validity_days_left                    : 6900
```

{% hint style="info" %}
次の点にご注意ください: **certificates** は **10 時間ごとにチェックされ、** および **data** は **60 秒間キャッシュされます**。そのため、期限切れの証明書を更新した後、ステータスが更新されるまで数時間かかる場合があります。
{% endhint %}
{% endstep %}
{% endstepper %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.radiusaas.com/ja/sono/rest-api/wai-bu-jian-shi.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
