F5
F5 は、アプリケーションを高速、安全、かつ利用可能にするためのネットワーク機器とソフトウェアを提供する企業
iControlRest
Section titled “iControlRest”- 定義がない場合
$ curl -sk -u admin:admin -X GET 'https://f5/mgmt/tm/gtm/wideip/a/~Common~test.g.hoge.co.jp/stats' | jq .{ "code": 404, "message": "01020036:3: The requested WideIp (A /Common/test.g.hoge.co.jp) was not found.", "errorStack": [], "apiError": 3}- a 全部
$ curl -sk -u admin:admin -X GET 'https://f5/mgmt/tm/gtm/wideip/a' | jq .{ "kind": "tm:gtm:wideip:a:acollectionstate", "selfLink": "https://localhost/mgmt/tm/gtm/wideip/a?ver=13.1.3.4", "items": [ { "kind": "tm:gtm:wideip:a:astate", "name": "gslb-automation.gz.hoge.co.jp", "partition": "Common", "fullPath": "/Common/gslb-automation.gz.hoge.co.jp", "generation": 388, "selfLink": "https://localhost/mgmt/tm/gtm/wideip/a/~Common~gslb-automation.gz.hoge.co.jp?ver=13.1.3.4", "enabled": true, "failureRcode": "noerror", "failureRcodeResponse": "disabled", "failureRcodeTtl": 0, "lastResortPool": "", "minimalResponse": "enabled", "persistCidrIpv4": 32, "persistCidrIpv6": 128, "persistence": "disabled", "poolLbMode": "round-robin", "ttlPersistence": 3600, "pools": [ { "name": "gslb-automation.gz.hoge.co.jp", "partition": "Common", "order": 0, "ratio": 1, "nameReference": { "link": "https://localhost/mgmt/tm/gtm/pool/a/~Common~gslb-automation.gz.hoge.co.jp?ver=13.1.3.4" } } ] }, ...- ?expandSubcollections=true をつけると poll member もわかる便利
$ curl -sk -u admin:admin -X GET 'https://f5/mgmt/tm/gtm/pool/a/~Common~test.gz.hoge.co.jp?expandSubcollections=true' | jq .{ "kind": "tm:gtm:pool:a:astate", "name": "lb-test.gz.hoge.co.jp", "partition": "Common", "fullPath": "/Common/lb-test.gz.hoge.co.jp", "generation": 1, "selfLink": "https://localhost/mgmt/tm/gtm/pool/a/~Common~lb-test.gz.hoge.co.jp?expandSubcollections=true&ver=13.1.3.4", "alternateMode": "ratio", "dynamicRatio": "disabled", "enabled": true, "fallbackIp": "any", "fallbackMode": "none", "limitMaxBps": 0, "limitMaxBpsStatus": "disabled", "limitMaxConnections": 0, "limitMaxConnectionsStatus": "disabled", "limitMaxPps": 0, "limitMaxPpsStatus": "disabled", "loadBalancingMode": "round-robin", "manualResume": "disabled", "maxAnswersReturned": 16, "monitor": "default", "qosHitRatio": 5, "qosHops": 0, "qosKilobytesSecond": 3, "qosLcs": 30, "qosPacketRate": 1, "qosRtt": 50, "qosTopology": 0, "qosVsCapacity": 0, "qosVsScore": 0, "ttl": 60, "verifyMemberAvailability": "enabled", "membersReference": { "link": "https://localhost/mgmt/tm/gtm/pool/a/~Common~lb-test.gz.hoge.co.jp/members?ver=13.1.3.4", "isSubcollection": true, "items": [ { "kind": "tm:gtm:pool:a:members:membersstate", "name": "foo:16880809218656319816-100.102.163.129", "partition": "Common", "fullPath": "/Common/foo:16880809218656319816-100.102.163.129", "generation": 1, "selfLink": "https://localhost/mgmt/tm/gtm/pool/a/~Common~lb-test.gz.hoge.co.jp/members/~Common~foo:16880809218656319816-100.102.163.129?ver=13.1.3.4", "enabled": true, "limitMaxBps": 0, "limitMaxBpsStatus": "disabled", "limitMaxConnections": 0, "limitMaxConnectionsStatus": "disabled", "limitMaxPps": 0, "limitMaxPpsStatus": "disabled", "memberOrder": 3, "monitor": "default", "ratio": 1 }, { "kind": "tm:gtm:pool:a:members:membersstate", "name": "foo:16880809218656319816-100.102.163.130", "partition": "Common", "fullPath": "/Common/foo:16880809218656319816-100.102.163.130", "generation": 1, "selfLink": "https://localhost/mgmt/tm/gtm/pool/a/~Common~lb-test.gz.hoge.co.jp/members/~Common~foo:16880809218656319816-100.102.163.130?ver=13.1.3.4", "enabled": true, "limitMaxBps": 0, "limitMaxBpsStatus": "disabled", "limitMaxConnections": 0, "limitMaxConnectionsStatus": "disabled", "limitMaxPps": 0, "limitMaxPpsStatus": "disabled", "memberOrder": 4, "monitor": "default", "ratio": 1 }, { "kind": "tm:gtm:pool:a:members:membersstate", "name": "foo:16880809218656319816-100.102.163.131", "partition": "Common", "fullPath": "/Common/foo:16880809218656319816-100.102.163.131", "generation": 1, "selfLink": "https://localhost/mgmt/tm/gtm/pool/a/~Common~lb-test.gz.hoge.co.jp/members/~Common~foo:16880809218656319816-100.102.163.131?ver=13.1.3.4", "enabled": true, "limitMaxBps": 0, "limitMaxBpsStatus": "disabled", "limitMaxConnections": 0, "limitMaxConnectionsStatus": "disabled", "limitMaxPps": 0, "limitMaxPpsStatus": "disabled", "memberOrder": 5, "monitor": "default", "ratio": 1 }, { "kind": "tm:gtm:pool:a:members:membersstate", "name": "bar:16880809218656319816-100.68.249.19", "partition": "Common", "fullPath": "/Common/bar:16880809218656319816-100.68.249.19", "generation": 1, "selfLink": "https://localhost/mgmt/tm/gtm/pool/a/~Common~lb-test.gz.hoge.co.jp/members/~Common~bar:16880809218656319816-100.68.249.19?ver=13.1.3.4", "enabled": true, "limitMaxBps": 0, "limitMaxBpsStatus": "disabled", "limitMaxConnections": 0, "limitMaxConnectionsStatus": "disabled", "limitMaxPps": 0, "limitMaxPpsStatus": "disabled", "memberOrder": 0, "monitor": "default", "ratio": 1 }, { "kind": "tm:gtm:pool:a:members:membersstate", "name": "bar:16880809218656319816-100.68.249.27", "partition": "Common", "fullPath": "/Common/bar:16880809218656319816-100.68.249.27", "generation": 1, "selfLink": "https://localhost/mgmt/tm/gtm/pool/a/~Common~lb-test.gz.hoge.co.jp/members/~Common~bar:16880809218656319816-100.68.249.27?ver=13.1.3.4", "enabled": true, "limitMaxBps": 0, "limitMaxBpsStatus": "disabled", "limitMaxConnections": 0, "limitMaxConnectionsStatus": "disabled", "limitMaxPps": 0, "limitMaxPpsStatus": "disabled", "memberOrder": 1, "monitor": "default", "ratio": 1 }, { "kind": "tm:gtm:pool:a:members:membersstate", "name": "bar:16880809218656319816-100.68.249.28", "partition": "Common", "fullPath": "/Common/bar:16880809218656319816-100.68.249.28", "generation": 1, "selfLink": "https://localhost/mgmt/tm/gtm/pool/a/~Common~lb-test.gz.hoge.co.jp/members/~Common~bar:16880809218656319816-100.68.249.28?ver=13.1.3.4", "enabled": true, "limitMaxBps": 0, "limitMaxBpsStatus": "disabled", "limitMaxConnections": 0, "limitMaxConnectionsStatus": "disabled", "limitMaxPps": 0, "limitMaxPpsStatus": "disabled", "memberOrder": 2, "monitor": "default", "ratio": 1 } ] }}- wideip raw 相当
$ curl -sk -u admin:admin -X GET 'https://f5/mgmt/tm/gtm/wideip/a/~Common~lb-test.gz.hoge.co.jp/stats' | jq .{ "kind": "tm:gtm:wideip:a:astats", "generation": 1, "selfLink": "https://localhost/mgmt/tm/gtm/wideip/a/~Common~lb-test.gz.hoge.co.jp/stats?ver=13.1.3.4", "entries": { "https://localhost/mgmt/tm/gtm/wideip/a/~Common~lb-test.gz.hoge.co.jp/~Common~lb-test.gz.hoge.co.jp:A/stats": { "nestedStats": { "kind": "tm:gtm:wideip:a:astats", "selfLink": "https://localhost/mgmt/tm/gtm/wideip/a/~Common~lb-test.gz.hoge.co.jp/~Common~lb-test.gz.hoge.co.jp:A/stats?ver=13.1.3.4", "entries": { "alternate": { "value": 0 }, "cnameResolutions": { "value": 0 }, "dropped": { "value": 0 }, "fallback": { "value": 0 }, "persisted": { "value": 0 }, "preferred": { "value": 0 }, "rcode": { "value": 0 }, "requests": { "value": 0 }, "resolutions": { "value": 0 }, "returnFromDns": { "value": 0 }, "returnToDns": { "value": 0 }, "status.availabilityState": { "description": "offline" }, "status.enabledState": { "description": "enabled" }, "status.statusReason": { "description": "No enabled pools available" }, "wipName": { "description": "/Common/lb-test.gz.hoge.co.jp" }, "wipType": { "description": "A" } } } } }}- server
- /mgmt/tm/gtm/server
- もちろん gns 自体もくる
- デフォだと virtual-server はのらない
- virtualServerDiscovery を enabled にしないとダメ
{ "kind": "tm:gtm:server:servercollectionstate", "selfLink": "https://localhost/mgmt/tm/gtm/server?ver=13.1.1.5", "items": [ { "kind": "tm:gtm:server:serverstate", "name": "gns", "partition": "Common", "fullPath": "/Common/gns", "generation": 220, "selfLink": "https://localhost/mgmt/tm/gtm/server/~Common~gns?ver=13.1.1.5", "datacenter": "/Common/TKO", "datacenterReference": { "link": "https://localhost/mgmt/tm/gtm/datacenter/~Common~TKO?ver=13.1.1.5" }, "enabled": true, "exposeRouteDomains": "no", "iqAllowPath": "yes", "iqAllowServiceCheck": "yes", "iqAllowSnmp": "yes", "limitCpuUsage": 0, "limitCpuUsageStatus": "disabled", "limitMaxBps": 0, "limitMaxBpsStatus": "disabled", "limitMaxConnections": 0, "limitMaxConnectionsStatus": "disabled", "limitMaxPps": 0, "limitMaxPpsStatus": "disabled", "limitMemAvail": 0, "limitMemAvailStatus": "disabled", "linkDiscovery": "disabled", "monitor": "/Common/bigip", "proberFallback": "inherit", "proberPreference": "inherit", "product": "bigip", "virtualServerDiscovery": "disabled", "addresses": [ { "name": "x.x.x.x", "deviceName": "x.x.x.x", "translation": "none" } ], "devicesReference": { "link": "https://localhost/mgmt/tm/gtm/server/~Common~gns/devices?ver=13.1.1.5", "isSubcollection": true }, "virtualServersReference": { "link": "https://localhost/mgmt/tm/gtm/server/~Common~gns/virtual-servers?ver=13.1.1.5", "isSubcollection": true } }, { "kind": "tm:gtm:server:serverstate", "name": "hoge", "partition": "Common", "fullPath": "/Common/hoge", "generation": 199, "selfLink": "https://localhost/mgmt/tm/gtm/server/~Common~hoge?ver=13.1.1.5", "datacenter": "/Common/TKO", "datacenterReference": { "link": "https://localhost/mgmt/tm/gtm/datacenter/~Common~TKO?ver=13.1.1.5" }, "enabled": true, "exposeRouteDomains": "no", "iqAllowPath": "yes", "iqAllowServiceCheck": "yes", "iqAllowSnmp": "yes", "limitCpuUsage": 0, "limitCpuUsageStatus": "disabled", "limitMaxBps": 0, "limitMaxBpsStatus": "disabled", "limitMaxConnections": 0, "limitMaxConnectionsStatus": "disabled", "limitMaxPps": 0, "limitMaxPpsStatus": "disabled", "limitMemAvail": 0, "limitMemAvailStatus": "disabled", "linkDiscovery": "disabled", "monitor": "/Common/bigip", "proberFallback": "inherit", "proberPreference": "inherit", "product": "bigip", "virtualServerDiscovery": "disabled", "addresses": [ { "name": "x.x.x.x", "deviceName": "device_hoge", "translation": "none" } ], "devicesReference": { "link": "https://localhost/mgmt/tm/gtm/server/~Common~hoge/devices?ver=13.1.1.5", "isSubcollection": true }, "virtualServersReference": { "link": "https://localhost/mgmt/tm/gtm/server/~Common~hoge/virtual-servers?ver=13.1.1.5", "isSubcollection": true } } ]}- /mgmt/tm/gtm/server/
Commonhoge/virtual-servers- subcollection で取得できる
{ "kind": "tm:gtm:server:virtual-servers:virtual-serverscollectionstate", "selfLink": "https://localhost/mgmt/tm/gtm/server/~Common~hoge/virtual-servers?ver=13.1.1.5", "items": [ { "kind": "tm:gtm:server:virtual-servers:virtual-serversstate", "name": "me01.vip.hoge", "fullPath": "me01.vip.hoge", "generation": 199, "selfLink": "https://localhost/mgmt/tm/gtm/server/~Common~hoge/virtual-servers/me01.vip.hoge?ver=13.1.1.5", "destination": "182.22.4.220:80", "enabled": true, "limitMaxBps": 0, "limitMaxBpsStatus": "disabled", "limitMaxConnections": 0, "limitMaxConnectionsStatus": "disabled", "limitMaxPps": 0, "limitMaxPpsStatus": "disabled", "monitor": "/Common/http-gslb-http1.0", "translationAddress": "none", "translationPort": 0 } ]}- /mgmt/tm/gtm/server/
Commonhoge/virtual-servers
{ "kind": "tm:gtm:server:virtual-servers:virtual-serverscollectionstate", "selfLink": "https://localhost/mgmt/tm/gtm/server/~Common~hoge/virtual-servers?ver=13.1.1.5", "items": [ { "kind": "tm:gtm:server:virtual-servers:virtual-serversstate", "name": "me01.vip", "fullPath": "me01.vip", "generation": 199, "selfLink": "https://localhost/mgmt/tm/gtm/server/~Common~hoge/virtual-servers/me01.vip?ver=13.1.1.5", "destination": "182.22.4.220:80", "enabled": true, "limitMaxBps": 0, "limitMaxBpsStatus": "disabled", "limitMaxConnections": 0, "limitMaxConnectionsStatus": "disabled", "limitMaxPps": 0, "limitMaxPpsStatus": "disabled", "monitor": "/Common/http-gslb-http1.0", "translationAddress": "none", "translationPort": 0 } ]}- /mgmt/tm/gtm/pool/a/
Commongeolocation-osk/members/stats
{ "kind": "tm:gtm:pool:a:members:memberscollectionstats", "selfLink": "https://localhost/mgmt/tm/gtm/pool/a/~Common~geolocation-osk/members/stats?ver=13.1.1.5", "entries": { "https://localhost/mgmt/tm/gtm/pool/a/~Common~geolocation-osk/members/me01.vip:~Common~hoge/stats": { "nestedStats": { "kind": "tm:gtm:pool:a:members:membersstats", "selfLink": "https://localhost/mgmt/tm/gtm/pool/a/~Common~geolocation-osk/members/me01.vip:~Common~hoge/stats?ver=13.1.1.5", "entries": { "alternate": { "value": 0 }, "fallback": { "value": 0 }, "poolName": { "description": "/Common/geolocation-osk" }, "poolType": { "description": "A" }, "preferred": { "value": 64 }, "serverName": { "description": "/Common/hoge" }, "status.availabilityState": { "description": "available" }, "status.enabledState": { "description": "enabled" }, "status.statusReason": { "description": "Available" }, "vsName": { "description": "me01.vip" } } } } }}- /mgmt/tm/gtm/server/
Commonhoge/virtual-servers/stats
{ "kind": "tm:gtm:server:virtual-servers:virtual-serverscollectionstats", "selfLink": "https://localhost/mgmt/tm/gtm/server/~Common~hoge/virtual-servers/stats?ver=13.1.1.5", "entries": { "https://localhost/mgmt/tm/gtm/server/~Common~hoge/virtual-servers/me01.vip/stats": { "nestedStats": { "kind": "tm:gtm:server:virtual-servers:virtual-serversstats", "selfLink": "https://localhost/mgmt/tm/gtm/server/~Common~ssk/virtual-servers/me01.vip/stats?ver=13.1.1.5", "entries": { "destination": { "description": "182.22.4.220:80" }, "linkName": { "description": "---" }, "metrics.bitsPerSecIn": { "value": 0 }, "metrics.bitsPerSecOut": { "value": 0 }, "metrics.connections": { "value": 0 }, "metrics.pktsPerSecIn": { "value": 0 }, "metrics.pktsPerSecOut": { "value": 0 }, "metrics.vsScore": { "value": 0 }, "picks": { "value": 50 }, "status.availabilityState": { "description": "available" }, "status.enabledState": { "description": "enabled" }, "status.statusReason": { "description": " Monitor /Common/http-gslb-http1.0 from x.x.x.x : state: success" }, "uptime": { "description": "---" }, "vsName": { "description": "me01.vip" } } } } }}- /mgmt/tm/util/bash
コマンドをそのまま渡してなんでもできるやつ
$ curl -sk -u admin:admin -X POST 'https://f5/mgmt/tm/util/bash' -H "Content-type: application/json" -d '{"command": "run", "utilCmdArgs": "-c \"tmsh show sys version\""}' | jq -jr .commandResult
Sys::VersionMain Package Product BIG-IP Version 13.1.1.5ログファイルなど
Section titled “ログファイルなど”save sys config file filename.scfsave sys ucs filename.ucsqkview
Section titled “qkview”# cd /var/tmp# nice -n 19 qkviewバージョン 10.x より、各種ログデータは qkview スクリプト結果に含まれるようになっていますが、 ファイルサイズが大きい場合は一部切り捨てられます。
# cd /var/tmp# gtar -zcvf log.[日付].gz /var/log/*マスターキー
Section titled “マスターキー”UCS の中には機器固有のマスターキーによってハッシュ化されている設定があります。 そのためマスターキーの異なる代替機器にリストアする際には、以下の出力結果(マスターキー)をあらかじめ把握しておく必要があります。
# f5mku -K