From windows client, you can use below command to list out cifs sessions:
Stale cifs sessions can be found out by listing cifs sessions on storage end and comparing them with sessions running on client. If sessions are available on client but not listing out in storage then those sessions are stale and will not be accessible.
I know how to check CIFS sessions on NetApp, but here is the actual requirement, we are trying to write a script to find the stale sessions in all the NetApp Arrays. If you know how to proceed further. Please guide me through the process.
Do you possibly have a firewall policy blocking the traffic? I'm assuming that you're connecting to your cluster management LIF in your screenshot - can you run "system services firewall policy show" and "net int show -role cluster-mgmt -fields firewall-policy" to make sure that your connection is allowed?
Can you try manually specifying an HTTPS connection by adding the "-HTTPS" parameter in your "Connect-NcController" command?
#Below line will initiate an object for ssh connectivity.
p = paramiko.SSHClient()
#Below line will open a the credential file in read mode where we have credential fo the devices.
cred = open("cred.csv","r")
#Now below is the for loop which will iterate over each line of the file and get the credential, login to the device and execute a command. Then the output of the command for each device will be saved in a text file.
for i in cred.readlines(): line=i.strip() ls =line.split(",") print(ls) p.set_missing_host_key_policy(paramiko.AutoAddPolicy()) p.connect("%s"%ls,port =22, username = "%s"%ls, password="%s"%ls) stdin, stdout, stderr = p.exec_command("vserver cifs session show -idle-time \>=1d") opt = stdout.readlines() opt ="".join(opt) print(opt) temp=open("%s.txt"%ls,"w") temp.write(opt) temp.close() cred.close()
I have tried above script with \ and with out \, but i got error like below.