증권 시세 표시기: API에서 SCG 상태를 수집하는 방법
摘要: API(Application Programming Interface) 쿼리에서 SCG(Secure Connect Gateway) 상태를 수집하는 방법 이 방법은 모든 SCG 구성 요소의 상태(연결 상태, keepalive 상태, 모든 서비스 상태, 연결된 디바이스 시스템 정보)를 분석하는 데 유용합니다.
本文适用于
本文不适用于
本文并非针对某种特定的产品。
本文并非包含所有产品版本。
说明
이는 보안 연결 게이트웨이 버전 5.10.00.10에서 테스트되었습니다.
다음은 모든 상태 정보를 수집하기 위해 SCG에 대한 API 쿼리를 수행하는 데 필요한 단계입니다.
- 보안 연결 게이트웨이에서 REST API 인터페이스를 활성화합니다.
데이터 센터 툴 및 애플리케이션과 통합할 수 있도록 SCG에서 REST API 인터페이스를 활성화해야 합니다.
API 인터페이스를 활성화하려면 웹 브라우저에서 SCG 패널(https://<IP_SCG>:5700)에서 SettingsAPI settings(설정 > API 설정)로 이동하고 Enable API interfaces for this gateway(이 게이트웨이에 대한 API 인터페이스 활성화) 확인란을 선택한 다음 Apply(적용)를 클릭합니다.
- 루트 사용자로 SCG 게이트웨이에 대한 SSH 세션을 열고 아래 명령을 수행합니다.
SCG 게이트웨이를 사용하여 인증 토큰 생성 - 모든 API를 수행하려면 인증 토큰을 얻기 전에 SCG 게이트웨이에 대한 쿼리가 필요합니다. 이 경우 인증 토큰을 가져와서 다음 API 쿼리를 용이하게 하기 위해 시스템 변수에 저장합니다.AUTH_TOKEN=`curl -k -s -L -i -X --header "Content-Type: application/json" --request POST --data '{"username":"admin","password":"admin_password"}' 'https://10.108.0.40:5700/SupportAssist/api/v2/auth/token?accessToken' | grep "accessToken" | awk -F ":" {'print $2'} | sed 's/,$//' | sed 's/^..//' | sed 's/.$//'`여기서:- admin = SCG의 admin 사용자
- admin_password = SCG의 관리자 암호
- 10.108.0.40 = SCG의 IP 주소
scg:~ # AUTH_TOKEN=`curl -k -s -L -i -X --header "Content-Type: application/json" --request POST --data '{"username":"admin","password":"admin_password"}' 'https://10.108.0.40:5700/SupportAssist/api/v2/auth/token?accessToken' | grep "accessToken" | awk -F ":" {'print $2'} | sed 's/,$//' | sed 's/^..//' | sed 's/.$//'` scg:~ # echo $AUTH_TOKEN eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyTmFtZSI6ImFkbWluIiwicm9sZSI6IlNDR0FkbWlucyIsInJlcXVlc3RpbmdJUCI6IjEwLjEwNy4wLjM5IiwiYXBwTW9kZSI6IkFQUExJQU5DRVMiLCJhcGlVc2FnZU1vZGUiOiJSZXN0IiwiaW5zdGFuY2VJRCI6ImJGMFhhdUk2MVI2REtZM3A5a0NKTHdVWlMwTGhPUjRNaVJydEhPTkgxamFxa2Zrb0xONDlGeXNraXB5ZVFjUmxsSlFyTFJQQkJtNlRZeGNTWGxleEJBPT0iLCJ0b2tlblR5cGUiOiJBQ0NFU1MiLCJ1dWlkIjoiZGFkYjYxY2EtNjNmZi00ODRlLWEwOGUtOTA0OGY0NzczYzJmIiwiaWF0IjoxNjQ4NzQzODk2LCJleHAiOjE2NDg3NDU2OTZ9.D2ziJJhc8dAyqiFIwXucluWLwsdKVSv1TqQAnt1b8KA - API 쿼리를 실행하여 SCG 상태를 가져옵니다.
이 API 쿼리를 사용하면 SCG에 대한 많은 정보를 볼 수 있습니다.
- 연결
상태 - keepalive
상태 - 각 SCG 서비스(esrshttpd, esrshttpdR, esrsconnectemc, networkConnectivity 등)
의 상태 - 모니터링되는 장치의
상태 상태 상태 상태를 수집하기 위한 API 쿼리는 다음과 같습니다.curl -k -X GET --header "Accept: application/json" --header "Authorization: Bearer $AUTH_TOKEN" https://10.108.0.40:5700/SupportAssist/api/v2/service/healthstatus?
예:scg:~ # curl -k -X GET --header "Accept: application/json" --header "Authorization: Bearer $AUTH_TOKEN" https://10.108.0.40:5700/SupportAssist/api/v2/service/healthstatus? { "data" : { "runDate" : "Mar 31, 2022 12:03:57 -EDT", "gatewayInfo" : { "serialNumber" : "XXXXXXXXXX", "productModel" : "SECURECONNECTGATEWAY-APPLIANCE", "ipAddress" : "10.108.0.40", "gatewayVersion" : "5.00.07.10" }, "connectivity" : { "mqttStatus" : { "state" : "CONNECTED", "updatedAt" : "2022-03-28T20:58:38.244+00:00", "recommendation" : "" }, "keepaliveStatus" : { "state" : "CONNECTED", "updatedAt" : "2021-11-22T04:27:05.198+0000", "recommendation" : "" } }, "services" : [ { "serviceName" : "esrshttpd", "criticality" : "Critical", "serviceType" : "Core service status", "description" : "Service to securely transfer files between your devices and secure connect gateway", "status" : "Running", "recommendation" : "" }, { "serviceName" : "esrshttpdR", "criticality" : "Critical", "serviceType" : "Core service status", "description" : "A service that manages file transfers from your gateway to Dell Technologies, or to your devices", "status" : "Running", "recommendation" : "" }, { "serviceName" : "esrsconnectemc", "criticality" : "Critical", "serviceType" : "Core service status", "description" : "A service at Dell Technologies that receives alert data from your devices", "status" : "Running", "recommendation" : "" }, { "serviceName" : "esrsclientproxy", "criticality" : "Warning", "serviceType" : "Core service status", "description" : "A service for connectivity between devices and Dell Technologies", "status" : "Running", "recommendation" : "" }, { "serviceName" : "esrswatchdogservice", "criticality" : "Warning", "serviceType" : "Core service status", "description" : "A service that monitors whether or not other services are running or down. When services go down unexpectedly, the watchdog service will attempt to restart them so they start functioning normally again", "status" : "Running", "recommendation" : "" }, { "serviceName" : "esrshttpdftp", "criticality" : "Critical", "serviceType" : "Core service status", "description" : "A service at Dell Technologies that receives alert data from your devices", "status" : "Running", "recommendation" : "" }, { "serviceName" : "esrshttpdlistener", "criticality" : "Critical", "serviceType" : "Core service status", "description" : "A service at Dell Technologies that receives alert data from your devices", "status" : "Running", "recommendation" : "" }, { "serviceName" : "shibd", "criticality" : "Critical", "serviceType" : "Core service status", "description" : "A Service for remote secure credentials", "status" : "Running", "recommendation" : "" }, { "serviceName" : "apache2", "criticality" : "Critical", "serviceType" : "Core service status", "description" : "A Service for remote secure credentials", "status" : "Running", "recommendation" : "" }, { "serviceName" : "esrsjcemc", "criticality" : "Critical", "serviceType" : "Restful service status", "description" : "A service at Dell Technologies that receives alert data from your devices", "status" : "Running", "recommendation" : "" }, { "serviceName" : "esrskeepalive", "criticality" : "Critical", "serviceType" : "Restful service status", "description" : "Device service that sends heartbeat status from devices to Dell Technologies", "status" : "Running", "recommendation" : "" }, { "serviceName" : "esrsmftauth", "criticality" : "Critical", "serviceType" : "Restful service status", "description" : "A service that transfers files between Dell, your gateway, and your devices", "status" : "Running", "recommendation" : "" }, { "serviceName" : "esrsupdate", "criticality" : "Critical", "serviceType" : "Restful service status", "description" : "A service to retreives update information from Dell Technologies", "status" : "Running", "recommendation" : "" }, { "serviceName" : "esrsdigitaltwinservice", "criticality" : "Critical", "serviceType" : "Restful service status", "description" : "A service for connectivity between devices and Dell Technologies", "status" : "Running", "recommendation" : "" }, { "serviceName" : "esrsmqttclient", "criticality" : "Critical", "serviceType" : "Restful service status", "description" : "A service that monitors connectivity between the gateway and Dell", "status" : "Running", "recommendation" : "" }, { "serviceName" : "esrsmosquitto", "criticality" : "Critical", "serviceType" : "Core service status", "description" : "A service that transfers files between your gateway local system to Dell", "status" : "Running", "recommendation" : "" }, { "serviceName" : "esrsmqttauth", "criticality" : "Critical", "serviceType" : "Restful service status", "description" : "A service that validates credentials for remote support activities", "status" : "Running", "recommendation" : "" }, { "serviceName" : "srsadapter", "description" : "A service that manages the communications between containers", "status" : "running" }, { "serviceName" : "secureconnectgateway", "description" : "A service that allows access to secure connect gateway's user interface.", "status" : "running" }, { "serviceName" : "cases", "description" : "A service that manages alerts, events, and support cases generated by your gateway.", "status" : "running" }, { "serviceName" : "auditlog", "description" : "A service that displays your gateway's activity history.", "status" : "running" }, { "serviceName" : "connectivity", "description" : "A service that manages connectivity with the Dell Technologies backend.", "status" : "running" }, { "serviceName" : "appsettings", "description" : "A service to save changes for configuration settings.", "status" : "running" }, { "serviceName" : "consoleadapter", "description" : "A service that manages connectivity with systems management consoles.", "status" : "running" }, { "serviceName" : "registration", "description" : "A service that registers your secure connect gateway.", "status" : "running" }, { "serviceName" : "collection", "description" : "A service that initiates collection of telemetry from devices, then retreives that telemetry and displays it in your gateway. ", "status" : "running" }, { "serviceName" : "inventory", "description" : "A service that retreives inventory information from devices.", "status" : "running" }, { "serviceName" : "secureconnectgatewaydb", "description" : "A service that allows access to secure connect gateway's database.", "status" : "running" }, { "serviceName" : "email", "description" : "A service that manages and sends emails from secure connect gateway.", "status" : "running" } ], "networkConnectivity" : [ { "hostName" : "esrs3-core.emc.com", "port443" : { "status" : "CONNECTED", "recommendation" : "" }, "port8443" : { "status" : "CONNECTED", "recommendation" : "" } }, { "hostName" : "esrs3-coredr.emc.com", "port443" : { "status" : "CONNECTED", "recommendation" : "" }, "port8443" : { "status" : "CONNECTED", "recommendation" : "" } } ], "systemInfo" : { "systemInfo" : "VMware, Inc.", "noOfProcessors" : 4, "memory" : { "memoryUsage" : "12.21 / 15.66 GB (78%)", "status" : "HEALTHY", "message" : "" }, "cpu" : { "cpuLoad" : "2.65%", "status" : "HEALTHY" }, "diskSpaceDetails" : [ { "partitionName" : "/dev/sda1", "availableDiskSpace" : "0.21 GB", "used" : "28%" }, { "partitionName" : "/dev/mapper/scgVG-LVRoot", "availableDiskSpace" : "13.31 GB", "used" : "13%" }, { "partitionName" : "/dev/mapper/scgVG-LVvar_lib_docker", "availableDiskSpace" : "86.77 GB", "used" : "8%" }, { "partitionName" : "/dev/mapper/scgVG-LVvar_log", "availableDiskSpace" : "7.35 GB", "used" : "6%" }, { "partitionName" : "/dev/mapper/scgVG-LVvar_lib_scgve", "availableDiskSpace" : "7.36 GB", "used" : "6%" }, { "partitionName" : "/dev/mapper/scgVG-LVopt_esrsve", "availableDiskSpace" : "7.35 GB", "used" : "6%" } ] }, "smtp" : { "status" : "Connected" } }, "email" : "Timed out after waiting 30000(ms) for a reply. address: __vertx.reply.1bd9b6f0-73e1-4f27-8f57-207c3c5577bb, repliedAddress: emailApplianceService.queue" }scg:~ #
보고서를 파일로 저장하려면 다음을 수행합니다.
curl -k -X GET --header "Accept: application/json" -o report_scg.txt --header "Authorization: Bearer $AUTH_TOKEN" https://10.108.0.40:5700/SupportAssist/api/v2/service/healthstatus?
여기서:-o report_scg.txt = 이 옵션은 출력을 저장하는 데 사용됩니다. "report_scg.txt" 파일.
중요 - 인증 메커니즘:
인증 프로세스는 클라이언트가 자격 증명을 제공하여 서버에서 토큰을 요청할 때 시작됩니다. 이에 대한 응답으로 보안 연결 게이트웨이는 액세스 토큰과 새로 고침 토큰을 반환합니다. 새로 고침 토큰은 24시간 동안 유효하지만 액세스 토큰은 30분 동안 유효합니다. 액세스 토큰이 만료되면 새로 고침 토큰을 사용하여 새 액세스 토큰을 생성할 수 있습니다.
其他信息
보안 연결 게이트웨이 REST API 가이드:
受影响的产品
VxRail, Secure Connect Gateway, Secure Connect Gateway - Virtual Edition, VxRail Appliance Family, VxRail Appliance Series文章属性
文章编号: 000197829
文章类型: How To
上次修改时间: 18 11月 2025
版本: 3
从其他戴尔用户那里查找问题的答案
支持服务
检查您的设备是否在支持服务涵盖的范围内。