Forum Replies Created
-
AuthorReplies
-
The only thing that jumps out at me is that the thread name contains upper case letters. There’s a Best Practice document that states:
<td width=”107″>Naming Convention
<td width=”107″>Site, Process, and Threads
<td width=”292″>Always use lowercase letters for site, process and thread names.
<td width=”167″>Not required for other CL objects
But, we have threads with upper case names and it doesn’t bomb MonitorD.
Oh, sorry I left that one out. Source Count is set to Any.
We have an email alert set up for the error DB in all sites that will send an email to us if there are any entries in it. We don’t have any commands to shut down the threads, but here’s our config:
Alert Type: error database
Source: highlighted all threads
Comparing: > 0
Duration: once
Repeating: N minutes 90 Max: 2
Time Window: */5:30-17:30/*/*
It’s worked well for us for several years now. You might want to check with your email admin that the user is allowed to send emails in your network. That bit us a few times.
Sure, Jason. I’d like to see it when you get yours updated.
I’m not sure what happened with the tabs/spacing in the code. I tend to reuse code from other scripts so I could have copied some sections that used tab characters instead of spaces.
Script attached. Remove the file extension if using in a *nix environment.
Attachments:
You must be logged in to view attached files.We’ve been using the attached ksh (we’re on AIX 7.2) script to remove process logs older than 30 days for a while now. It doesn’t use any TCL scripts. We call the command from a cron job and write that output to a file in the hci user’s home directory. I use a similar script to clean up monitor daemon logs older than 30 days as well.
We have Log History set to keep up to 150 files and the folder size up to 1 GB. We also have the process configuration set to cycle logs after they reach 10 MB.
I’ve attached the script because I can’t figure out how to format the text so that it doesn’t look worse than it does in the script. It’s over-commented, but I forget how some commands work and like to have somewhere to remind myself.
I’ve commented out the rm command (which will delete files it’s presented) and the echo command just below it will return a list of the files that would be deleted.
Be careful with this if you aren’t sure what it is doing.
EDIT: Well, it wouldn’t let me upload the file – I assume because it has no extension. So, here’s the ugly pasted code:
#!/usr/bin/ksh#################################################################################################################################################################################################################### Name: delete_process_loghistory_all_sites_to_logfile#### Purpose: Delete LogHistory files, in each process directory, in all sites,## that are older than 30 days. BE CAREFUL WITH THIS!!!!#### Usage: delete_process_loghistory_all_sites_to_logfile#### Author: Jay Hammond#### Date: 06/02/2022####################################################################################################################################################################################################################echoSCRIPT=$(basename $0)script_start_time=$(date +”%B %e, %Y %T %Z %p”)echo “======================= $SCRIPT begin time: $script_start_time =======================”# Set fonts for Help text.# NORM=$(tput sgr0) # Normal# BOLD=$(tput bold) # Bold# REV=$(tput smso) # Reverse fore and background colors# UND=$(tput smul) # Underlinesites=$(ls $HCIROOT/*/NetConfig | awk -F\/ ‘{print $5}’ | grep -v siteProto| grep -v templates | grep -v -E “^$”)# Variablize the current site so we don’t have to hardcode it# current_site=$(echo $HCISITE)# Let’s setsite to the current site and print out the name# setsite $current_site# echo “==========${REV}$site${NORM}==========”# echo “”for site in $sites;dosetsite $siteechoecho “SITE: $site <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<“echo# Variablize the list of processes so that we can iterate through itprocess_list=$(grep “process ” $HCISITEDIR/NetConfig | awk ‘{print $2}’ | sort -d -f)# For each process in the list of this site’s processesfor process in $process_list;do# Set and variablize the loghistory_folder locationloghistory_folder=$HCISITEDIR/exec/processes/$process/LogHistory# Change Directory to the current process’s loghistory_foldercd $loghistory_folder# -d = True, if the specified file exists and is a directory.# If there’s a loghistory_folderif [ -d “${loghistory_folder}” ];then# -z = True, if length of the specified string is 0.# If the loghistory_folder is not emptyif [ ! -z $(ls -A $loghistory_folder) ];thenecho “PROCESS: $process”echo “Searching for LogHistory files in $loghistory_folder…”# Variablize the folder contents (’cause I’m lazy) to take action# based on what’s returned.files_found=$(find $HCISITEDIR/exec/processes/$process/LogHistory -type f)echo# -n = True, if the length of the specified string is nonzero.# If we don’t find any files in the folderif [ ! -n “${files_found}” ];thenecho “>>>>>>>>>>>>>>Search returned no LogHistory files for the $process process in the $site site.<<<<<<<<<<<<<<“echoelse# Variablize the lists of files to keep and to delete so that we can echo them out pretty.# In the current (.) directory, without recursing into any other folders that may be in the# current directory (\( -name . -o -prune \), find files with an extension containing err# or log (-regextype extended -iregex “.*err|.*log”), that are older than 30 days (-mtime +30)files_to_keep=$(find . \( -name . -o -prune \) -regextype extended -iregex “.*err|.*log” -mtime -30)files_to_delete=$(find . \( -name . -o -prune \) -regextype extended -iregex “.*err|.*log” -mtime +30)# -z = True, if length of the specified string is 0.# If the files_to_delete variable is not emptyif [ ! -z “${files_to_delete}” ];thenecho “The following files are older than 30 days and are being deleted:”echo “${files_to_delete}”echofor file in $files_to_delete;do# Echo each file nameecho “>>>>>>> $file is being deleted now:”echo# Remove files# -e = Displays a message after each file is deleted.# -f = Does not prompt before removing a write-protected file. Does not display an error message or return# error status if a specified file does not exist.# UNCOMMENT THE ‘rm -ef $file’ LINE TO ACTIVATE DELETING FILES IF YOU SO DESIRE AND ARE SURE YOU WANT THEM REMOVED# FOREVER. OTHERWISE, THE ECHO BELOW IT WILL JUST RETURN THE FILES THAT WOULD BE DELETED.# rm -ef $fileecho $fileechodoneelseecho “No files older than 30 days were found to delete for the $process process.”fi# -z = True, if length of the specified string is 0.# If the files_to_keep variable is not emptyif [ ! -z “${files_to_keep}” ];thenechoecho “These files to remain in the folder:”echo# For each file in the list of files_to_keepfor file in $files_to_keep;do# Echo each file nameecho $filedonefiechofielseecho “PROCESS: $process has a LogHistory folder, but it’s empty.”echofielseecho “PROCESS: $process does not have a LogHistory folder.”echofidonedoneecho- This reply was modified 3 weeks ago by Jay Hammond.
From the documentation:
Host Server Version Control tab
In some situations, the administrator must directly revise the configuration file’s version status. For doing this, the Server Administration tool has a a Version Control tab to list version records. Users can update the version status in this tab.
• Selecting Root lists the root-level version records.
• Selecting Site enables the site name list. When a user selects a site from the list, the tab shows the specified site’s version records.The administrator can revise the configuration file’s version status by these actions:
• Selecting Unlock to unlock the selected configuration entries.
• Selecting Remove to remove the selected configuration entries. All history version records of the selected configurations are removed from the version database and folder.
• Selecting Refresh to reload the table components.Admins are able to unlock versioned files in this case (we’re on Version 20.1). In the hciserveradmin GUI, in the Version Control tab. See the attached screenshot.
Attachments:
You must be logged in to view attached files.Very cool! Thank you, Robert.
I have one site listed thrice (willow_pharmacy) as well as another listed twice (vcloverleafdeva1) like your list:
<p style=”padding-left: 40px;”>$ ps -ef | grep -i -e hcimon -e stime | grep -v grep
UID PID PPID C STIME TTY TIME CMD
hci 14352792 1 0 May 18 – 15:06 /hci/cis20.1/integrator/bin/hcimonitord -cl default.alrt -S hcidev_in
hci 14614886 1 0 May 18 – 1:01 /hci/cis20.1/integrator/bin/hcimonitord -cl default.alrt -S acc_reg_cycle
hci 22806974 1 0 May 18 – 0:28 /hci/cis20.1/integrator/bin/hcimonitord -cl default.alrt -S vcloverleafdeva1
hci 24314290 1 0 May 18 – 0:48 /hci/cis20.1/integrator/bin/hcimonitord -S willow_pharmacy
hci 24838534 1 0 May 18 – 0:37 /hci/cis20.1/integrator/bin/hcimonitord -cl default.alrt -S education
hci 25297248 1 0 May 18 – 1:05 /hci/cis20.1/integrator/bin/hcimonitord -cl default.alrt -S hcidev_tst2
hci 26476944 1 0 May 18 – 1:10 /hci/cis20.1/integrator/bin/hcimonitord -cl default.alrt -S him
hci 28836296 1 0 May 18 – 1:44 /hci/cis20.1/integrator/bin/hcimonitord -cl disabled_alerts.alrt -S willow_pharmacy
hci 5112428 1 0 May 18 – 0:28 /hci/cis20.1/integrator/bin/hcimonitord -cl disabled_alerts.alrt -S vcloverleafdeva1
hci 5636802 1 0 May 18 – 0:25 /hci/cis20.1/integrator/bin/hcimonitord -cl default.alrt -S resource_management
hci 7078568 1 0 May 18 – 5:24 /hci/cis20.1/integrator/bin/hcimonitord -cl default.alrt -S hoke
hci 9437764 1 0 May 18 – 0:38 /hci/cis20.1/integrator/bin/hcimonitord -cl default.alrt -S midas
hci 9765398 1 0 May 18 – 1:04 /hci/cis20.1/integrator/bin/hcimonitord -cl default.alrt -S hcidev_documents
hci 14156540 1 0 May 18 – 1:29 /hci/cis20.1/integrator/bin/hcimonitord -cl default.alrt -S hcidev_device_int
hci 15270416 1 0 May 18 – 1:13 /hci/cis20.1/integrator/bin/hcimonitord -cl default.alrt -S hcidev_cupid_rad
hci 15991426 1 0 May 18 – 23:48 /hci/cis20.1/integrator/bin/hcimonitord -cl default.alrt -S hcidev_out
hci 17826444 1 0 May 18 – 7:10 /hci/cis20.1/integrator/bin/hcimonitord -cl default.alrt -S hcidev_adt_mfn_chgs
hci 21168758 1 0 May 18 – 3:02 /hci/cis20.1/integrator/bin/hcimonitord -cl default.alrt -S hcidev_ord_res
hci 23331492 1 0 12:20:40 – 0:00 /hci/cis20.1/integrator/bin/hcimonitord -S willow_pharmacy
hci 24314620 1 0 May 18 – 1:05 /hci/cis20.1/integrator/bin/hcimonitord -cl default.alrt -S hcidev_case_mgnt
hci 26215024 1 0 May 18 – 3:28 /hci/cis20.1/integrator/bin/hcimonitord -cl default.alrt -S hcidev_beaker
hci 29360820 1 0 May 18 – 0:39 /hci/cis20.1/integrator/bin/hcimonitord -cl default.alrt -S hcidev_labor_deliv</p>
After a bit of digging, it looks like the sites listed twice may be due to a manual stop/start of the monitor daemon. And the process isn’t removed from the list?On the 18th, I was testing out starting/stopping monD with different *.alrt files; I guess that’s why those show up multiple times in the list with -cl <alert_name>. I tried stopping monD in the willow_pharmacy site and the most recent entry was removed until I restarted and it showed again. I also tried stopping/starting the host server for shiggles, but that didn’t change anything either.
Also appears that maybe Linux and AIX list things slightly differently (e.g. AIX is showing -cl <alert_name> for all sites) which isn’t surprising.
Thank you, Tim! That will definitely work. I was just hoping there was something I couldn’t find with the hcisitectl (or any other) command that would return the active file name for a quick look.
Does this get what you’re looking for:
hcigvt
This command is used to access the global variables.hcigvt {add|del|get|set|show} [varname] [varvalue] [isencrypted]
add – adds the global variable to the variable table.
del – deletes the global variable name from the variable table.
get – prints the global variable value of varname.
set – sets the global variable value of varname to a new value.
show – shows all the variable names and values in local site.
varname is the global variable name.
varvalue is the global variable value.
isencrypted determines if the global variable must be encrypted in the ini file.
1 indicates it is encrypted.
0 indicates it is not encrypted. This is the default.
For example:C:\cloverleaf\cis6.3\integrator\bin>hcigvt show
- This reply was modified 1 year, 8 months ago by Jay Hammond.
- This reply was modified 1 year, 8 months ago by Jay Hammond.
- This reply was modified 1 year, 8 months ago by Jay Hammond.
April 24, 2023 at 9:33 am in reply to: Parse siteInfo to extract SMAT and Log Retention Periods #120503I’ve attached a couple that I use from time to time to pull at least some of the info that you’re looking for.
- This reply was modified 1 year, 9 months ago by Jay Hammond.
Attachments:
You must be logged in to view attached files.I agree.
There’s also a place on the Infor Concierge to enter and vote on enhancements, though I don’t know if many people use it. I have entered a couple and the status on them changed from Received to In Review or something. I can’t tell right now because the Enhancements page won’t load on the Concierge site (which seems to happen a lot), lol. I’ve attached a screenshot of where it’s located on that site.
Attachments:
You must be logged in to view attached files.I’ll be. It’s so simple. Thank you very much!
-
AuthorReplies