Export and Delete Expired Actions
Log In or Register to download the BES file, and more.

0 Votes

Description

Action Parameters:

  <<  Enter the IEM Server Operator Name
    <<  Enter the IEM Server Operator Password (Note: This password will be encrypted)
 

_____________________________________________________________________________________________________

Description:

This task will export expired actions (10 at a time) then delete the actions from the console.

Exported actions will reside in C:\Import under as <actionID>.xml


Property Details

ID3754
StatusQA - Ready for Production Level Testing
TitleExport and Delete Expired Actions
DomainBESC
Sourcemike.english@us.ibm.com
Source Release Date11/19/2013 12:00:00 AM
KeywordsExport, Expired, Actions
Added by on 4/4/2014 8:05:48 AM
Last Modified by on 4/4/2014 8:05:48 AM
Counters 2973 Views / 52 Downloads
User Rating 1 star 2 star 3 star 4 star 5 star * Average over 1 rating. ** Log In or Register to add your rating.

Relevance

Used in 93 fixlets and 5 analyses   * Results in a true/false
Show indented relevance
exists main gather service
Used in 3 fixlets   * Results in a true/false
Show indented relevance
(if( name of operating system starts with "Win" ) then platform id of operating system != 3 else true) AND (if exists property "in proxy agent context" then ( not in proxy agent context ) else true )
Used in 71 fixlets and 6 analyses   * Results in a true/false
Show indented relevance
version of client >= "9.0"

Actions

Action 1 (default)

Action Link Click here to deploy this action.
Script Type BigFix Action Script
//Check for C:\Import
if {not exist folder "c:\import"}
    dos mkdir "c:\import"
endif

delete "c:\IMPORT\expiredactionIDs.xml"
delete "c:\import\expiredActionTuple.txt"
delete __appendfile

//login to API and obtain all expired action IDs
appendfile {preceding text of last "\" of (expand environment string of (image path of service "FILLDB")) & "\iem.exe%22"} login -q --server=localhost --user={parameter "RemoteOP" of action} --password={parameter "RemoteOPPass" of action}
appendfile {preceding text of last "\" of (expand environment string of (image path of service "FILLDB")) & "\iem.exe%22"} get query --relevance "(concatenation %%22, %%22 of (ids of bes actions whose (state of it = %%22Expired%%22)as string))" > c:\import\expiredactionIDs.xml

delete api.bat
copy __appendfile api.bat
waithidden api.bat

//Strip XML
delete __appendfile
appendfile {following text of first ">" of (preceding text of first "" of (lines of file "c:\import\expiredactionIDs.xml"))}
move __appendfile "c:\import\expiredActionTuple.txt"
delete "c:\IMPORT\result.xml"
delete "c:\import\expiredactions.xml"

//verify that tuple exists
if {exists tuple string item 0 of (concatenation ", " of (substrings separated by ", " of lines of file "c:\import\expiredActionTuple.txt" as string))}

appendfile {preceding text of last "\" of (expand environment string of (image path of service "FILLDB")) & "\iem.exe%22"} login -q --server=localhost --user={parameter "RemoteOP" of action} --password={parameter "RemoteOPPass" of action}
appendfile {preceding text of last "\" of (expand environment string of (image path of service "FILLDB")) & "\iem.exe%22"} get action/{tuple string item 0 of (concatenation ", " of (substrings separated by ", " of lines of file "c:\import\expiredactiontuple.txt" as string))} > c:\import\{tuple string item 0 of (concatenation ", " of (substrings separated by ", " of lines of file "c:\import\expiredactiontuple.txt" as string))}.xml
appendfile {preceding text of last "\" of (expand environment string of (image path of service "FILLDB")) & "\iem.exe%22"} delete action/{tuple string item 0 of (concatenation ", " of (substrings separated by ", " of lines of file "c:\import\expiredactiontuple.txt" as string))}
delete api.bat
copy __appendfile api.bat
waithidden api.bat
delete __appendfile

    if {exists tuple string item 1 of (concatenation ", " of (substrings separated by ", " of lines of file "c:\import\expiredActionTuple.txt" as string))}
    appendfile {following text of first ", " of lines of file "c:\import\expiredactiontuple.txt"}
    delete "c:\import\expiredActionTuple.txt"
    move __appendfile "c:\import\expiredActionTuple.txt"
    delete __appendfile
    endif

endif

//verify that tuple exists
if {exists tuple string item 0 of (concatenation ", " of (substrings separated by ", " of lines of file "c:\import\expiredActionTuple.txt" as string))}

appendfile {preceding text of last "\" of (expand environment string of (image path of service "FILLDB")) & "\iem.exe%22"} login -q --server=localhost --user={parameter "RemoteOP" of action} --password={parameter "RemoteOPPass" of action}
appendfile {preceding text of last "\" of (expand environment string of (image path of service "FILLDB")) & "\iem.exe%22"} get action/{tuple string item 0 of (concatenation ", " of (substrings separated by ", " of lines of file "c:\import\expiredactiontuple.txt" as string))} > c:\import\{tuple string item 0 of (concatenation ", " of (substrings separated by ", " of lines of file "c:\import\expiredactiontuple.txt" as string))}.xml
appendfile {preceding text of last "\" of (expand environment string of (image path of service "FILLDB")) & "\iem.exe%22"} delete action/{tuple string item 0 of (concatenation ", " of (substrings separated by ", " of lines of file "c:\import\expiredactiontuple.txt" as string))}
delete api.bat
copy __appendfile api.bat
waithidden api.bat
delete __appendfile

    if {exists tuple string item 1 of (concatenation ", " of (substrings separated by ", " of lines of file "c:\import\expiredActionTuple.txt" as string))}
    appendfile {following text of first ", " of lines of file "c:\import\expiredactiontuple.txt"}
    delete "c:\import\expiredActionTuple.txt"
    move __appendfile "c:\import\expiredActionTuple.txt"
    delete __appendfile
    endif

endif

//verify that tuple exists
if {exists tuple string item 0 of (concatenation ", " of (substrings separated by ", " of lines of file "c:\import\expiredActionTuple.txt" as string))}

appendfile {preceding text of last "\" of (expand environment string of (image path of service "FILLDB")) & "\iem.exe%22"} login -q --server=localhost --user={parameter "RemoteOP" of action} --password={parameter "RemoteOPPass" of action}
appendfile {preceding text of last "\" of (expand environment string of (image path of service "FILLDB")) & "\iem.exe%22"} get action/{tuple string item 0 of (concatenation ", " of (substrings separated by ", " of lines of file "c:\import\expiredactiontuple.txt" as string))} > c:\import\{tuple string item 0 of (concatenation ", " of (substrings separated by ", " of lines of file "c:\import\expiredactiontuple.txt" as string))}.xml
appendfile {preceding text of last "\" of (expand environment string of (image path of service "FILLDB")) & "\iem.exe%22"} delete action/{tuple string item 0 of (concatenation ", " of (substrings separated by ", " of lines of file "c:\import\expiredactiontuple.txt" as string))}
delete api.bat
copy __appendfile api.bat
waithidden api.bat
delete __appendfile

    if {exists tuple string item 1 of (concatenation ", " of (substrings separated by ", " of lines of file "c:\import\expiredActionTuple.txt" as string))}
    appendfile {following text of first ", " of lines of file "c:\import\expiredactiontuple.txt"}
    delete "c:\import\expiredActionTuple.txt"
    move __appendfile "c:\import\expiredActionTuple.txt"
    delete __appendfile
    endif

endif

//verify that tuple exists
if {exists tuple string item 0 of (concatenation ", " of (substrings separated by ", " of lines of file "c:\import\expiredActionTuple.txt" as string))}

appendfile {preceding text of last "\" of (expand environment string of (image path of service "FILLDB")) & "\iem.exe%22"} login -q --server=localhost --user={parameter "RemoteOP" of action} --password={parameter "RemoteOPPass" of action}
appendfile {preceding text of last "\" of (expand environment string of (image path of service "FILLDB")) & "\iem.exe%22"} get action/{tuple string item 0 of (concatenation ", " of (substrings separated by ", " of lines of file "c:\import\expiredactiontuple.txt" as string))} > c:\import\{tuple string item 0 of (concatenation ", " of (substrings separated by ", " of lines of file "c:\import\expiredactiontuple.txt" as string))}.xml
appendfile {preceding text of last "\" of (expand environment string of (image path of service "FILLDB")) & "\iem.exe%22"} delete action/{tuple string item 0 of (concatenation ", " of (substrings separated by ", " of lines of file "c:\import\expiredactiontuple.txt" as string))}
delete api.bat
copy __appendfile api.bat
waithidden api.bat
delete __appendfile

    if {exists tuple string item 1 of (concatenation ", " of (substrings separated by ", " of lines of file "c:\import\expiredActionTuple.txt" as string))}
    appendfile {following text of first ", " of lines of file "c:\import\expiredactiontuple.txt"}
    delete "c:\import\expiredActionTuple.txt"
    move __appendfile "c:\import\expiredActionTuple.txt"
    delete __appendfile
    endif

endif

//verify that tuple exists
if {exists tuple string item 0 of (concatenation ", " of (substrings separated by ", " of lines of file "c:\import\expiredActionTuple.txt" as string))}

appendfile {preceding text of last "\" of (expand environment string of (image path of service "FILLDB")) & "\iem.exe%22"} login -q --server=localhost --user={parameter "RemoteOP" of action} --password={parameter "RemoteOPPass" of action}
appendfile {preceding text of last "\" of (expand environment string of (image path of service "FILLDB")) & "\iem.exe%22"} get action/{tuple string item 0 of (concatenation ", " of (substrings separated by ", " of lines of file "c:\import\expiredactiontuple.txt" as string))} > c:\import\{tuple string item 0 of (concatenation ", " of (substrings separated by ", " of lines of file "c:\import\expiredactiontuple.txt" as string))}.xml
appendfile {preceding text of last "\" of (expand environment string of (image path of service "FILLDB")) & "\iem.exe%22"} delete action/{tuple string item 0 of (concatenation ", " of (substrings separated by ", " of lines of file "c:\import\expiredactiontuple.txt" as string))}
delete api.bat
copy __appendfile api.bat
waithidden api.bat
delete __appendfile

    if {exists tuple string item 1 of (concatenation ", " of (substrings separated by ", " of lines of file "c:\import\expiredActionTuple.txt" as string))}
    appendfile {following text of first ", " of lines of file "c:\import\expiredactiontuple.txt"}
    delete "c:\import\expiredActionTuple.txt"
    move __appendfile "c:\import\expiredActionTuple.txt"
    delete __appendfile
    endif

endif

//verify that tuple exists
if {exists tuple string item 0 of (concatenation ", " of (substrings separated by ", " of lines of file "c:\import\expiredActionTuple.txt" as string))}

appendfile {preceding text of last "\" of (expand environment string of (image path of service "FILLDB")) & "\iem.exe%22"} login -q --server=localhost --user={parameter "RemoteOP" of action} --password={parameter "RemoteOPPass" of action}
appendfile {preceding text of last "\" of (expand environment string of (image path of service "FILLDB")) & "\iem.exe%22"} get action/{tuple string item 0 of (concatenation ", " of (substrings separated by ", " of lines of file "c:\import\expiredactiontuple.txt" as string))} > c:\import\{tuple string item 0 of (concatenation ", " of (substrings separated by ", " of lines of file "c:\import\expiredactiontuple.txt" as string))}.xml
appendfile {preceding text of last "\" of (expand environment string of (image path of service "FILLDB")) & "\iem.exe%22"} delete action/{tuple string item 0 of (concatenation ", " of (substrings separated by ", " of lines of file "c:\import\expiredactiontuple.txt" as string))}
delete api.bat
copy __appendfile api.bat
waithidden api.bat
delete __appendfile

    if {exists tuple string item 1 of (concatenation ", " of (substrings separated by ", " of lines of file "c:\import\expiredActionTuple.txt" as string))}
    appendfile {following text of first ", " of lines of file "c:\import\expiredactiontuple.txt"}
    delete "c:\import\expiredActionTuple.txt"
    move __appendfile "c:\import\expiredActionTuple.txt"
    delete __appendfile
    endif

endif

//verify that tuple exists
if {exists tuple string item 0 of (concatenation ", " of (substrings separated by ", " of lines of file "c:\import\expiredActionTuple.txt" as string))}

appendfile {preceding text of last "\" of (expand environment string of (image path of service "FILLDB")) & "\iem.exe%22"} login -q --server=localhost --user={parameter "RemoteOP" of action} --password={parameter "RemoteOPPass" of action}
appendfile {preceding text of last "\" of (expand environment string of (image path of service "FILLDB")) & "\iem.exe%22"} get action/{tuple string item 0 of (concatenation ", " of (substrings separated by ", " of lines of file "c:\import\expiredactiontuple.txt" as string))} > c:\import\{tuple string item 0 of (concatenation ", " of (substrings separated by ", " of lines of file "c:\import\expiredactiontuple.txt" as string))}.xml
appendfile {preceding text of last "\" of (expand environment string of (image path of service "FILLDB")) & "\iem.exe%22"} delete action/{tuple string item 0 of (concatenation ", " of (substrings separated by ", " of lines of file "c:\import\expiredactiontuple.txt" as string))}
delete api.bat
copy __appendfile api.bat
waithidden api.bat
delete __appendfile

    if {exists tuple string item 1 of (concatenation ", " of (substrings separated by ", " of lines of file "c:\import\expiredActionTuple.txt" as string))}
    appendfile {following text of first ", " of lines of file "c:\import\expiredactiontuple.txt"}
    delete "c:\import\expiredActionTuple.txt"
    move __appendfile "c:\import\expiredActionTuple.txt"
    delete __appendfile
    endif

endif

//verify that tuple exists
if {exists tuple string item 0 of (concatenation ", " of (substrings separated by ", " of lines of file "c:\import\expiredActionTuple.txt" as string))}

appendfile {preceding text of last "\" of (expand environment string of (image path of service "FILLDB")) & "\iem.exe%22"} login -q --server=localhost --user={parameter "RemoteOP" of action} --password={parameter "RemoteOPPass" of action}
appendfile {preceding text of last "\" of (expand environment string of (image path of service "FILLDB")) & "\iem.exe%22"} get action/{tuple string item 0 of (concatenation ", " of (substrings separated by ", " of lines of file "c:\import\expiredactiontuple.txt" as string))} > c:\import\{tuple string item 0 of (concatenation ", " of (substrings separated by ", " of lines of file "c:\import\expiredactiontuple.txt" as string))}.xml
appendfile {preceding text of last "\" of (expand environment string of (image path of service "FILLDB")) & "\iem.exe%22"} delete action/{tuple string item 0 of (concatenation ", " of (substrings separated by ", " of lines of file "c:\import\expiredactiontuple.txt" as string))}
delete api.bat
copy __appendfile api.bat
waithidden api.bat
delete __appendfile

    if {exists tuple string item 1 of (concatenation ", " of (substrings separated by ", " of lines of file "c:\import\expiredActionTuple.txt" as string))}
    appendfile {following text of first ", " of lines of file "c:\import\expiredactiontuple.txt"}
    delete "c:\import\expiredActionTuple.txt"
    move __appendfile "c:\import\expiredActionTuple.txt"
    delete __appendfile
    endif

endif

//verify that tuple exists
if {exists tuple string item 0 of (concatenation ", " of (substrings separated by ", " of lines of file "c:\import\expiredActionTuple.txt" as string))}

appendfile {preceding text of last "\" of (expand environment string of (image path of service "FILLDB")) & "\iem.exe%22"} login -q --server=localhost --user={parameter "RemoteOP" of action} --password={parameter "RemoteOPPass" of action}
appendfile {preceding text of last "\" of (expand environment string of (image path of service "FILLDB")) & "\iem.exe%22"} get action/{tuple string item 0 of (concatenation ", " of (substrings separated by ", " of lines of file "c:\import\expiredactiontuple.txt" as string))} > c:\import\{tuple string item 0 of (concatenation ", " of (substrings separated by ", " of lines of file "c:\import\expiredactiontuple.txt" as string))}.xml
appendfile {preceding text of last "\" of (expand environment string of (image path of service "FILLDB")) & "\iem.exe%22"} delete action/{tuple string item 0 of (concatenation ", " of (substrings separated by ", " of lines of file "c:\import\expiredactiontuple.txt" as string))}
delete api.bat
copy __appendfile api.bat
waithidden api.bat
delete __appendfile

    if {exists tuple string item 1 of (concatenation ", " of (substrings separated by ", " of lines of file "c:\import\expiredActionTuple.txt" as string))}
    appendfile {following text of first ", " of lines of file "c:\import\expiredactiontuple.txt"}
    delete "c:\import\expiredActionTuple.txt"
    move __appendfile "c:\import\expiredActionTuple.txt"
    delete __appendfile
    endif

endif

//verify that tuple exists
if {exists tuple string item 0 of (concatenation ", " of (substrings separated by ", " of lines of file "c:\import\expiredActionTuple.txt" as string))}

appendfile {preceding text of last "\" of (expand environment string of (image path of service "FILLDB")) & "\iem.exe%22"} login -q --server=localhost --user={parameter "RemoteOP" of action} --password={parameter "RemoteOPPass" of action}
appendfile {preceding text of last "\" of (expand environment string of (image path of service "FILLDB")) & "\iem.exe%22"} get action/{tuple string item 0 of (concatenation ", " of (substrings separated by ", " of lines of file "c:\import\expiredactiontuple.txt" as string))} > c:\import\{tuple string item 0 of (concatenation ", " of (substrings separated by ", " of lines of file "c:\import\expiredactiontuple.txt" as string))}.xml
appendfile {preceding text of last "\" of (expand environment string of (image path of service "FILLDB")) & "\iem.exe%22"} delete action/{tuple string item 0 of (concatenation ", " of (substrings separated by ", " of lines of file "c:\import\expiredactiontuple.txt" as string))}
delete api.bat
copy __appendfile api.bat
waithidden api.bat
delete __appendfile

    if {exists tuple string item 1 of (concatenation ", " of (substrings separated by ", " of lines of file "c:\import\expiredActionTuple.txt" as string))}
    appendfile {following text of first ", " of lines of file "c:\import\expiredactiontuple.txt"}
    delete "c:\import\expiredActionTuple.txt"
    move __appendfile "c:\import\expiredActionTuple.txt"
    delete __appendfile
    endif

endif
Success Criteria

This action will be considered successful when the applicability relevance evaluates to false.


Sharing

Social Media:
Share this page on Yammer

Comments

Log In or Register to leave comments!
jgstew -
to save the expired actions for auditing I guess?
IanDM -
If re-imported actions lack the original target/endpoints and actual result history and are potentially active against multiple endpoints when imported - why save them? Other than seeing the action script there doesn't seem to be any value to keeping them?
Shalva -
Can you please help us with what would be the expected result from below relevance {following text of first ">" of (preceding text of first "" of (lines of file "c:\import\expiredactionIDs.xml"))}