Checking Health of the BigFix Client (BigFix logs Check) - Better way?

(imported topic written by wnolan91)

I have created the below RP that checks the log files in the BigFix Logs location and check for “the file with yesterdays date .bkg” The way I have come up with works but I’m looking for a better way for the Month if possible. Any help would be great. The idea behind this is that a well working machine would never have more then one log file barring a new machine. It should rarely have 2 days of bkg files, which would be simple to add, but I don’t like the why I have to come up with the Month. Thanks Bill

if Exist file (((pathname of parent folder of regapp “besclient.exe”) & “__BESData__Global\Logs”) & ((first 4 of following text of position 12 of (now as string)) & (if ((first 3 of following text of position 8 of (now as string)) = “Jan”) then “01” else if ((first 3 of following text of position 8 of (now as string)) = “Feb”) then “02” else (if ((first 3 of following text of position 8 of (now as string)) = “Mar”) then “03” else (if ((first 3 of following text of position 8 of (now as string)) = “Apr”) then “04” else (if ((first 3 of following text of position 8 of (now as string)) = “May”) then “05” else (if ((first 3 of following text of position 8 of (now as string)) = “Jun”) then “06” else (if ((first 3 of following text of position 8 of (now as string)) = “Jul”) then “07” else (if ((first 3 of following text of position 8 of (now as string)) = “Aug”) then “08” else (if ((first 3 of following text of position 8 of (now as string)) = “Sep”) then “09” else (if ((first 3 of following text of position 8 of (now as string)) = “Oct”) then “10” else (if ((first 3 of following text of position 8 of (now as string)) = “Nov”) then “11” else (if ((first 3 of following text of position 8 of (now as string)) = “Dec”) then “12” else “other”))))))))))) & ((first 2 of following text of position 5 of (now as string) as integer - 1) as string) & “.bkg”) as string) Then “Possible problem with BESClient” Else “Client Working Well”

(imported comment written by jessewk)

First a caveat… In many deployments it is normal for the client to produce a .bkg file. The .bkg file is created when the .log file for the day has passed a certain size, I think 100k. In very active deployments with lots of actions that run regularly or during heavy patch periods, .bkg files will be normal.

Second, a suggestion… Have you seen the new BES 6.0 deployment health checks? This new dashboard has a lot of nice checks to help you keep track of the health of your deployment. Over time we will be adding even more checks to the dashboard.

http://forum.bigfix.com/viewtopic.php?id=143

Third some new stuff… in 6.0 there are many nice new inspectors for handling dates and times. Parsing the string with expressions like ‘first 4 of folllowing text of postion 12 of (now as string)’ are no longer necessary. Here are the names of some of the inspectors (there are many more):

august of

day_of_month of

month_and_year of

current day_of_year

as three letters

first friday of

two digit hour of

midnight

noon

And a couple examples on how to use them:

Is today saturday?

current day_of_week = Saturday

Is it currently 7am or later?

(hour_of_day of time ( local time zone ) of now) >= 7

Is it a week day?

disjunction of ( it = Monday; it = Tuesday; it = Wednesday; it = Thursday; it = Friday) of current day_of_week

What month is it?

current month

And finally… a simplier expression that is the same as your example but that takes advantage of some of the new stuff and is a bit easier to read:

if (exists file whose (name of it ends with “.bkg” AND date (local time zone) of creation time of it = (current date - 1 * day)) of folder (pathname of parent folder of regapp “besclient.exe” & “__BESData__Global\Logs”)) then “Possible problem with BESClient” else “Client Working Well”