I was given a Hotfix by IBM when we were investigating a memory utilisation problem with IBM Security Verify Access (ISVA, formerly IBM Security Access Manager, ISAM), earlier this year. This Hotfix generated a set of resource monitor diagnostic files every 20 minutes, so it wasn’t long before I had hundreds of files to download and send to IBM. I would have lost patience downloading the files manually using the LMI, so here is the script that I wrote to do the job, in case it’s of use to anyone. (It is very quick and dirty, and it could definitely be improved, but it worked and saved me a lot of pointing and clicking!)
#!/bin/bash
# Download ISAM application log files
# Derived from ideas in this link: https://www.ibm.com/support/pages/node/6590395
# Vaughan Harper, January 2023
# It is necessary to specify the username, password, and hostname of the LMI
# <user name>:<password>:
UP=admin@local:<password>
#Hostname of LMI:
LMI=myisam.mycompany.com
# First get list of available files:
curl -k -s -H 'Accept: application/json' --user "$UP" "https://$LMI/isam/application_logs/management_ui/resource_monitor_logs" > file.list
# Now download the files one-by-one
# Note that the '+' character in the filenames needs to be converted to '%2B'
for row in $(jq -r '.contents[]|.name' file.list); do
_jq() {
echo ${row}
}
echo Filename: $(_jq '.contents[]|.name' |sed 's/+/%2B/g')
curl -v -k -O -J --user "$UP" "https://$LMI/isam/application_logs/management_ui/resource_monitor_logs/$(_jq '.contents[]|.name' |sed 's/+/%2B/g')?type=File"
done
Vaughan
Leave a Reply