Hi,
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.
clusterA::> vserver cifs session show -fields shares,windows-user,idle-time,session-id,address,protocol-version,user-type,
node vserver session-id
connection-id lif-address address
auth-mechanism windows-user unix-user
shares files other
connected-time idle-time protocol-version
continuously-available is-session-signed user-type
netbios-name smb-encryption-status
Fields that caught my attention but didn't do the trick:
"shares" -> if used, it will only display the "number of open shares", not the share name.
"files" -> if used, it will only display the "number of open files", not hte file name or path.
clusterA::> vserver cifs session file show -fields
node vserver file-id
connection-id session-id file-type
open-mode hosting-aggregate hosting-volume
share path share-mode
range-locks continuously-available reconnected
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
Well, so far so bad.
BR
Konstantin