sacloud/sacloud-cpu-usageのルータ+スイッチ版
スイッチ+ルータの使用状況をさくらのクラウドAPI経由で取得しMax/Min/Averageを算出します。
Usage:
sacloud-router-usage [OPTIONS]
Application Options:
--time= Get average traffic for a specified amount of time (default: 3)
--item=[in|out] Item name (default: in)
--prefix= prefix for router names. prefix accepts more than one.
--zone= zone name
--percentile-set= percentiles to dispaly (default: 99,95,90,75)
-v, --version Show version
--query= jq style query to result and display
--env-from= load environment values from this file
Help Options:
-h, --help Show this help message
% ./sacloud-router-usage --prefix example- --item out --zone tk1b
2022/10/25 12:02:06 example-r1 zone:tk1b traffic:5.305794 time:2022-10-25 11:50:00 +0900 JST
2022/10/25 12:02:06 example-r1 zone:tk1b traffic:5.305794 time:2022-10-25 11:55:00 +0900 JST
2022/10/25 12:02:06 example-r1 zone:tk1b traffic:0.000000 time:2022-10-25 12:00:00 +0900 JST
2022/10/25 12:02:06 example-r1 average_traffic:3.537196
{"75pt":3.537196,"90pt":3.537196,"95pt":3.537196,"99pt":3.537196,"avg":3.537196,"max":3.537196,"min":3.537196,"routers":[{"avg":3.537196,"monitors":[{"time":"2022-10-25 11:50:00 +0900 JST","traffic":5.305794},{"time":"2022-10-25 11:55:00 +0900 JST","traffic":5.305794},{"time":"2022-10-25 12:00:00 +0900 JST","traffic":0}],"name":"example-r1","zone":"tk1b"}]}
sacloud-router-usage
Copyright (C) 2022 The sacloud/sacloud-router-usage authors.
This project is published under MIT.