Kaseya Community

Creating View based on result of script

  • Is there a way to create a view based on the result of a the script you are looking at? I know you can create a view on a specific script based on success or failure of that named script. But, it does not distinguish between Success THEN and Success ELSE, and you have to pick the script it is for.

    What I'm looking for is:

    Click on a script (any script), be able to either sort or filter on the last result of the script I'm looking at. That way I can easily find any machines that have Success ELSE (failed our criteria for running the script, but not FAILED in that the script failed to run).

    Example:

    Look to see if a file exists on 50 machines. 40 have it, so they have Success THEN, 10 don't, so they have Success ELSE. I want an easy way to find the 10 that don't have the file, without having to scan through 50 records looking and possibly missing them.

    We are still on 4.8 if that makes any difference.

    Thanks,
    Rich

    Legacy Forum Name: Creating View based on result of script,
    Legacy Posted By Username: rkniffin
  • Break your script into 3 scripts. The master script is your current script. Create a second one that contains the steps in your current script's THEN section. Create a third script that contains the steps in your current script's ELSE section. Change the master script to just call those scripts - the second one in the THEN section and the third one in the ELSE section. Then, create your view based on either the second or third script (depending on what you're looking for).

    Legacy Forum Name: Scripts Forum,
    Legacy Posted By Username: RCS-Michael
  • Thanks. I thought about that as an option. I'd like to avoid having to create an extra script each time I want to accomplish this. It seems like the only viable option at this point, though.

    Kaseya, you already have the ability to filter on Success or Failure of a script. Can you add Success THEN, Success ELSE, and FAILURE as options under views?

    Low priority request given current issues with 2008. But it would be nice to have.

    Thanks,
    Rich

    Legacy Forum Name: Scripts Forum,
    Legacy Posted By Username: rkniffin
  • rkniffin
    Thanks. I thought about that as an option. I'd like to avoid having to create an extra script each time I want to accomplish this. It seems like the only viable option at this point, though.

    Kaseya, you already have the ability to filter on Success or Failure of a script. Can you add Success THEN, Success ELSE, and FAILURE as options under views?

    Low priority request given current issues with 2008. But it would be nice to have.

    Thanks,
    Rich


    Rich,
    I think this would be a good feature request. There's a specific feature request portion of this forum. Post there with a link back to this thread so that Kaseya will see it.

    Michael

    Legacy Forum Name: Scripts Forum,
    Legacy Posted By Username: RCS-Michael
  • A work around is to add a step & use the function "Execute a Script", & select the script itself. This causes the script to fail (a script cannot execute itself - unless you use a delay). You can then setup a view to display all machines that ran the script & failed.

    You can put the "Execute Script" step in the Then or Else section of the script depending on what suits your needs.

    It's not elegant, but we use this approach extensively.

    This work around is also useful where you need a script to end at a certain point & you do not want it to return to the calling script.

    Cheers, Ian

    Legacy Forum Name: Scripts Forum,
    Legacy Posted By Username: TechOnline
  • We didn't see a way to make a script fail. I'll give that a try. Thanks for the tip.

    Rich

    Legacy Forum Name: Scripts Forum,
    Legacy Posted By Username: rkniffin
  • That gets me most of the way there. You still have to edit the view and select the specific script you want it to work with. It won't just work with the current script you happen to be looking at. Again, thanks for the help.

    Rich

    Legacy Forum Name: Scripts Forum,
    Legacy Posted By Username: rkniffin