Hi Steve, thanks for that tip. We currently have 108 shares and I believe about 100 are no longer needed, so for the moment I need to verify which are no longer used and remove them. Once I get them cleaned up I will turn that on to log access.
To get an idea of usage I'm running an SQL statement every 15 minutes to grab connections and write them to a file with a cumulative total of connects.
If anyone else is struggling with this my code to pull your current shares looks like this, I'm not a coder so apologies in advance if it's not the best!
select server_share_name, path_name, permissions
from qsys2.server_share_info
where share_type = 'FILE'
I created the file with an initial run, and now my code to pull the connections and write them to my file looks like this:
MERGE INTO mylibrary.netsrv1 target USING (
SELECT server_share_name,
share_type,
text_description,
path_name,
permissions,
current_connections
FROM qsys2.SERVER_SHARE_INFO
) source ON source.server_share_name = target.server_share_name
WHEN NOT MATCHED THEN INSERT VALUES (
source.server_share_name,
source.share_type,
source.text_description,
source.path_name,
source.permissions,
source.current_connections
)
WHEN MATCHED THEN UPDATE SET current_connections = source.current_connections +
target.current_connections
Then when I want to see which connections had any usage I run this:
Select * from mylibrary.netsrv1 where current_connections > 0
------------------------------
<><><><><><><><><><>
Jeffery Green
Sr. Systems Engineer
IBM Power / IBM i
<><><><><><><><><><>
------------------------------
Original Message:
Sent: Thu July 07, 2022 08:37 AM
From: Steve Pitcher
Subject: Netserver Share Access Log
Hi Jeffery,
If you're on 7.4 or higher, you can always turn on authority collection for the directory shared, then review the connections in qsys2.authority_collection_fsobj for QLZSFILE/QZLSFILET jobs.
Steve
------------------------------
Steve Pitcher
Original Message:
Sent: Wed July 06, 2022 10:39 AM
From: Jeffery Green
Subject: Netserver Share Access Log
Hi Bryan, thanks for that. I've been looking at making an exit point program since Jack pointed it out and I'm not sure it's a good idea. I ran a 24 stats gather on Netserver and we had 3.5 million accesses in that time. My concern is that an exit point program could slow things down quite a bit with all those calls so now I'm looking at possibly just gathering data from the SERVER_SHARE_INFO view on a schedule to see overall usage. Any thoughts?
------------------------------
<><><><><><><><><><>
Jeffery Green
Sr. Systems Engineer
IBM Power / IBM i
<><><><><><><><><><>
Original Message:
Sent: Wed July 06, 2022 08:16 AM
From: Bryan Dietz
Subject: Netserver Share Access Log
I think you'll want to look into the exit point QIBM_QPWFS_FILE_SERV.
a web search should return some example code you can use for your needs.
------------------------------
Bryan Dietz
Original Message:
Sent: Fri July 01, 2022 01:29 PM
From: Alexander Marquis
Subject: Netserver Share Access Log
Hi Jeffrey,
You might find a lot of that information in the CPIAD12 messages in the QZLSFILET job log.
Unfortunately, the share being accessed is not in that message. You can see current shares by looking at the NetServer session list:
https://www.ibm.com/docs/en/i/7.4?topic=netserver-viewing-i-session-connection-status
Alternatively, SERVER_SHARE_INFO view:
https://www.ibm.com/docs/en/i/7.4?topic=services-server-share-info-view
You might want to vote for these "ideas" :
https://ibm-power-systems.ideas.ibm.com/ideas/IBMI-I-2558
https://ibm-power-systems.ideas.ibm.com/ideas/IBMI-I-2830
Regards,
Alex
------------------------------
Alexander Marquis
Original Message:
Sent: Thu June 30, 2022 02:48 PM
From: Jeffery Green
Subject: Netserver Share Access Log
I'm looking for an existing log or a way to create a log of access to Netserver file shares. Ideally I would like user ID, source IP and share activity with a date/time stamp. Any ideas out there?
------------------------------
<><><><><><><><><><>
Jeffery Green
Sr. Systems Engineer
IBM Power / IBM i
<><><><><><><><><><>
------------------------------