Limiting action to single host

(imported topic written by NivS)

Hello all,

I am creating an action that adds a system ID to a configuration file and I want to limit the action to run against a single host each time.

Is it possible to achieve this?

If not, is it possible to create a pop-up message for the operator after clicking “Take Action”?

The basic form of the action is:

parameter “filename” = "C:\test.txt"
action parameter query “value” with description “Please enter the server’s System ID:”

appendfile {concatenation “%0d%0a” of lines of file (parameter “filename”) & “%0d%0a” & "systemid = " & (parameter “value”) & “%0d%0a”}

delete “{parameter “filename”}”

move __appendfile “{parameter “filename”}”

Thanks,

Niv

(imported comment written by SteveHull)

I think you’re asking if you can prevent the operator taking the action from selecting more than one computer as the target for the action, and the answer is no, not when taking an action against a fixlet or task directly. You could potentially create a custom dashboard that prompts the operator for the system ID and the name of the computer being targeted and then construct the action from the dashboard with the targeting already in place limited to that one system. There won’t be a general fixlet/task that the operator can deploy in that case, so they can only deploy what your dashboard allows. This is of course, significantly more advanced than just creating a custom fixlet.

The alternative you mention of prompting the operator can be done the same way you are prompting for the system ID. Add another

action parameter query "warning" with description "WARNING: Please make sure only one computer is selected when targeting this action"

Regards,

Steve

(imported comment written by NivS)

Prompting the operator with a query seems like the best option currently, thanks.