Service Startup Type in an Action

(imported topic written by Matt.Johnson)

I am trying to use a single Fixlet to address several possible issues using the IF, THEN, ELSE command, and am experiencing some issues.

For example. I want to take a specific action of the service “FOO” has a start type of anything other than “auto” I would consider something like this"

IF (not exist service “FOO” with start type “auto”) THEN Action ELSE NoAction

Can someone give me the relevance that would allow the above relevance to equate to TRUE if the service is not net to auto?

Thanks,

Matt Johnson

(imported comment written by martinc)

How about this

if {if (((state of it as string = “Running”)) of service whose (service name of it as string = “BESClient”) | false) then (true) else (false)}

wait cmd.exe /c “echo running”

else

wait cmd.exe /c “echo not running or does not exist”

endif

One thing to note, if you change the “=” to “contains” and there are multiple returns, the query fails. Not sure if that is a requirement or not.

Martin

(imported comment written by NoahSalzman)

Anytime you see “if x then true else false” you can always simplify it. How about this for the relevance test that is inside the ActionScript if statement:

q: (start type of it is not “auto”) of service whose (service name of it as string = “BESClient”) | false

A: False

q: (start type of it is not “auto”) of service whose (service name of it as string = “imaginary_service_to_show_why_martinc_added_the_pipe_plus_false”) | false

A: False

(imported comment written by martinc)

Noah,

Since there is no like button, I have to reply with a LOL :slight_smile:

I like the way that works, not sure if I have used that before, but I will keep that one in my notes.

Martin.

(imported comment written by jgstew)

Here is an example: (not in the action though)

http://bigfix.me/fixlet/details/2568

“auto”

!=
start type
of
service
"BESClient"