Kaseya Community

Help with command line syntax

  • HI chaps,

    Can anyone help me with a command line I need to structure? I am creating a script which runs a dos command. The command outputs the results of a FIND query, like this;

    BLAHBLAHBLAHBLAH: n

    where n is a number.

    I want to get that number via a script and alert on it. I can run the command, i have the output going to a text file, but I've fallen over trying to get kaseya to find the number and return it. I just dont know how to do that using a command line to query the contents of the output in the text file and then to get kaseya to raise the alert based on its value.

    Hope that makes sense. Can anyone help ?

    Olly

    Legacy Forum Name: Help with command line syntax,
    Legacy Posted By Username: oliverm
  • Get Variable --> File Content

    There are a couple ways to setup alerting:

    1.) you can use the get file command to alert if "n" changes
    2.) you can nest another script and use an if/then on the variable and have it write to the script log.

    Legacy Forum Name: Scripts Forum,
    Legacy Posted By Username: cnwicsurrett
  • Well, if you're getting output in the format "Descriptive Text: Numeric Value", you could probably use the 'cut' command from the UnxUtils toolset.

    At least, that's what I'd do, and have done with one of my McAfee DAT checker scripts. (The 8.6x McAfee engine change required me to build a new script utilizing no fewer than six UnxUtils commands...)

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