Watchdog for FillDB
Log In or Register to download the BES file, and more.

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

ID3632
StatusBeta - Preliminary testing ready for more
TitleWatchdog for FillDB
DomainBES
CategoryMaintenance
Download Size0
Sourcedanielheth@bigfix.me
Source ID<Unspecified>
Source Severity<Unspecified>
Source Release Date12/5/2011 12:00:00 AM
Added by on 10/22/2013 1:14:43 PM
Last Modified by on 10/22/2013 1:14:43 PM
Counters 4486 Views / 15 Downloads
User Rating 1 star 2 star 3 star 4 star 5 star * Average over 0 ratings. ** Log In or Register to add your rating.

Relevance

Used in 93 fixlets and 2 analyses   * Results in a true/false
Show indented relevance
version of client >= "6.0"
Used in 4 fixlets   * Results in a true/false
Show indented relevance
exists service "FillDB"
Used in 1 fixlet   * Results in a true/false
Show indented relevance
if exists value "PerformanceDataPath" of key "HKEY_LOCAL_MACHINE\SOFTWARE\BigFix\Enterprise Server\FillDB" of registry then exists file (value "PerformanceDataPath" of key "HKEY_LOCAL_MACHINE\SOFTWARE\BigFix\Enterprise Server\FillDB" of registry as string) else false

Actions

Action 1 (default)

Action Link Click here to activate this Watchdog.
Script Type BigFix Action Script
//state of service = Continuing, Pausing, Paused, Running, Starting, Stopping, Stopped, Unknown

//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
Success Criteria

This action will be considered successful when all lines of the action script have completed successfully.


Sharing

Social Media:
Share this page on Yammer

Comments

Log In or Register to leave comments!