解决了

想要通过命令或休息API获取文件的“打开”

  • 2020年1月31日
  • 2回复
  • 1769年观点

徽章

问题1:什么让“OpenConnection”做了如何?

问题2:是“打开连接”文件的会话数?

谢谢你。

图标

最好的答案jeremyj.2020年2月6日,21:19

If I understand correctly, you\u2019re wanting to get the \u201cOpen Connections\u201d stat which is visible from Prism for a given File Server or share, and you want to fetch this using a REST API call or command.\u00a0
You\u2019d also like to verify if this tells you the number of open sessions for a Files server.

For day to day human-interactive operations, I\u2019d recommend\u00a0to use the MMC Snap-In for Nutanix Files, which includes the capability to list and manage SMB connections.
https:\/\/portal.nutanix.com\/#\/page\/docs\/details?targetId=Files-MMC-Plugin-v3:Files-MMC-Plugin-v3<\/a>\u00a0<\/p>

From your question though, it sounds like you\u2019re wanting something you could script.\u00a0I\u2019m not sure of your use case but maybe one of these options\u00a0will help.

1. Working from the CVM CLI, the command \u201cncli file-server list\u201d will list Files servers on the cluster in detail. Part of this output is the \u201cTotal SMB Connections\u201d stat.\u00a0
If you want details for just one Files server, you can use the \u2018get\u2019 command instead of list.
syntax: ncli file-server get uuid=<uuid>\u00a0
You can find this and other NCLI commands detailed in the Command Reference document for AOS.<\/p>

https:\/\/portal.nutanix.com\/#\/page\/docs\/details?targetId=Command-Ref-AOS-v510:acl-ncli-file-server-auto-r.html<\/a>\u00a0

2. If you\u2019re looking to pull this stat through the REST API, you\u2019ll probably want to use the REST API Explorer available in Prism. Access this from the dropdown menu that appears when you click on your username in the top right corner. That \u201cOpen Connections\u201d value in Prism is from the one of\u00a0the metrics collected with the V1 API call \u201cvfilers\/<uuid>\/stats\u201d. If I understand what you\u2019re asking for, the metric for this is \u201ctotal_smb_connections\u201d. You can try this out from the REST explorer available in Prism and get a formatted URL string you could reuse to get this information.

There\u2019s also a powershell commandlet you could use to get Files server stats and information, so that may be worth looking into as well.
reference:\u00a0
https:\/\/portal.nutanix.com\/#\/page\/docs\/details?targetId==API-Ref-AOS-v510:API-Ref-AOS-v510<\/a>\u00a0

3. One more option I found,\u00a0from a knowledge base article on the Nutanix support portal about identifying and clearing a hung session:\u00a0
https:\/\/portal.nutanix.com\/kb\/7491<\/a>\u00a0
If you have SSH access to the Files server, you can use the commands described there to use and manage the current SMB connections.\u00a0<\/p>","className":"post__content__best_answer"}">

查看原版

2回复

UserLevel 3.
徽章 +4

如果我理解正确,您希望获取从棱镜可见的“打开连接”stat,这对于给定的文件服务器或共享,并且您希望使用REST API调用或命令获取此功能。
您还想验证这是否会告诉您文件服务器的打开会话的数量。

日常人力互动操作,我建议使用MMC Snap-In for Nutanix文件,其中包括列出和管理SMB连接的功能。
https://portal.nutanix.com/#/page/docs/details?targetid=files-mc-plugin-v3:files-mcc-plugin-v3

尽管如此,它听起来你想要一些你可以脚本的东西。我不确定你的用例,但也许这些选项之一将有所帮助。

1.从CVM CLI工作,命令“NCLI文件 - 服务器列表”将详细列出群集上的文件服务器。该输出的一部分是“Total SMB连接”Stat。
如果您想要一个文件服务器的详细信息,可以使用“get”命令而不是列表。
语法:ncli文件服务器get uuid =
您可以找到AOS命令参考文档中详细介绍的此问题和其他NCLI命令。

https://portal.nutanix.com/#/page/docs/details?targetid = commmand-ref-aos-v510:acl-ncli-file-server-auto-r.html.

2.如果您要通过REST API预留此统计数据,您可能希望使用棱镜中提供的REST API Explorer。从右上角单击用户名时出现的下拉菜单访问此功能。棱镜中的“打开连接”值来自与V1 API调用“VFilers / /统计数据”收集的指标之一。如果我理解您要求的内容,则这是“Total_smb_connections”的指标。您可以从棱镜中提供的REST Explorer中尝试此功能,并获取格式化的URL字符串,您可以重用以获取此信息。

还有一个powershell compandlet,您可以使用来获取文件服务器统计信息和信息,以便也值得调查。
参考:https://portal.nutanix.com/#/page/docs/details?targetid==api-ref-aos-v510 :api-ref-aos-v510

3.从Nutanix支持门户的知识库文章中找到了一个更多选择,关于识别和清除挂起会话:https://portal.nutanix.com/kb/7491.
如果您有SSH访问文件服务器,可以使用那里描述的命令来使用和管理当前的SMB连接。

徽章

杰里米

我想要获得REST API的打开连接计数

我可以继续进行调查,谢谢:D

回复


Learn more about our cookies.<\/a>","cookiepolicy.button":"Accept cookies","cookiepolicy.button.deny":"Deny all","cookiepolicy.link":"Cookie settings","cookiepolicy.modal.title":"Cookie settings","cookiepolicy.modal.content":"We use 3 different kinds of cookies. You can choose which cookies you want to accept. We need basic cookies to make this site work, therefore these are the minimum you can select. Learn more about our cookies.<\/a>","cookiepolicy.modal.level1":"Basic
Functional","cookiepolicy.modal.level2":"Normal
Functional + analytics","cookiepolicy.modal.level3":"Complete
Functional + analytics + social media + embedded videos"}}}">
Baidu