Last active
July 17, 2019 13:05
-
-
Save jadbaz/de3a8f0ad1419370c32f833ef2f83562 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
header="<?xml version=\"1.0\" encoding=\"UTF-8\"?><ZenossEvents>" | |
line="<ZenossEvent><SourceComponent><device>$2</device></SourceComponent><summary>$4 - ###</summary><eventClassKey>GenericErrorKey</eventClassKey><component></component><severity>$3</severity></ZenossEvent>" | |
footer="</ZenossEvents>" | |
body="" | |
for i in `seq 1 $1`; do | |
this_line=$(echo $line | sed "s/###/$i/g") | |
body="${body}${this_line}" | |
done | |
xml="${header}${body}${footer}" | |
echo $xml |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment