Description
This utility will enumerate the CIFS and NFS shares exported from the same volume and then delete the shares from the Data Insight configuration.
Process:
1. Log in to Data Insight Management Server
2. Copy the attached dup_shares.jar to a temporary location on the MS e.g c:\test
3. From command prompt with elevated permissions navigate to the <INSTALLDIR>\DataInsight\jre\bin directory
E.g C:\Program Files\dataInsight\jre\bin
4. Run the following command to get list of all the shares exported from same volume
> java.exe -jar <Path of dup_shares.jar> --list --installdir <Installation Dir> --output <Path of output file>
where <Path of output file> could be c:\temp\shares_list.csv and <Installation Dir> could be C:\Program Files\DataInsight) and <Path of dup_shares.jar> could be C:\temp\dup_shares.jar
5. Open the output file (shares_list.csv) and identify shares you want to delete and copy those to a new csv file to be used as the input file for the deletion
6. Run following command to delete shares.
> java -jar <Path of dup_shares.jar> --delete --installdir <Installation Dir> --input <Path to delete_shares.csv>
In this example, delete_shares.csv is the input file created with the data from the previous command output file
Example:
To put the database in place:sqlite> select * from msu where msu_id in(55,57,9,64,11,61);
msu_id|device_id|mtype|sname|uncpath_prefix|internal_prefix|path_style|enabled|indexer_id|indexer_dir|audit_start
9|1|1|Exec_Users|\\Filer_name\Exec_Users|c:\fs\01\02\03\Executive\Mgrs\Users|1|1|1||1518726090
11|1|1|Acct_Users|\\Filer_name\Acct_Users|c:\fs\01\02\Dollars\Accounting\Users|1|1|1||1518726090
55|1|1|EE_1|\\Filer_name\EE_1|c:\fs\01\02\03\EE_E\Shares|1|1|1||1518726091
57|1|1|EE_2|\\Filer_name\EE_2|c:\fs\01\02\03\EE_E\Shares|1|1|1||1518726091
61|1|1|Account_Users|\\Filer_name\Account_Users|c:\fs\01\02\Dollars\Accounting\Users|1|1|1||1518726091
64|1|1|GenMgr_Users|\\Filer_name\GenMgr_Users|c:\fs\01\02\03\Executive\Mgrs\Users|1|1|1||1518726091
sqlite> .q
C:\Program Files\DataInsight\jre\bin>java -jar C:\test\Dedupe_Shares\dup_shares.jar --list --installdir D:\Program Files\dataInsight --output C:\test\1shares_list.csv
6 shares with common paths found, check file C:\test\1shares_list.csv
C:\test\1shares_list.csv
#FILER_ID,SHARE_ID,SHARE_NAME,SHARE_PATH
1,55,EE_1,c:\fs\01\02\03\EE_E\Shares
1,57,EE_2,c:\fs\01\02\03\EE_E\Shares
1,9,Exec_Users,c:\fs\01\02\03\Executive\Mgrs\Users
1,64,GenMgr_Users,c:\fs\01\02\03\Executive\Mgrs\Users
1,11,Acct_Users,c:\fs\01\02\Dollars\Accounting\Users
1,61,Account_Users,c:\fs\01\02\Dollars\Accounting\Users
Copy the paths to be deleted from the 1shares_list.csv to delete_shares.csvC:\test\delete_shares.csv
#FILER_ID,SHARE_ID,SHARE_NAME,SHARE_PATH
1,55,EE_1,c:\fs\01\02\03\EE_E\Shares
1,9,Exec_Users,c:\fs\01\02\03\Executive\Mgrs\Users
1,11,Acct_Users,c:\fs\01\02\Dollars\Accounting\Users
Note: Remove any blank lines from the file that you intend to use as input.C:\Program Files\DataInsight\jre\bin>java -jar C:\test\Dedupe_Shares\dup_shares.jar --delete --installdir D:\Program Files\DataInsight --input C:\test\delete_shares.csv
Deleting share EE_2 [Id : 57]
Share deleted successfully: 57
Mar 02, 2018 7:16:23 AM com.symc.matrix.dupshares.util.MatrixUtils deleteShare
INFO: Adding share EE_2 to filer's exclude list ([*$])
Mar 02, 2018 7:16:23 AM com.symc.matrix.dupshares.util.MatrixUtils deleteShare
INFO: Setting new exclude list to: *$,EE_2
Mar 02, 2018 7:16:23 AM com.symc.matrix.dupshares.util.MatrixUtils setFilerProperty
INFO: Setting property filer.excludeShares for filer 1
Mar 02, 2018 7:16:23 AM com.symc.matrix.dupshares.util.MatrixUtils setFilerProperty
INFO: Property filer.excludeShares set successfully
Deleting share Mgr_Users [Id : 64]
Share deleted successfully: 64
Mar 02, 2018 7:16:23 AM com.symc.matrix.dupshares.util.MatrixUtils deleteShare
INFO: Adding share Mgr_Users to filer's exclude list ([*$, EE_2])
Mar 02, 2018 7:16:23 AM com.symc.matrix.dupshares.util.MatrixUtils deleteShare
INFO: Setting new exclude list to: *$,EE_2,GenMgr_Users
Mar 02, 2018 7:16:23 AM com.symc.matrix.dupshares.util.MatrixUtils setFilerProperty
INFO: Setting property filer.excludeShares for filer 1
Mar 02, 2018 7:16:23 AM com.symc.matrix.dupshares.util.MatrixUtils setFilerProperty
INFO: Property filer.excludeShares set successfully
Deleting share Account_Users [Id : 61]
Share deleted successfully: 61
Mar 02, 2018 7:16:23 AM com.symc.matrix.dupshares.util.MatrixUtils deleteShare
INFO: Adding share Account_Users to filer's exclude list ([*$, EE_2, GenMgr_Users])
Mar 02, 2018 7:16:23 AM com.symc.matrix.dupshares.util.MatrixUtils deleteShare
INFO: Setting new exclude list to: *$,EE_2,GenMgr_Users,Account_Users
Mar 02, 2018 7:16:23 AM com.symc.matrix.dupshares.util.MatrixUtils setFilerProperty
INFO: Setting property filer.excludeShares for filer 1
Mar 02, 2018 7:16:24 AM com.symc.matrix.dupshares.util.MatrixUtils setFilerProperty
INFO: Property filer.excludeShares set successfully
Note: The config.db file will have updates related to these operations.C:\Program Files\DataInsight\jre\bin>sqlite3 C:\DataInsight\data\conf\config.db.184
sqlite> select * from msu where msu_id in(55,57,9,64,11,61);
msu_id|device_id|mtype|sname|uncpath_prefix|internal_prefix|path_style|enabled|indexer_id|indexer_dir|audit_start
9|1|1|Exec_Users|\\Filer_name\Exec_Users|c:\fs\01\02\03\Executive\Mgrs\Users|1|1|1||1518726090
11|1|1|Acct_Users|\\Filer_name\Acct_Users|c:\fs\01\02\Dollars\Accounting\Users|1|1|1||1518726090
55|1|1|EE_1|\\Filer_name\EE_1|c:\fs\01\02\03\EE_E\Shares|1|1|1||1518726091
This tool will delete the shares with duplicate paths, but it will require manual input to the delete the file in the format #FILER_ID,SHARE_ID,SHARE_NAME,SHARE_PATH to remove the shares that the customer is not receiving, auditing from, that they would like to remove. Perhaps this was the disable function, which is not coded into this version of the tool, but all the shares affected under this scenario in the customer's environment have already been addressed.
Is there a method to pick the paths from the generated list?
Note: If the application has been active the audits will typically go to the share which has the shortest name, all else being equal
You can dump the shares that are not auditing, such as from the console of monitored shares:"FILER Name :", Filer_name
"TYPE :", Hitachi NAS
"ID","SHARE NAME","SHARE TYPE","STATUS","PARALLEL THREAD COUNT","LEGAL HOLD","SCANNING SCHEDULE","LAST FULL SCAN","LAST INCREMENTAL SCAN","LAST INDEX UPDATE(SCAN)","LAST INDEX UPDATE(AUDIT)",
"1","03","CIFS","Enabled","","Disabled","Default (Collector's Schedule)","Status: FAILED (Fri Mar 02 01:00:38 PST 2018 [Took 31 sec])","Status: FAILED (Fri Mar 02 01:01:08 PST 2018 [Took 10 sec])","","",
"2","03OfficeStratPlanCM_Share","CIFS","Enabled","","Disabled","Default (Collector's Schedule)","Status: FAILED (Fri Mar 02 01:01:19 PST 2018 [Took 40 sec])","Status: FAILED (Fri Mar 02 01:00:07 PST 2018 [Took 28 sec])","","",
ID SHARE NAME SHARE TYPE STATUS PARALLEL THREAD COUNT LEGAL HOLD SCANNING SCHEDULE LAST FULL SCAN LAST INCREMENTAL SCAN LAST INDEX UPDATE(SCAN) LAST INDEX UPDATE(AUDIT)
5 Comm_Share CIFS Enabled Disabled Default (Collector's Schedule) Status: SUCCESSFUL (Fri Feb 16 01:01:28 EST 2018 [Took 2 sec]) Status: SUCCESSFUL (Fri Feb 16 01:00:05 EST 2018 [Took 24 sec]) Status:PASSED (Fri Feb 16 04:55:27 EST 2018)
9 Exec_Users CIFS Enabled Disabled Default (Collector's Schedule) Status: SUCCESSFUL (Fri Feb 16 01:12:11 EST 2018 [Took 10 min 25 sec]) Status: SUCCESSFUL (Fri Feb 16 01:00:06 EST 2018 [Took 35 sec]) Status:PASSED (Fri Feb 16 05:05:26 EST 2018)
You can then compare the data dumped without Audit to all data or customize the query to include those shares. From the database:sqlite> select device_ID,MSU_ID,sname,internal_prefix from MSu where msu_id in(
5,9,10,12,18,11,14,13,17,15,19,22,20,25,26,27,30,31,32,33,38,45,46,47,48,34,36,3
7,40,39,41,42,44,50,51,52,53,55,58,65,68,70,71,72,69,76,75,73,74,78,79,80,81,82,
83,84,93,85,86,87,88,89,90,91,92,94,95,101,102,97,99,100,103,104,105,106,108,112
,113,114,115,116,118,119,120,124,125,126,127,128,129,130,131,21,49,66,67,96,107,
117,123);
device_id|msu_id|sname|internal_prefix
1|5|Comm_Share|c:\fs\01\02\03\Comm\Share
1|9|Exec_Users|c:\fs\01\02\03\Executive\Mgrs\Users
1|10|02|c:\fs\01\02
1|11|Acct_Users|c:\fs\01\02\Dollars\Accounting\Users
Into a file that is comma-separated, this would likely be more useful, and easier to edit:C:\Program Files\DataInsight\bin>sqlite3 -csv C:\DataInsight\data\conf\config.db
.184 "select device_ID,MSU_ID,sname,internal_prefix from MSU where msu_id in(
5,9,10,12,18,11,14,13,17,15,19,22,20,25,26,27,30,31,32,33,38,45,46,47,48,34,36,3
7,40,39,41,42,44,50,51,52,53,55,58,65,68,70,71,72,69,76,75,73,74,78,79,80,81,82,
83,84,93,85,86,87,88,89,90,91,92,94,95,101,102,97,99,100,103,104,105,106,108,112
,113,114,115,116,118,119,120,124,125,126,127,128,129,130,131,21,49,66,67,96,107,
117,123);" >> c:\test\ShareList4Modify.csv
Example:1,5,Comm_Share,c:\fs\01\02\03\Comm\Share
1,9,Exec_Users,c:\fs\01\02\03\Executive\Mgrs\Users
1,10,02,c:\fs\01\02
1,11,Acct_Users,c:\fs\01\02\Dollars\Accounting\Users
1,12,AGR,c:\fs\01\02\03\AGR
1,13,Build_Users,c:\fs\01\02\03\Build\Users
1,14,Operator_Share,c:\fs\01\02\03\Operator\Share\Operatorshared
1,15,App_Share,c:\fs\01\02\Apple\Share
1,17,Admin_A_Users,c:\fs\01\02\03\Admin_A\Users
1,18,APPTS,c:\fs\01\02\03\Research\APPTS
1,19,AssetMgmT_Users,c:\fs\01\02\03\Asset_Mgmt\Users
1,20,Audit-file,c:\fs\01\.audit
You can create the new delete file by leaving in the file with the shares to be deleted and running the tool:C:\Program Files\DataInsight\jre\bin>java -jar C:\test\Dedupe_Shares\dup_shares.jar --delete --installdir D:\Program Files\dataInsight --input C:\test\ShareList4Delete.csv
Deleting share Comm_Share [Id : 5]
Share deleted successfully: 5
Mar 02, 2018 11:19:15 AM com.symc.matrix.dupshares.util.MatrixUtils deleteShare
INFO: Adding share Comm_Share to filer's exclude list ([*$, EE_2, GenMgr_Users, Account_Users])
Mar 02, 2018 11:19:15 AM com.symc.matrix.dupshares.util.MatrixUtils deleteShare
INFO: Setting new exclude list to: *$,EE_2,GenMgr_Users,Account_Users,Comm_Share
Mar 02, 2018 11:19:15 AM com.symc.matrix.dupshares.util.MatrixUtils setFilerProperty
INFO: Setting property filer.excludeShares for filer 1
Mar 02, 2018 11:19:15 AM com.symc.matrix.dupshares.util.MatrixUtils setFilerProperty
INFO: Property filer.excludeShares set successfully
Deleting share Exec_Users [Id : 9]
Share deleted successfully: 9
Mar 02, 2018 11:19:15 AM com.symc.matrix.dupshares.util.MatrixUtils deleteShare
INFO: Adding share Exec_Users to filer's exclude list ([*$, EE_2, GenMgr_Users, Account_Users, Comm_Share])
Mar 02, 2018 11:19:15 AM com.symc.matrix.dupshares.util.MatrixUtils deleteShare
INFO: Setting new exclude list to: *$,EE_2,GenMgr_Users,Account_Users,Comm_Share,Exec_Users
Mar 02, 2018 11:19:15 AM com.symc.matrix.dupshares.util.MatrixUtils setFilerProperty
INFO: Setting property filer.excludeShares for filer 1
Mar 02, 2018 11:19:15 AM com.symc.matrix.dupshares.util.MatrixUtils setFilerProperty
INFO: Property filer.excludeShares set successfully
Validate your work in the console under the filer's Monitored Shares tab and in the config.db obj_attributes and MSU tables via the DataDir Servlet in the UI