/build/static/layout/Breadcrumb_cap_w.png

Scripting Question


NXLogs install

09/02/2020 145 views

Hi All!

I'm trying to install NXLogs with a specific config file (.conf). After the install I need to restart the service for the new config to take effect. NXLog is in the software catalog but I'm not sure how to force it to overwrite the default config.

Maybe a script would be better. Zip the msi and the .conf and run the batch file to restart the service after. It seems doable but I don't have much experience with Kace to implement this.

0 Comments   [ + ] Show comments

Comments


All Answers

0

Go to Distribution |Task Chains to combine the tasks.

Build your deployment (and for specific questions it may be useful to ask how to install via Command line the software with your needs) and a restart task and put both into the task chain.

Answered 09/02/2020 by: Nico_K
Red Belt

  • Thanks for the quick reply Nico.

    I'm not really following. Can you expend on this please?
  • I think I understand. I can create a task to restart a service and task it after the install.

    As far as the install, how would I force the overwrite of a file in a directory with the one that I want?
    • there are multiple ways, a good idea may be (as I said: I dont know the software)
      1. you create an installation as a managed install
      2. you create a file sync or a script which copies the files to the location you want
      3. you create a script which restarts the service

      you put them all in the Task chain so they are running one after the other.
      • OK. How would I copy the file. I don't want to put in on share for the script to pickup. I want the file to be copied from a Kace directory. Are there variables to specify it.

        e.g. a bat file with something like this:

        copy /z /y “$KaceVar\nxlog.conf" "C:\Program Files (x86)\nxlog\conf"
      • yes, you can find all usable variables if you click to the mario blocks (the blue boxes with the question marks)
  • I'm having a problem with the script. The scripts runs successfully. I can see everything is being copied but the file never gets overwritten.

    in online shell with .bat

    start /wait xcopy /Y $(KACE_DEPENDENCY_DIR)\nxlog.conf "C:\Program Files (x86)\nxlog\conf\"
    net stop nxlog
    net start nxlog

    I tried with "" and without. No luck
0

For just copying a file to an end point, you can use the "File Sync" feature of the SMA.

More information can be found in the Admin guide.

Answered 09/02/2020 by: KevinG
7th Degree Black Belt

0

Hello, 

For this installation i created 3 scripts:

1- Script to install the agent  (i used the msi configuration)

2a - script to overwrite the nxlog.conf file  (zipped the file/ attached it and the script unzips the file and places it C:\program.........) (((this conf is for DC servers)))

2b - script to overwrite the nxlog.conf file  (zipped the file/ attached it and the script unzips the file and places it C:\program.........) (((this conf is for IIS servers)))

3- Start & Restart service (nxlog)  (script to start service also to restart it/ just in case :) )


Once those 3 scripts were tested, i created a task Chain

1- task chain to run 1, 2a, 3

2- task chain to run 1, 2b, 3


Example of Step 1:

0CZna1N9pivAAAAAElFTkSuQmCC

Example of step 2a

Dependencies  Tasks (required)

Task 1trashcan-icon.png

Attempts: 
On Failure:  Break  Continue

Verify

  1. Verify that the file “C:\Program Files (x86)\nxlog\conf\nxlog.conf” exists.
    trashcan-icon.png

On Success

  1. Unzip “$(KACE_DEPENDENCY_DIR)\nxlogIIS&regular.zip” to “C:\Program Files (x86)\nxlog\conf”.
    trashcan-icon.png

Example of Step 3:

Verify

  1. Verify the service “nxlog” exists.
    trashcan-icon.png

On Success

  1. Start service “nxlog”.
    trashcan-icon.png
  2. Restart service “nxlog”.
    trashcan-icon.png
  3. Log “started....” to “status”.
Answered 09/03/2020 by: vigasi
White Belt

Don't be a Stranger!

Sign up today to participate, stay informed, earn points and establish a reputation for yourself!

Sign up! or login

View more:

Share

 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ