Need help writing relevance

(imported topic written by arivas200491)

We are deploying an application called splunk light forwarder via Bigfix and it is working fine. We now just need some help writing a relevance so it can install only if the machines meet certain conditions.

The Install path for this app is C:\Program Files\splunk, there is a service that runs when installed called “splunkd”

We want to determine a few relevance criteria prior to installing Splunk. We are looking for:

a. If application is already installed do not attempt to install again

b. OS type (32 bit or 64 bit): If its 32 bit it should download the 32bit MSI, if 64 should download the 64bit MSI (Splunk 32 bit is 24MB , Splunk 64 bit is 32MB)

c. Determine amount of diskspace available: should be at least 100MB on C:\ (otherwise splunk should not install.)

Can someone please help?

thanks.

(imported comment written by Jim23)

You may want to include “a” and “b” in the relevance for the Fixlet such as .

Then you might include b in the action script to do a conditional install. For instance

if {x64 of operating system}

command to download and execute 64bit MSI

elseif {not x64 of operating system}

command to download and execute 32 bit MSI

endif

(imported comment written by arivas200491)

Thanks Jim,

What if i want to put all in one relevance (or in the action script), what would the relevance look like?

New to writing relevance so thanks for youir patience

(imported comment written by Jim23)

If you were to put it in the relevance for the Fixlet then you would have to have 2 separate Fixlets. Here would be the relevance for each:

  1. exists service “Alerter” and free space of drive “c:” /1024 >100 and x64 of operating system

  2. exists service “Alerter” and free space of drive “c:” /1024 >100 and not x64 of operating system

I don’t think it would make much sense to put it all in the action script because then the Fixlet itself would apply to ALL machines whether or not they have splunk installed.

(BTW “Alerter” is a random service I used because I don’t have splunk installed)

(imported comment written by arivas200491)

Jim,

this is what we have in Action1:

download http://svc-bigfix01.svc.prod.vegas.com:52311/splunk/batch.bat

wait __download\batch.bat

the above 2 lines installs the app properly, now we just want to have the conditions of:

if it is installed do not reapply

if 32 bit install 32 bit msi, if 64 bit install 64 bit msi

if c drive is less than 100MB do not install.

What would you recommened to get this working properly.

I undertand what you mean, but i wasnt sure if we were supposed to remove what we already have in the action script.

Thanks for all your help

(imported comment written by Jim23)

  1. Edit the relevance on the Fixlet to have it check if the app is not installed and if it meets the space requirements:

not exists service “splunk” and free space of drive “c:” /1024 >100

  1. Use the conditional action that I referenced above for the action script. For example:

if {x64 of operating system}

download http://svc-bigfix01.svc.prod.vegas.com: … /batch_64.bat

wait __download\batch_64.bat

elseif {not x64 of operating system}

download http://svc-bigfix01.svc.prod.vegas.com: … /batch_32.bat

wait __download\batch_32.bat

endif


Just be sure that you have cached the files. You can do this using the software distribution wizard or manually cache them. http://support.bigfix.com/cgi-bin/kbdirect.pl?id=390

Note that you will have to verify the actual name of the service. You can do this by opening the relevance debugger and typing “services” to get a list of services

(imported comment written by arivas200491)

We did the following and we got an error:

Relevance 1:

not exists service “splunkd” and free space of drive “c:” /1024 >100

Action1:

if {x64 of operating system}

download http://svc-bigfix01.svc.prod.vegas.com:52311/splunk/x64/splunk.msi

wait __download\splunk.msi

elseif {not x64 of operating system}

download http://svc-bigfix01.svc.prod.vegas.com:52311/splunk/x86/splunk.msi

wait __download\splunk.msi

endif

download http://svc-bigfix01.svc.prod.vegas.com:52311/splunk/batch.bat

run __download\batch.bat

and this is the logs with the error we got:

At 11:04:55 -0700 -

DownloadPing command received

At 11:05:26 -0700 - opsite11 (http://svc-bigfix01.svc.prod.vegas.com:52311/cgi-bin/bfgather.exe/opsite11)

Relevant - Windows Splunk Light Forwarder 3.4.10 (fixlet:15307)

At 11:05:26 -0700 -

ActionLogMessage: (action 15307 ) Action signature verified

DownloadsAvailable: checking for ‘http://servername/bfmirror/downloads/15307/0

DownloadsAvailable: true (action id 15307)

ActionLogMessage: (action 15307 ) Non-Distributed - DownloadsAvailable

ActionLogMessage: (action 15307 ) Submitting download request

ActionLogMessage: (action 15307 ) Download url: ‘http://svc-bigfix01.svc.prod.vegas.com:52311/splunk/x64/splunk.msi’ (skip non relevant)

ActionLogMessage: (action 15307 ) Download url: ‘http://svc-bigfix01.svc.prod.vegas.com:52311/splunk/x86/splunk.msi

ActionLogMessage: (action 15307 ) Download url: ‘http://svc-bigfix01.svc.prod.vegas.com:52311/splunk/batch.bat

At 11:05:28 -0700 -

Report posted successfully.

At 11:05:35 -0700 -

ActionLogMessage: (action 15307 ) starting action

At 11:05:38 -0700 - opsite11 (http://servername/cgi-bin/bfgather.exe/opsite11)

Command succeeded (Using download manager collected file) download http://svc-bigfix01.svc.prod.vegas.com:52311/splunk/x86/splunk.msi (fixlet 15307)

At 11:05:40 -0700 - opsite11 (http://servername/cgi-bin/bfgather.exe/opsite11)

Command failed (Thread execution failed) wait __download\splunk.msi (fixlet 15307)

At 11:05:41 -0700 -

ActionLogMessage: (action 15307 ) ending action

At 11:05:41 -0700 - opsite11 (http://servername/cgi-bin/bfgather.exe/opsite11)

Not Relevant - Windows Splunk Light Forwarder 3.4.10 (fixlet:15307)

At 11:06:16 -0700 -

Report posted successfully.

What do i have wrong here?

thanks,

(imported comment written by arivas200491)

can anyone help with this please?

thanks

(imported comment written by arivas200491)

Thank you Jim! We will try this soon and let you know how it goes

(imported comment written by Jim23)

  1. It appears to be installing the app:

At 11:05:41 -0700 -

ActionLogMessage: (action 15307 ) ending action

At 11:05:41 -0700 - opsite11 (http://servername/cgi-bin/bfgather.exe/opsite11)

Not Relevant - Windows Splunk Light Forwarder 3.4.10 (fixlet:15307)

At 11:06:16 -0700 -

Report posted successfully.


  1. The problem seems to be in execution.

A. Both “run” and “wait” will execute a command. (“wait __download\splunk.msi” and “run __download\batch.bat”

B. In order to execute an msi you need to use msiexec.exe. For example:

wait msiexec.exe /i “{pathname of client folder of current site}__Download\splunk_x86.msi” /qn

C. The names are the same for splunk.msi. You would probably want to rename them to splunk_32.msi and splunk_64.msi

SO it may look something like:


Relevance 1:

not exists service “splunkd” and free space of drive “c:” /1024 >100

Action1:

if {x64 of operating system}

download http://svc-bigfix01.svc.prod.vegas.com: … splunk_x64.msi

wait msiexec.exe /i “{pathname of client folder of current site}__Download\splunk_x64.msi” /qn

elseif {not x64 of operating system}

download http://svc-bigfix01.svc.prod.vegas.com: … splunk_x86.msi

wait msiexec.exe /i “{pathname of client folder of current site}__Download\splunk_x86.msi” /qn

endif


If you need to launch it from bat then it would look something like this:


Relevance 1:

not exists service “splunkd” and free space of drive “c:” /1024 >100

Action1:

if {x64 of operating system}

download http://svc-bigfix01.svc.prod.vegas.com: … splunk_x64.msi

download http://svc-bigfix01.svc.prod.vegas.com: … splunk_x64.bat

wait __Download\splunk_x64.bat

elseif {not x64 of operating system}

download http://svc-bigfix01.svc.prod.vegas.com: … splunk_x86.msi

download http://svc-bigfix01.svc.prod.vegas.com: … splunk_x86.bat

wait __Download\splunk_x86.bat

endif