Subscribe

Api call for list of open shaes per client machine.

Hello!
I need to build a report to see which machine connected to what share and vice versa -- list of machines connected to some share.

In CLI cifs sessions %MACHINE_ADDRESS% works fine. It sows open shares, files etc. But in API browser I see that cifs-session-list-iter-next returns cifs-session-info structure where "shares" is an integer and returns only amount of open shares per client, but not names.

 

Any ideas how to get names of open cifs shares?

 

Thanks!

Re: Api call for list of open shaes per client machine.

Hi,

To get the information you need first you must understand that CIFS sessions will bring you only session information. You'll get the user using that session, for example. But you want all shares opened by that session, this means you want to know what files (by the way directories are a kind of file) is a user accessing so you must use cifs-session-file-get-iter to get those information.

Thus, you simply relate both by session-id and optionally by connection-id too.

Sorry for any typo but I am using my mobile.