Kaseya Community

Get systeminfo information

  • Created this script to do the system_profiler command, and dump output to a text file. Then I have Kaseya go get the file.

    Amazingly, it works, with a few caveats:
    a) The output file does get uploaded to kserver like I asked, but its saving the .txt file as .txt.bin. Its not a binary file, its a text file. I have no idea where the .bin extension came from.
    b) The format is horrible - doesnt match the actual output given by the system_profiler command. I presume its 'damaged' because the kserver tried to throw this .bin extension on the file to make its transfer. But... this script just creates a text file, then gets it uploaded. Should be simple and clean.


    Does the .bin extension have something to do with FTP maybe? Im not sure what the Get File command does. Im assuming its an FTP transfer. And, in ftp you can chose auto/binary/ascii transfer modes. Im reaching here, but Im wondreing if thats why my file ended up on the kserver as .bin.


    Here is my script:
    Script Name: xSystemProfiler
    Script Description: SystemProfiler.

    IF True
    THEN
    Execute Shell Command
    Parameter 1 : /usr/sbin/system_profiler >> /tmp/systemprofiler.txt
    Parameter 2 : 1
    OS Type : 12
    Get File
    Parameter 1 : /tmp/systemprofiler.txt
    Parameter 2 : systeminfo\systemprofiler.txt
    Parameter 3 : 0
    OS Type : 12
    ELSE

    Legacy Forum Name: Get systeminfo information,
    Legacy Posted By Username: mariaworld
  • You have to download and rename the file, period. This isn't a bug, it's a "feature."

    I went back and forth with high-level Kaseya support technicians for a month trying to get an answer about the '.txt.bin' thing. Apparently a recent-ish change, for the sake of "security," has decreed that MIME typing be damned, we're going to get '.bin' appended to pretty much any document format to "protect" us from something-or-other.

    Repeatedly I was told, "Well, you can always give your techs FTP access to the Kserver to get at the .txt files." That'll teach me to think that the Get Files function is meant to be useful, won't it? *eyeroll*

    This reminds me that I should get back to experimenting with file types that won't trigger the stupid .bin "feature." I haven't tried PDF yet...

    Legacy Forum Name: Macintosh,
    Legacy Posted By Username: GreyDuck
  • PDF does not trigger the .bin 'feature' and neither does .html/.html

    Legacy Forum Name: Macintosh,
    Legacy Posted By Username: TBK Consulting
  • Well, well, well.

    So when the Support tech I was dialoguing with told me that TXT and HTML files would both trigger the .BIN thing, he was completely mistaken.

    Now I just have to figure out how to work a TXT-to-HTM wrapper into some of my reporting scripts. There's gotta be a command line util for that.

    Legacy Forum Name: Macintosh,
    Legacy Posted By Username: GreyDuck
  • I edited my script per your responses above. I still end up with a .html.bin extension on the getfile. Sad

    Heres my current script:
    Script Name: xSystemProfiler
    Script Description: SystemProfiler.

    IF True
    THEN
    Execute Shell Command
    Parameter 1 : /usr/sbin/system_profiler >> /tmp/systemprofiler.html
    Parameter 2 : 1
    OS Type : 12
    Get File
    Parameter 1 : /tmp/systemprofiler.html
    Parameter 2 : systeminfo\systemprofiler.html
    Parameter 3 : 0
    OS Type : 12
    ELSE

    Legacy Forum Name: Macintosh,
    Legacy Posted By Username: mariaworld
  • Out of curiosity: What if you leave off the "L"? I had it work with just .HTM here, a few minutes ago.

    Legacy Forum Name: Macintosh,
    Legacy Posted By Username: GreyDuck
  • Changed the script to .htm. On the Get File screen it appears at .htm. When
    I click to download the file, I still get the .bin extension.

    The edited script:
    IF True
    THEN
    Execute Shell Command
    Parameter 1 : /usr/sbin/system_profiler >> /tmp/systemprofiler.htm
    Parameter 2 : 1
    OS Type : 12
    Get File
    Parameter 1 : /tmp/systemprofiler.htm
    Parameter 2 : systeminfo\systemprofiler.htm
    Parameter 3 : 0
    OS Type : 12
    ELSE

    Legacy Forum Name: Macintosh,
    Legacy Posted By Username: mariaworld
  • They must have changed that back then - for awhile it used to work way back when ... for the .html ... there was a few more formats that worked pretty good too, but I have no idea what they are now ... just try putting different formats on a target machine and using the get file function to see which ones pull up properly.

    Legacy Forum Name: Macintosh,
    Legacy Posted By Username: TBK Consulting
  • Well, that's dandy. Pin the tail on the file-format, what a fun game!

    Legacy Forum Name: Macintosh,
    Legacy Posted By Username: GreyDuck
  • I have just been round the same loop with Support regarding GetFile. Apparently adding the .bin extension was included for "Security" purposes, although how changing a file extension from something that I specifically intended to a completely different extension which, on my computer opens a binary File loader makes things more secure I don't know.

    Anyway the point of the post: If you are creating a text file; when it gets uploaded with GetFile give it a .pdf extension.

    as per the example below

    Script Name: Tasklist
    Script Description: Run Tasklist to find out which processes are running, save list in the Docs folder and compare usage

    IF True
    THEN
    Get Variable
    Parameter 1 : 10
    Parameter 2 :
    Parameter 3 : ATemp
    OS Type : 1
    Execute Shell Command
    Parameter 1 : tasklist /V >> "#ATemp#\ProcessList.txt"
    Parameter 2 : 1
    OS Type : 1
    Get File
    Parameter 1 : #ATemp#\ProcessList.txt
    Parameter 2 : ..\Docs\ProcessList.pdf
    Parameter 3 : 2
    OS Type : 1
    ELSE


    It then quite happily opens in the browser window as it was originally intended to do before it had it security extension added.

    Legacy Forum Name: Macintosh,
    Legacy Posted By Username: PeterS
  • In addition to the .pdf extension,which seems to work just fine for displaying text files I have got a list of file extensions back from support. According to the developers the list below should all download/display correctly without having .bin appended.

    .xml
    .doc
    .xls
    .wri
    .pdf
    .jpg
    .gif
    .png
    .bmp

    Apparently the developers decided to append a .bin on the end of a text file so that it can be downloaded.

    Legacy Forum Name: Macintosh,
    Legacy Posted By Username: PeterS