Forum Replies Created
-
AuthorReplies
-
I ended up writing a tcl script that parsed netconfig to cycle all active SMAT databases. It’s called via cron via a bash script that simply sets the environment. However, this could be run from Cloverleaf via scheduler without the bash wrapper. It uses the backend netconfig command that cloverleaf hasn’t really documented to parse each NetConfig file per site. Logging would have to be updated to your environment:
# Author: Jason Russell
# Description: Cycle all active SMAT databases.
#proc get_site_list { siteList } {
upvar $siteList slistset servini “$::env(HCIROOT)/server/server.ini”
set environs [exec grep environs $servini]
set siteFull [lindex [split $environs =] 1]
set siteFull [split $siteFull “;”]
set slist {}foreach siteDir $siteFull {
set site [lindex [split $siteDir “/”] end]
lappend slist $site
}
}# main Main MAIN
get_site_list siteList
set dts [clock format [clock scan now] -format “%D %T”]
lappend log “Cycling SMAT databases. DATE: $dts”foreach site $siteList {
netconfig load $::env(HCIROOT)/${site}/NetConfig
set threadList [netconfig get connection list]# Skip if NetConfig is blank.
if { [llength $threadList] eq 0 } { continue }
lappend log “\nCurrent Site: $site”foreach thread $threadList {
set threadData [netconfig get connection data $thread]
keylget threadData PROCESSNAME process
set inActive 0;keylget threadData SAVEMSGS.INSAVE inActive
set outActive 0;keylget threadData SAVEMSGS.OUTSAVE outActive# Cycle logs based on if SMAT is active.
set hcismatcycle “$::env(HCIROOT)/bin/hcismatcycle”
if { $inActive == 1 } {
exec $hcismatcycle -s $site -p $process -t $thread -b in
lappend log ” Process: $process Thread: $thread inbound”
}
if { $outActive == 1 } {
exec $hcismatcycle -s $site -p $process -t $thread -b out
lappend log ” Process: $process Thread: $thread outbound”
}}
}set fp [open /sitedata1/tmp/cycleSmat.log “w”]
puts $fp [join $log \n]
close $fpWell, that definitely aligns with my thought process and what I need to do. I appreciate it. It looks like I’ll be writing a more comprehensive script likely very close to what that one does.
I would suspect that’s your primary issue, especially for the GUI. If it’s not there the GUI won’t see it. This also gives an explanation to why other things aren’t working. Why it didn’t add it to your enviorns variable I can’t say. Your command looks pretty straight forward. If everything created correctly (netconfig and whatnot), I would add the site path manually to your server.ini, restart your engine and see if that fixes the issue (it’ll definitely fix the GUI).
Did the new site get added to the server.ini properly?
Has the engine (hciss) or server been restarted since the cloning?
Ok, that pretty much lines up with what I was thinking. My only question is there is a ‘sitecontrol’ command you have, is that just a custom command that makes it easier to use things like cycling logs/etc (rather than hcismatcycle)?
I’m going to piggyback off this conversation, how do you guys set your retention? Cloverleaf only wants to do file sized based cycling. If I have to, I will write a shell script to loop through sites, but this is one of my gripes with Cloverleaf is it’s difficult to do things from a global level. This requires ‘switching’ to each site, then running the command on each thread to cycle the logs. At that time the automatic removal can remove files older than whatever time frame.
So the short question: How are you cycling the databases so they will automatically be removed?
Is this happening on more than one site? This should be pretty site-specific. There’s a lot of points user entry. Make sure there’s no errant opening or closing braces in your upoc args. You shouldn’t have ANY opening or closing braces. . Can you post the netconfig? Someone can probably quickly see what is wrong.
I missed that. You’re correct:
set myklst [msgmetaget $mh DRIVERCTL]
keylget myklst FILENAME fileNamePretty sure I ganked that from another script before I understood keylget.
So I started up the audit log, and the only thing you can see is a user is granted permission on hcierrordb. It doesn’t show any commands run beyond that. There may be more logs I’m unaware of, but that’s the closest I found.
I don’t know that there is a log of these items. Audit log doesn’t seem to cover this (I could be wrong, ours is off). You’d have to have the audit log turned on in the first place. If your log is on, you can run hciauditlog from the command line in Linux, and in windows it’s supposed to be under start > tools.
I’m not sure how detailed the logs get. I might turn ours on just to see.
I don’t see anything particularly wrong with the code. How is it not working? What is the echo of the $base going in and the $newbase coming out?
The biggest issue I’m having, and it’s actually coming up in another script is it doens’t seem the setsite/setroot is actually doing anything. We have a global command line script via TCL and I’m doing some connection checking in another site, and the setsite/root doesn’t seem to work at all. As in my above example, I’m trying to change to a site to attempt to restart the engine, but that isn’t working. No logs in monitorD logs, alert logs, process logs. Just nothing. Echoing in the script doesnt’ return much either.
Yeah, CL matches pretty well (we don’t use the pdl-tcp, just the standard tcp connection). It’s connecting, but no ack, so I’m still thinking it’s an Epic issue they’re having.
That likely won’t help here as we’re not on segregated networks with no firewall between us. Do you know what the error was? Ours is saying we’re accessing the socket in a forbidden way. Sadly they’re dragging their feet on this.
-
AuthorReplies