Watchdog for FillDB
0 Votes |
Description
FillDB has been known to stall. This task will monitor for that situation and correct it.
NOTE: You must enable FillDBperf in order for this watchdog task to be relevant.
this watchdog runs every 15min.
Here is the sudocode for what will happen:
if filldb = stopping and no flag
set flag
elseif filldb = stopping and flag
it is taking longer than 15min to stop, so kill it
if flag set, then clear it
start filldb
else
if flag set, then clear it
check sha1 of filldbperf log, this log should be updated every minute or more with data assuming everything is working correctly.
if old sha1 == new sha1 then the log didn't get updated... stop filldb
if filldb = stopped then start filldb
Property Details
3632 | |
Beta - Preliminary testing ready for more | |
Watchdog for FillDB | |
BES | |
Maintenance | |
0 | |
danielheth@bigfix.me | |
<Unspecified> | |
<Unspecified> | |
12/5/2011 12:00:00 AM | |
danielheth on 10/22/2013 1:14:43 PM | |
danielheth on 10/22/2013 1:14:43 PM | |
4486 Views / 15 Downloads | |
![]() ![]() ![]() ![]() ![]() |
Relevance

Used in 1 fixlet | * Results in a true/false |

Actions
Action 1 (default)
//state of service = Continuing, Pausing, Paused, Running, Starting, Stopping, Stopped, UnknownSuccess Criteria
//if filldb is stopping and we haven't configured the stopping flag.
//this means this is the first time we've seen the filldb service in a stopping state
//we need to configure the flag so the next time this task runs, we'll be able to fix
if {state of service "FillDB" = "Stopping" AND not exists setting "FillDB_Stopping" of client}
//set flag for next run...
setting "FillDB_Stopping"="{now as string}" on "{now}" for client
//every 15min this task will run again, filldb will be stopped and
//the flag will be set which will make it go into the next section of code
//where we can kill the process... it shouldn't take 15min to stop.
//if it was able to stop during the 15min wait, then the else section
//will run which clears the flag.
elseif {state of service "FillDB" = "Stopping" AND exists setting "FillDB_Stopping" of client}
//forcably kill the FillDB process
waithidden cmd /c taskkill /IM FillDB.exe /F
//if it successfully killed it, then clear the flag and restart
if {state of service "FillDB" = "Stopped"}
//first remove the flag...
if {exists setting "FillDB_Stopping" of client}
setting delete "FillDB_Stopping" on "{now}" for client
endif
waithidden cmd /c net start FillDB
endif
else
//delete the flag under any other circomstances
if {exists setting "FillDB_Stopping" of client}
setting delete "FillDB_Stopping" on "{now}" for client
endif
//pull old sha1 from registry and read new sha1
parameter "LASTsha1"="{if exists setting "FillDB_PerfSha1" of client then value of setting "FillDB_PerfSha1" of client else ""}"
parameter "NEWsha1"="{if exists value "PerformanceDataPath" of key "HKEY_LOCAL_MACHINE\SOFTWARE\BigFix\Enterprise Server\FillDB" of registry then sha1 of file (value "PerformanceDataPath" of key "HKEY_LOCAL_MACHINE\SOFTWARE\BigFix\Enterprise Server\FillDB" of registry as string) else ""}"
//compare sha1's to see if filldb has stalled...
if {parameter "LASTsha1" != "" AND parameter "LASTsha1" = parameter "NEWsha1"}
//sha1 did not change, restart service
waithidden cmd /c net stop FillDB
else
//save new sha1 for later use
setting "FillDB_PerfSha1"="{parameter "NEWsha1" of action}" on "{now}" for client
endif
//if the filldb is in a stopped state, then start it now
if {state of service "FillDB" = "Stopped"}
waithidden cmd /c net start FillDB
endif
endif
This action will be considered successful when all lines of the action script have completed successfully.
Sharing
Social Media: |