Hi,
Firstly I have to admit, I’m a bit lost here… I’ve tried to pull settings and figured out a lot, but I have failed to keeping the settings grouped together and elements intact. I’m not that familiar with loops, but have used them a bit. This task seems a bit overwhelming and would require a lot of manual work or some clever KNIMEing with loops running loops ? I dont know anymore Please Obiwan Kenobi…
…
I have a configuration files from CA UIM (a system monitoring system) and I would need to parse the settings that are in use.
It has a lot of different elements in them, templates and defaults, which are then referenced in the actual named entities(servers etc) configuration.
Most of the files have this same structure:
<setup>
setting1 = x
setting2 = y
...
setting n = n
</setup>
<section A>
something = a
<subsection a1>
...
</subsection a1>
</section A>
<section B>
something = a
<subsection b1>
...
</subsection b1>
</section B>
What I would like is to have all those lines grouped by different level of sections, filter some of them out.
Filtering would be best to do by the element, like “section B” completely out from the list.
I tried to group them with “Rule Engine” => Append Column : GroupID" => “missing value: Append previous value to GroupID”, but it flattened the whole tree in to single level.
So what I figured was to group those “sections” or elements by the parent element:
Example of the conf file (I reducted a bit):
Setup is just one root level element, there are a lot of them.
First thing would be to figure out how to group everything under each root level element ? Right ?
Then how to handle each group to have sub groups under them, then split them up and filter the settings and then gather them to lists ?
I would like to be able to select any element and list it’s settings, so that I can separately list any of the templates (a group of elements with subsections) and settings, and the elements that have used them (referenced).
rsp.cfg:
<setup>
loglevel = 2
logsize = 50000
plink = plink.exe
wmi = NA
threads = 200
consumer_threads = 100
db_keep_hrs = 2
...
<qos>
<cpu>
name = QOS_CPU_USAGE
group = QOS_MACHINE
description = CPU Usage
unit = Percent
short = %
hasmax = 1
bool = 0
dynamic_variables = used_pct,average
</cpu>
<cpu_multi>
name = QOS_CPU_MULTI_USAGE
group = QOS_MACHINE
description = Individual CPU Usage
unit = Percent
short = %
hasmax = 1
bool = 0
dynamic_variables = cpuid,average
</cpu_multi>
<disk_mb>
name = QOS_DISK_USAGE
group = QOS_MACHINE
description = Disk Usage
unit = Megabytes
short = MB
hasmax = 1
bool = 0
dynamic_variables = avg_value
</disk_mb>
<disk_pct>
name = QOS_DISK_USAGE_PERC
group = QOS_MACHINE
description = Disk Usage (%)
unit = Percent
short = %
hasmax = 1
bool = 0
dynamic_variables = avg_value
</disk_pct>
<memory>
name = QOS_MEMORY_USAGE
group = QOS_MACHINE
description = Memory Usage
unit = Megabytes
short = MB
hasmax = 1
bool = 0
</memory>
...
</qos>
<credentials>
</credentials>
</setup>
Another example of a service under a server, that’s being monitored. Here the root element is the server, then processes and then the actual process:
<servername>
active = yes
<processes>
active = yes
<PartialTransferService.exe>
name = PartialTransferService.exe
instance = yes
qos_cpu_usage = no
qos_instance = no
qos_mem_usage = no
qos_state = no
qos_threads = no
pid = 1160
process_desc = Monitoring PartialTransferService.exe
<process_owner>
active = no
level = 3
msgtoken = process_owner
threshold = NT AUTHORITY\SYSTEM
condition = =
</process_owner>
<process_cpu_usage>
active = no
level = 3
msgtoken = process_cpu_usage
threshold = 0.000000
condition = =
</process_cpu_usage>
<process_size>
active = no
level = 3
msgtoken = process_size
threshold = 872
condition = =
</process_size>
<process_thread_count>
active = no
level = 3
msgtoken = process_thread_count
threshold = 3
condition = =
</process_thread_count>
<process_instance>
active = no
level = 3
msgtoken = process_instance
threshold =
condition = =
</process_instance>
<process_up>
active = no
level = 3
msgtoken = process_up
threshold = 1
condition = =
</process_up>
<process_down>
active = yes
level = 5
msgtoken = process_down
threshold = 0
condition = =
</process_down>
</processes>
</servername>
Any advise would be amazing… I’m about to quit on this totally…