infor.com
concierge
infor u
developer portal
documentation central
customer center
Posts
Categories
Groups
ERPs
CSD
FSM/HRT
LN
M3
Syteline/ CSI
Hubs
Developer
Healthcare
Hospitality
Public Sector
Onboarding
Release Center
CloudSuites
Aerospace & Defense (LN)
Automotive (LN)
Chemicals (M3)
Corporate (FSM/HRT)
Distribution (Sx.e/CSD)
Distribution Enterprise (M3)
Engineering & Construction (LN)
Fashion (M3)
Food & Beverage (M3)
Healthcare (FSM/HRT)
Industrial (Syteline/CSI)
Industrial Enterprise (LN)
Manufacturing (M3)
Public Sector (FSM/HRT)
Solutions
Supply Chain Management (SCM)
Human Capital Management (HCM)
Events
Groups
User Groups
Your Groups
About
Email Community Support
Infor News
Migrated Forums
Home
Clovertech
Clovertech Archive
Cloverleaf
NetConfig extract "DEST" and "TRXID"
Joe kavanagh
Hello All,
Anyone have a script that can parse below the DATAXLATE and grab routes paired with the TRXID? I'm having an issue trying to parse that out, I'm pretty new to TCL. I've tried splitting by \n or \r or "{" and not able to grasp the data.
#grab threads
set siteconns [lsort [netcfgGetConnList]]
set output [open "~/temp/client_serv_list/$site.txt" "w"]
set sep "{"
foreach thread $siteconns {
set data [netcfgGetConnData $thread]
#set protocol {}; keylget data PROTOCOL.TYPE protocol
#set xlate {}; keylget data DATAXLATE xlate
set client {}; keylget data PROTOCOL.ISSERVER client
set multiSER {}; keylget data PROTOCOL.ISMULTI multiSER
set dataxlate {}; keylget data DATAXLATE dataxlate
set sections [split $dataxlate $sep]
set trxid [regexp {TRXID:\s*(\S+)} $sections ]
if {$client == 0 && $multiSER == 0} {
puts $output "Clients:$thread:$client"
}
if {$client == 1 || $multiSER == 1} {
puts $output "Servers:$thread:$client:$multiSER:$trxid"
}
}
#close file
close $output
Find more posts tagged with
Clovertech
Comments
Jim Kosloskey
If you are on a later release of Cloverleaf, you can use the NCI (NetConfig Interface I think) to extract info from the NetConfig. It is documented fairly well in help but if you want an example I can provide one email me if you want that.
If on older Cloverleaf, there is an undocumented set of commands. Others on Clovertech do that and will have examples. I do not use those functions.
Charlie Bursell
As Jim said you can use the NCI interface. The commands are in the online docs.
If me I would do something like: (Assuming you want current site NetConfig)
netconfig load $::HciSiteDir/NetConfig
foreach conn [netconfig get connection list] {
set data [netconfig get connection data $conn]
set klst [keylget data DATAXLATE]
foreach {full part} [regexp -all -inline {DEST (.*?)\}} $klst] {
echo THREAD $conn --> $part
}
}
Note: Only threads with destinations will be listed as others will return empty from regexp command
Note the use of the regexp inline command. To me, much easier than trying to drill down further as now you get into lists of keyed lists, etc.
I hope I did not misunderstand what you wanted. If so this will still give you a kick start.
Jim Vilbrandt
Hello Joe,
DATAXLATE is a single list with a list of 0-n routes and the routes contain lists of 0-n route details.
Get the list of routes:
set rteLst [lindex $dataxlate]
Then loop through the list looking for the fields you want:
foreach rte $rteLst {
keylget rte TRXID trxid
echo $trxid
}
Regards, Jim
Joe kavanagh
Thank you, yes if there are now commands used for version 19.1. Please let me know if not i will try the options above later on today. I appreciate the quick responses.
If you can send some of you examples, that would be greatly appreciated. The end results is to be able to run something like this and do some quick reviews of settings to make sure items are built correctly.
It wont let me put my email: joekavanagh889 hotmail.com
Jeff Dinsmore
We have some tools to read some NetConfig content - the stuff we've needed for our automation.
But this looked like fun so I played around with adding routing/xlate info as well.
Attached is a fairly complete example proc that will read NetConfig for a specified site.
usage: readNetConfigExt <site> <arrayName>
>>> something like: readNetConfigExt lab netConfigArray
There is also a proc to print what was read.
usage: printNetConfigExt <arrayName>
>>> something like: printNetConfigExt netConfigArray
netConfigReadExample.tcl