Skip to content

Instantly share code, notes, and snippets.

@forstie
Created June 30, 2022 15:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save forstie/b003426215fddcd1eccf9c7e2db3d9cd to your computer and use it in GitHub Desktop.
Save forstie/b003426215fddcd1eccf9c7e2db3d9cd to your computer and use it in GitHub Desktop.
The request... find an alternative to STRSST for monitoring AUINTERNALS security limits
--
-- Subject: The request... find an alternative to STRSST for monitoring security limits
-- Author: Scott Forstie
-- Date : June, 2022
-- Features Used : This Gist uses qsys2.user_storage
--
-- Background: We need to see user profiles trending and approaching limits!
-- Some important system limits information is only found within the bowels of the
-- operating system and accessed via Start System Service Tools (STRSST).
--
-- The IBM i 7.5 operating system release includes many security related enhancements,
-- including one that applies here. QSYS2.USER_STORAGE for the win!
--
-- ==========================================
-- Prior to IBM i 7.5
-- ==========================================
--
-- Enter Start System Service Tools (STRSST)
-- ==========================================
-- 1. Start a service tool
-- 4. Display/Alter/Dump
-- 1. Display/Alter storage
-- 2. Licensed Internal Code (LIC) data
-- 14. Advanced analysis
-- 1 AUINTERNALS
-- example 1 : ENTRYCOUNTS SYSBAS FILTER 20
--
stop;
-- ==========================================
-- With IBM i 7.5
-- ==========================================
--
--
-- category: IBM i Services
-- description: Display the user profiles that have consumed over 20% of their total entries available
-- minvrm: V7R5M0
--
select USER_NAME, dec(dec(total_ent) / dec(avail_ent) * 100, 4, 2) as Pct, TOTAL_ENT,
OWN_ENT, PRIV_ENT, USER_ENT, PGP_ENT, AVAIL_TEMP, TOTAL_TEMP, OWN_TEMP, PRIV_TEMP, USER_TEMP,
PGP_TEMP, STGUSED, AVAIL_ENT, ASPGRP, MAXSTG
from qsys2.user_storage where aspgrp = '*SYSBAS' and
dec(dec(total_ent) / dec(avail_ent) * 100, 4, 2) > 20.0
order by pct desc;
stop;
-- category: IBM i Services
-- description: Which users own the most objects?
-- minvrm: V7R5M0
--
select user_name, sum(OWNER_ENTRIES) as objs_owned
from qsys2.user_storage
group by user_name
order by 2 desc;
stop;
@joycepittman
Copy link

This is really cool! Thank you.

Might the SST security settings also be made available?
Values under option 7 Change Allow system value security changes and SST password level are of interest for audit and security managment.

@kpnicolas
Copy link

does this work in 7.4? And if it doesn't work, how could I do this in 7.4?

@forstie
Copy link
Author

forstie commented Mar 1, 2024

This gist requires IBM i 7.5 or higher.
To see this information on IBM i 7.4, follow the STRSST instructions in the gist.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment