Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
cloud-infrastructure
data-analytics
Commits
ebb64123
Commit
ebb64123
authored
Apr 30, 2021
by
smetaj
Browse files
config file plugin filter modified
parent
21dd2b3b
Changes
3
Hide whitespace changes
Inline
Side-by-side
etl/spark_etl/etl_steps.py
View file @
ebb64123
...
...
@@ -608,17 +608,9 @@ def _keep_only_these_plugins_and_hg(df, plugins, hostgroups):
# filter all the plugin individually
for
k
in
plugins
.
keys
():
plugin_dict
=
plugins
[
k
]
# for all attributes of this plugin
and_conditions
=
[]
filters
=
plugin_dict
[
'plugin_filters'
]
filters
[
"plugin"
]
=
filters
.
pop
(
"plugin_name"
)
for
sub_k
in
filters
.
keys
():
value
=
filters
[
sub_k
]
and_conditions
.
append
(
sub_k
+
" == '"
+
value
+
"'"
)
plg_condition
=
"( "
+
" and "
.
join
(
and_conditions
)
+
" )"
# print("plg_condition: ", plg_condition)
or_conditions
.
append
(
plg_condition
)
# print("or_conditions: ", or_conditions)
plg_filter
=
"( "
+
plugin_dict
[
'plugin_filter'
]
+
" )"
or_conditions
.
append
(
plg_filter
)
# filter all interested line
filter_str
=
" or "
.
join
(
or_conditions
)
...
...
tests/adcern/integration/adcern_cfg_test.json
View file @
ebb64123
...
...
@@ -20,46 +20,23 @@
"selected_plugins"
:
{
"load_longterm"
:
{
"plugin_data_path"
:
"/project/monitoring/collectd/load"
,
"plugin_filters"
:
{
"value_instance"
:
"longterm"
,
"plugin_name"
:
"load"
}
"plugin_filter"
:
"value_instance == 'longterm' and plugin == 'load'"
},
"cpu__percent_idle"
:
{
"plugin_data_path"
:
"/project/monitoring/collectd/cpu"
,
"plugin_filters"
:
{
"plugin_instance"
:
""
,
"type"
:
"percent"
,
"type_instance"
:
"idle"
,
"plugin_name"
:
"cpu"
}
"plugin_filter"
:
"type == 'percent' and type_instance == 'idle' and plugin == 'cpu'"
},
"memory__memory_free"
:
{
"plugin_data_path"
:
"/project/monitoring/collectd/memory"
,
"plugin_filters"
:
{
"plugin_instance"
:
""
,
"type"
:
"memory"
,
"type_instance"
:
"free"
,
"plugin_name"
:
"memory"
}
"plugin_filter"
:
"type == 'memory' and type_instance == 'free' and plugin == 'memory'"
},
"vmem__vmpage_io_memory_in"
:
{
"plugin_data_path"
:
"/project/monitoring/collectd/vmem"
,
"plugin_filters"
:
{
"plugin_instance"
:
""
,
"type"
:
"vmpage_io"
,
"type_instance"
:
"memory"
,
"value_instance"
:
"in"
,
"plugin_name"
:
"vmem"
}
"plugin_filter"
:
"type == 'vmpage_io' and type_instance == 'memory' and value_instance == 'in' and plugin == 'vmem'"
},
"swap_swapfile_swap_free"
:
{
"plugin_data_path"
:
"/project/monitoring/collectd/swap"
,
"plugin_filters"
:
{
"type"
:
"swap"
,
"type_instance"
:
"free"
,
"plugin_name"
:
"swap"
}
"plugin_filter"
:
"type == 'swap' and type_instance == 'free' and plugin == 'swap'"
}
}
}
\ No newline at end of file
tests/adcern/integration/adcern_cfg_train.json
View file @
ebb64123
...
...
@@ -20,46 +20,23 @@
"selected_plugins"
:
{
"load_longterm"
:
{
"plugin_data_path"
:
"/project/monitoring/collectd/load"
,
"plugin_filters"
:
{
"value_instance"
:
"longterm"
,
"plugin_name"
:
"load"
}
"plugin_filter"
:
"value_instance == 'longterm' and plugin == 'load'"
},
"cpu__percent_idle"
:
{
"plugin_data_path"
:
"/project/monitoring/collectd/cpu"
,
"plugin_filters"
:
{
"plugin_instance"
:
""
,
"type"
:
"percent"
,
"type_instance"
:
"idle"
,
"plugin_name"
:
"cpu"
}
"plugin_filter"
:
"type == 'percent' and type_instance == 'idle' and plugin == 'cpu'"
},
"memory__memory_free"
:
{
"plugin_data_path"
:
"/project/monitoring/collectd/memory"
,
"plugin_filters"
:
{
"plugin_instance"
:
""
,
"type"
:
"memory"
,
"type_instance"
:
"free"
,
"plugin_name"
:
"memory"
}
"plugin_filter"
:
"type == 'memory' and type_instance == 'free' and plugin == 'memory'"
},
"vmem__vmpage_io_memory_in"
:
{
"plugin_data_path"
:
"/project/monitoring/collectd/vmem"
,
"plugin_filters"
:
{
"plugin_instance"
:
""
,
"type"
:
"vmpage_io"
,
"type_instance"
:
"memory"
,
"value_instance"
:
"in"
,
"plugin_name"
:
"vmem"
}
"plugin_filter"
:
"type == 'vmpage_io' and type_instance == 'memory' and value_instance == 'in' and plugin == 'vmem'"
},
"swap_swapfile_swap_free"
:
{
"plugin_data_path"
:
"/project/monitoring/collectd/swap"
,
"plugin_filters"
:
{
"type"
:
"swap"
,
"type_instance"
:
"free"
,
"plugin_name"
:
"swap"
}
"plugin_filter"
:
"type == 'swap' and type_instance == 'free' and plugin == 'swap'"
}
}
}
\ No newline at end of file
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment