Previously in 7-mode we could use "cifs sessions *" to display any open session, this list contained information about which share was open.
In CDOT "vserver cifs sessions show" does not contain this information, even when run with "-instance". Instead the information about which share (or volume, would be okay, too!) a the sessions are opened to is only available in the "vserver cifs sessions file show" command. Unfortunately there I cannot get information about client IP.
I've discovered this issue because I was looking for a method to see which client IPs are connected to a certain share (or volume, would be okay, too!).
How can I do this from CLI?
This is not working:
"vserver cifs session show -instance" - It displays client IP, but no information about which share the session is connected too.
"vserver cifs session file show -fields hosting-volume,share" - This on the other hand displays volume and share, but not the client IP.
Yes, both commands present me with the connection ID from which I could cross-reference to the client IP - excuse my french - wtf?! Why is this not possible through a regular command - or am I just overlooking something?
Please help, my Windows admins would be forever grateful to you and your heirs,
thanks for the reply! As far as I can see there is absolutely no ONTAP internal way to get combined info from "vserver cifs session" and "vserver cifs session file". I had already tried to use "-fields" to get more from the two possible commands.
Here the field "share" is exactly what I need: it displays the name of the share that a certain session is connected to. Unfortunately in this show command I have no option to include anything about the sessions origin like IP address or user name ...
For now I'm working with this external workaround:
on FILER: get list of cifs sessions with "vserver cifs session show"
on unix: filter above output to get all unique "connection-id" numbers
on FILER: use "connetion-id" list to get the open shares/files for each of the connections, this can be achieved by using "vserver cifs session file show"
on unix: filter this output so I get only info on the shares in question and only unique IP addresses
The downsides are:
It's a lengthy process as for every connection id it has to open a dedicated ssh connection to the filer
this is only practical if ssh key authentication is configured
if a session has NO open files I cannot find out which share the session is connected to