Introduction
daeMON is a free tool that allows you to monitor groups of FireDaemon services restarting them individually or as a group if the service is stopped, the subprocess crashes or hits memory or CPU thresholds. daeMON is distributed as a single ZIP file containing 32-bit and 64-bit executables that are designed to run standalone or under FireDaemon control.
Why use daeMON?
You might have a requirement to restart one or more FireDaemon services in the event of one or more of them failing or hitting CPU or memory thresholds. The Windows service control manager doesn't provide any functionality to allow you to restart services selectively nor in a structured, ordered manner as a group.
Download
Download daeMON v1.18.5 32/64-bit for Windows XP, 2003, Vista, 2008 and 7.
Scenario
Imagine you have three distinct services you are running under FireDaemon:
* L2auth - an authentication server
* L2server - a game server
* L2npc - a name resolution server tied to the game server
The L2auth service can be restarted with impunity, however, the L2server and L2npc services are buggy and can crash. Irrespective of which one crashes you want to restart all three services. Here's the usage for the utility:
Code:
daeMON: Service Monitoring Utility v1.18.5
Copyright (c) 2010 FireDaemon Technologies Limited
Usage: daeMON.exe [OPTION] ...
Options: -a: Monitor all FireDaemon services (overrides -s)
-c: High CPU load threshold (as a percentage)
-d: Dynamically refresh service list every monitoring cycle
-e: Service short name to exclude from monitoring. One or more -e can be supplied
-f: Monitoring frequency (in seconds, default is 30)
-h: This help
-i: Ignore high CPU/Memory for n x monitored intervals (default is 0)
-j: Just stop monitored services. No restart
-k: Ignore services which are manual start and stopped
-m: High memory threshold (in MB)
-o: Run once. Don't continually monitor
-p: Passive monitoring - don't restart anything
-q: Quiet mode. No log output
-r: Just restart the failed service not the group
-s: Service short name. One or more -s can be supplied
-v: Verbose. Dump additional status info
Purpose: Keeps groups of FireDaemon services up. If a subprocess
crashes or a service is stopped then all the services
in the group are restarted.
Notes: The service short name should not contain spaces.
CPU load is calculated once across each monitored interval
as specified by the -f option. If a process' CPU load
exceeds the threshold as specified by -c it is killed.
The threshold can be ignored for a specific number of
monitoring intervals by specifying the -i option. The
process will only be killed if it exceeded the monitored
threshold every time the CPU load was calculated across
the ignored intervals. For example: -f 30 -c 50 -i 5
means monitor every 30 seconds and when the CPU usage for
the process is 50% across each of the 5 monitored
intervals (ie 30 x 5 = 150 seconds) then kill it. Note
that -i also works in conjunction with -m.
Example: daeMON.exe -f 5 -s service1 -s service2 -v
URL: http://www.firedaemon.com
EMail: helpdesk@firedaemon.com
Bugs: Please report bugs/features to email address above.
Configuring Your Services Correctly
This first thing you need to do is to configure how FireDaemon's Service Monitoring Facility (SMF) reacts in the case of failure. Normally, the SMF will restart your application if it crashes. When used in conjunction with daeMON you
don't want this to happen. You need to ensure that FireDaemon just notes the error or preferably shuts itself down. This is easy to achieve. For each of your services you wish to monitor in a group, make sure the Upon Program Exit option in Settings tab is set to: Disabled or Shutdown FireDaemon. For example:
Install and Configure daeMON
1. Download and install
FireDaemon.
2. Download
daeMON (320Kb) and unzip it into the directory of your choice (eg. C:\Program Files\daeMON).
3. Make a note of all the short names of the services you want to monitor (eg. L2auth, L2server, L2npc).
4. Start the FireDaemon Service Manager from the Start/Programs menu or desktop icon. Click on the Create A New Service Definition button in the Toolbar or press Ctrl+N. Fill out the panel as per the screen shot below (adjust your paths and parameters to suite) - you can use the TAB or SHIFT+TAB keys to move between fields:
The working directory is where you have placed the daeMON executable. Note the Parameters list. This is the list of services (in startup order) that you want to monitor. Each service short name is prefixed with a -s. If you want to change the monitoring facility frequency use the -f flag. Check the readme.txt in the ZIP file you downloaded for all available options.
5. You should really change the desktop interaction flag as it's not necessary to see what's going on (but you can leave it on if you are curious):
6. If you want to capture the debug log output of the utility then you can enable it as per the Output Capture section in the screenshot below. If your services take quite a while to initialise then you can set the Pre-Launch delay (in the Process section). This will defer the startup of daeMON by the number of milliseconds you specify (5000 = 5s).
7. Alternately, you can make the daeMON dependent on the services it is monitoring. For example:
8. Then click the Install button and daeMON should be installed and monitoring your group of services. Should you accidently shutdown a service or a process dies, then all the services that you specified in the Parameters list will be restarted.
Check the file you specified in the Output Capture settings to get an idea of what is happening behind the scenes. Here's an example:
Code:
Init: Fri Dec 18 08:15:06 2009: daeMON: Service Monitoring Utility v1.18.5 (4448)
Init: Fri Dec 18 08:15:06 2009: CLI: "C:\Temp\Packaging\x64\daeMON.exe" -a -v -d -m 50 -c 50
Init: Fri Dec 18 08:15:06 2009: Monitoring services continually
Init: Fri Dec 18 08:15:06 2009: Output verbosity is high
Init: Fri Dec 18 08:15:06 2009: Passive mode is disabled
Init: Fri Dec 18 08:15:06 2009: Group restart is enabled
Init: Fri Dec 18 08:15:06 2009: On failure services will be restarted
Init: Fri Dec 18 08:15:06 2009: Manual start stopped services will be checked
Init: Fri Dec 18 08:15:06 2009: Services list will be refreshed every monitoring cycle
Init: Fri Dec 18 08:15:06 2009: Memory monitoring enabled at 50 MB per process
Init: Fri Dec 18 08:15:06 2009: High memory will be ignored for 0 monitoring intervals (30 x 0 seconds)
Info: Fri Dec 18 08:15:06 2009: CPU load monitoring enabled at 50%
Init: Fri Dec 18 08:15:06 2009: High CPU load will be ignored for 0 monitoring intervals (30 x 0 seconds)
Info: Fri Dec 18 08:15:07 2009: Interrogating Processor: CPU0
Info: Fri Dec 18 08:15:07 2009: Intel(R) Core(TM) i7 CPU 920 @ 2.67GHz
Info: Fri Dec 18 08:15:07 2009: Speed: 2660Mhz
Info: Fri Dec 18 08:15:07 2009: Load: 0.00%
Info: Fri Dec 18 08:15:07 2009: Interrogating Processor: CPU1
Info: Fri Dec 18 08:15:07 2009: Intel(R) Core(TM) i7 CPU 920 @ 2.67GHz
Info: Fri Dec 18 08:15:07 2009: Speed: 2660Mhz
Info: Fri Dec 18 08:15:07 2009: Load: 14.29%
Info: Fri Dec 18 08:15:07 2009: Interrogating Processor: CPU2
Info: Fri Dec 18 08:15:07 2009: Intel(R) Core(TM) i7 CPU 920 @ 2.67GHz
Info: Fri Dec 18 08:15:07 2009: Speed: 2660Mhz
Info: Fri Dec 18 08:15:07 2009: Load: 14.29%
Info: Fri Dec 18 08:15:07 2009: Interrogating Processor: CPU3
Info: Fri Dec 18 08:15:07 2009: Intel(R) Core(TM) i7 CPU 920 @ 2.67GHz
Info: Fri Dec 18 08:15:07 2009: Speed: 2660Mhz
Info: Fri Dec 18 08:15:07 2009: Load: 0.00%
Info: Fri Dec 18 08:15:07 2009: Interrogating Processor: CPU4
Info: Fri Dec 18 08:15:07 2009: Intel(R) Core(TM) i7 CPU 920 @ 2.67GHz
Info: Fri Dec 18 08:15:07 2009: Speed: 2660Mhz
Info: Fri Dec 18 08:15:07 2009: Load: 0.00%
Info: Fri Dec 18 08:15:07 2009: Interrogating Processor: CPU5
Info: Fri Dec 18 08:15:07 2009: Intel(R) Core(TM) i7 CPU 920 @ 2.67GHz
Info: Fri Dec 18 08:15:07 2009: Speed: 2660Mhz
Info: Fri Dec 18 08:15:07 2009: Load: 14.29%
Info: Fri Dec 18 08:15:07 2009: Interrogating Processor: CPU6
Info: Fri Dec 18 08:15:07 2009: Intel(R) Core(TM) i7 CPU 920 @ 2.67GHz
Info: Fri Dec 18 08:15:07 2009: Speed: 2660Mhz
Info: Fri Dec 18 08:15:07 2009: Load: 0.00%
Info: Fri Dec 18 08:15:07 2009: Interrogating Processor: CPU7
Info: Fri Dec 18 08:15:07 2009: Intel(R) Core(TM) i7 CPU 920 @ 2.67GHz
Info: Fri Dec 18 08:15:07 2009: Speed: 2660Mhz
Info: Fri Dec 18 08:15:07 2009: Load: 14.29%
Init: Fri Dec 18 08:15:07 2009: Validating service: Calc
Init: Fri Dec 18 08:15:07 2009: Validating service: Cmd
Init: Fri Dec 18 08:15:07 2009: Validating service: Jambies
Info: Fri Dec 18 08:15:07 2009: Rereading services list
Init: Fri Dec 18 08:15:07 2009: Validating service: Calc
Init: Fri Dec 18 08:15:07 2009: Validating service: Cmd
Init: Fri Dec 18 08:15:07 2009: Validating service: Jambies
Info: Fri Dec 18 08:15:07 2009: Service check commencing
Info: Fri Dec 18 08:15:07 2009: Service: Calc
Info: Fri Dec 18 08:15:07 2009: Status: Running
Info: Fri Dec 18 08:15:07 2009: FD PID: 5364
Info: Fri Dec 18 08:15:07 2009: EXE PID: 656
Info: Fri Dec 18 08:15:07 2009: Memory: 9.06MB
Info: Fri Dec 18 08:15:07 2009: Threads: 3
Info: Fri Dec 18 08:15:08 2009: Load: 0.00%
Info: Fri Dec 18 08:15:08 2009: Service: Cmd
Info: Fri Dec 18 08:15:08 2009: Status: Running
Info: Fri Dec 18 08:15:08 2009: FD PID: 2644
Info: Fri Dec 18 08:15:08 2009: EXE PID: 1036
Info: Fri Dec 18 08:15:08 2009: Memory: 3.67MB
Info: Fri Dec 18 08:15:08 2009: Threads: 1
Info: Fri Dec 18 08:15:09 2009: Load: 0.00%
Info: Fri Dec 18 08:15:09 2009: Service: Jambies
Info: Fri Dec 18 08:15:09 2009: Status: Running
Info: Fri Dec 18 08:15:09 2009: FD PID: 3420
Info: Fri Dec 18 08:15:09 2009: EXE PID: 1364
Info: Fri Dec 18 08:15:09 2009: Memory: 4.20MB
Info: Fri Dec 18 08:15:09 2009: Threads: 1
Info: Fri Dec 18 08:15:10 2009: Load: 0.00%
Feedback? Complaints? Free beer? Go
here!