Skip to content
This repository was archived by the owner on Sep 2, 2025. It is now read-only.

Commit 92a0bdb

Browse files
committed
remove MM name if alert and action are from the same MM
1 parent ccd195d commit 92a0bdb

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

list_actions.sh

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,15 +32,17 @@ echo "Analyzing $mm_name ($mm) ..."
3232
# line 6: extract action for alert with only danger alerts
3333
# line 7: replace action list xml with just MM/ActionName
3434
# line 8: truncate spaces
35+
# line 9: remove MM name if alert and action are from the same MM
3536

3637
echo 'cat /ManagementModule/DataGroups/DataGroup/AlertBase' | xmllint --shell ManagementModule.xml| \
3738
tr '\n' ' ' | sed 's/\-\-\-\-\-\-\-/\n/g' | \
3839
grep ActionID | \
3940
sed -E "s/^.+\<Name\>(.+)\<\/Name\>.+\<CautionActionList\>(.+)\<\/CautionActionList\>.+\<DangerActionList\>(.+)\<\/DangerActionList\>.+/$mm,$mm_name,\1,\2,\3/g" | \
4041
sed -E "s/^.+\<Name\>(.+)\<\/Name\>.+\<DangerActionList\>(.+)\<\/DangerActionList\>.+/$mm,$mm_name,\1,,\2/g" | \
41-
sed -E "s/^.+\<Name\>(.+)\<\/Name\>.+\<CautionActionList\>(.+)\<\/CautionActionList\>.+/$mm,$mm_name,\1,\2,/g" | \
42-
sed -E 's/\<ActionID\>[[:space:]]*\<ManagementModuleName\>([^\<]+)\<\/ManagementModuleName\>[[:space:]]*\<ConstructName\>([^\<]+)\<\/ConstructName\>[[:space:]]*\<\/ActionID\>/ \1\/\2/g' | \
43-
sed -E 's/[[:space:]]+/ /g' \
42+
sed -E "s/^.+\<Name\>(.+)\<\/Name\>.+\<CautionActionList\>(.+)\<\/CautionActionLiqst\>.+/$mm,$mm_name,\1,\2,/g" | \
43+
sed -E 's/[[:space:]]*\<ActionID\>[[:space:]]*\<ManagementModuleName\>([^\<]+)\<\/ManagementModuleName\>[[:space:]]*\<ConstructName\>([^\<]+)\<\/ConstructName\>[[:space:]]*\<\/ActionID\>[[:space:]]*/\"\1\/\2\" /g' | \
44+
sed -E 's/[[:space:]]+/ /g' | \
45+
sed -E "s/$mm_name\///g" \
4446
>> alert_actions.csv
4547

4648
rm -f ManagementModule.xml

0 commit comments

Comments
 (0)