{"id":18647615,"url":"https://github.com/artcom/watchdog","last_synced_at":"2025-10-11T02:45:17.461Z","repository":{"id":2777379,"uuid":"3776659","full_name":"artcom/watchdog","owner":"artcom","description":"the artcom ag watchdog utlility","archived":false,"fork":false,"pushed_at":"2019-07-24T07:50:47.000Z","size":231,"stargazers_count":12,"open_issues_count":4,"forks_count":1,"subscribers_count":29,"default_branch":"master","last_synced_at":"2024-10-30T17:12:39.766Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"BitJam/Xlated-initrd","license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/artcom.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2012-03-20T15:23:47.000Z","updated_at":"2019-07-24T07:50:49.000Z","dependencies_parsed_at":"2022-08-20T12:40:34.988Z","dependency_job_id":null,"html_url":"https://github.com/artcom/watchdog","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/artcom%2Fwatchdog","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/artcom%2Fwatchdog/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/artcom%2Fwatchdog/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/artcom%2Fwatchdog/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/artcom","download_url":"https://codeload.github.com/artcom/watchdog/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223469129,"owners_count":17150280,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-07T06:27:10.298Z","updated_at":"2025-10-11T02:45:12.428Z","avatar_url":"https://github.com/artcom.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Summary\n\nThe ART+COM AG Watchdog is a utility to start, watch and control applications and computer. It has a interface to control its functionality via udp-network packets.\nIt is open-source and available for Windows, Linux and macOS.\n\n# Prebuild Windows 32 Bit binary\n- get the latest installer Watchdog-*.*.*-win32.exe from [[https://y60.artcom.de/redmine/projects/y60/files]]\n- get the appropriate dependencies: PRO60Dependencies-*.*.*-win32.exe\n- get the appropriate asl library: ASL-*.*.*-win32.exe\n\n# Build from sources\n## Checkout\nCheckout watchdog sources\n\n    git clone https://github.com/artcom/watchdog.git\n\n## Build on Windows\n\n### Prerequisites\n\nDownload and install the following packages:\n\n- Cygwin shell\n- Visual Studio Express 9 2008, 32Bit\n- CMAKE Version 2.8 or higher\nfrom https://y60.artcom.de/redmine/projects/y60/files\n- get the latest dependencies: PRO60Dependencies-*.*.*-win32.exe\n- get the appropriate asl library: ASL-*.*.*-win32.exe\n- get the appropriate acmake library: AcMake-*.*.*-win32.exe\n\n### Build process\n\nCreate build target directory:\n\n    cd watchdog\n    mkdir obj\n    cd obj\n\nMake build scripts using cmake (either for nmake or Visual Studio 9 2008).\n\n#### Build with Visual Studio 9 2008 IDE\n\n    cmake -G \"Visual Studio 9 2008\" ..\n    open Watchdog.sln and build it using the IDE\n\n#### Build with NMake\n\n    cmake -G \"NMake Makefiles\" ..\n    nmake\n\n## Build on Linux\n\nDocumented is the build process for Ubuntu. If you're using a different Linux derivate the dependencies might be called differently or even other packages needs to be installed. Also you're probably use a different package manager.\n\n### Install system dependencies\n\nFor Ubuntu:\n\n     sudo apt-get install git build-essential autoconf2.13 cmake libboost-dev libboost-system-dev libboost-thread-dev libglib2.0-dev libcurl4-openssl-dev libasound2-dev\n\n### Install dependent ART+COM libraries\n\nCheckout the following repositories:\n\n    git clone git@github.com:artcom/acmake.git\n    git clone git@github.com:artcom/asl.git\n\nFollow the compile and install instruction for acmake and asl which can be found in there repository.\n\n### Build process\n\n1. Create yourself a build directory (you will need one per build configuration)\n\n    ```\n    cd watchdog\n    mkdir -p _builds/release\n    ```\n\n2. Configure the build tree (this is the equivalent of ./configure)\n\n    ```\n    cd _builds/release\n    cmake -DCMAKE_INSTALL_PREFIX=/usr/local ../../\n    ```\n\n   CMake looks in the usual install paths for the dependent asl and acmake libraries. If you want to use a current build of asl or acmake instead of the installed one you need to set `ASL_DIR` and `ACMAKE_DIR` manually to the location of the build dir of the libraries accordingly.\n   E.g. `\u003cbuild_dir\u003e/lib/[asl|acmake]/cmake`.\n\n3. Build the sources\n\n    ```\n    make -jX\n    ```\n\n4. Install watchdog\n\n    ```\n    sudo make install\n    ```\n\n## MacOS with Homebrew\n\nWe have [Homebrew](https://brew.sh) support. This makes installing on MacOS easier than ever!\n\n### Prerequisites:\n\n- [Homebrew Installation](https://brew.sh)\n\n### Add the artcom tap\n\nFor watchdog and related projects there is a tap here: https://github.com/artcom/homebrew-y60.\n\n    brew tap artcom/y60\n\n### Install watchdog\n\n    brew install watchdog\n\n# Usage\n\nThe commandline usage: i.e. with windows executable:\n\n    'watchdog.exe [--configfile \u003cwatchdog.xml\u003e] [--copyright] [--help] [--no_restart] [--revision] [--revisions] [--version] watchdog.XML'\n\nThe default configfile will be loaded in current working directoy with name 'watchdog.xml', the parameter '--configfile \u003cwatchdog.xml\u003e' will use given configfile.\nThe common watchdog behaviour is to restart application once they exit by any reason, to prevent this use the '--no_restart' flag, which will exit the watchdog after application finish.\n\n## Configuration\n\nAll the functions are configured via the xml-configfile, which elements will be explained in detail below.\n\n\nThe smallest possible configuration is this:\n\n    \u003cWatchdogConfig logfile=\"watch.log\" watchFrequency=\"15\"\u003e\n       \u003cApplication binary=\"calc.exe\"/\u003e\n    \u003c/WatchdogConfig\u003e\n\nIt will start the application 'calc.exe' check its status every 15 seconds and log all watchdog output to the logfile 'watch.log'.\n\nAs an alternative to the Application-node you can configure a SwitchableApplications-node like this:\n\n    \u003cSwitchableApplications directory=\"folder\" initial=\"application_watchdog_file_name_without_extension\"/\u003e\n\n'directory' is where other xml-files for each application you want to switch to are located. These xml-Files contain *only* the Application-node as specified below. You can switch between these applications by sending the switch-command via UDP like this:\n\n    switch/application_watchdog_file_name_without_extension\n\nwhere 'switch' is the command specified in the SwitchApplication-node. The application initially started by watchdog is given in the 'initial' attribute of the SwitchableApplications-node.\n\n\n\nThe full feature set is divided in three categories:\n1. The application startup configuration, timed restart commands and runtime checks, like memory consumption and heartbeat detection.\n2. Systemcommand pre and post application execution and timed computer restart or shutdown\n3. Udpcontrol interface for status and controlling of computer and application\n\nAll optional nodes are obsolete, the functionality will be disabled.\nThe notation `${env_var}` will evaluate the environment variable and is used in heartbeat_file definition, application binary, arguments and working directory.\n\nThe feature set in detail:\n\n### Application execution\n\nFull featured application configuration node:\n\n    \u003cApplication binary=\"calc.exe\" directory=\"\" logFile=\"calc.log\" logFormatter=\"%Y-%M-%D-%h-%m-%s\" windowtitle\"Calculator\" showWindow=\"maximized|minimized\"\u003e\n        \u003cEnvironmentVariables\u003e\n            \u003c!--\u003cEnvironmentVariable name=\"key\"\u003e\u003c![CDATA[value]]\u003e\u003c/EnvironmentVariable\u003e--\u003e\n        \u003c/EnvironmentVariables\u003e\n        \u003cArguments\u003e\n            \u003cArgument\u003etest.txt\u003c/Argument\u003e\n        \u003c/Arguments\u003e\n        \u003cHeartbeat\u003e\n            \u003cHeartbeat_File\u003e${TEMP}/heartbeat.xml\u003c/Heartbeat_File\u003e\n            \u003cAllow_Missing_Heartbeats\u003e5\u003c/Allow_Missing_Heartbeats\u003e\n            \u003cHeartbeat_Frequency\u003e1\u003c/Heartbeat_Frequency\u003e\n            \u003cFirstHeartBeatDelay\u003e120\u003c/FirstHeartBeatDelay\u003e\n        \u003c/Heartbeat\u003e\n        \u003cWaitDuringStartup\u003e0\u003c/WaitDuringStartup\u003e\n        \u003cWaitDuringRestart\u003e10\u003c/WaitDuringRestart\u003e\n        \u003cMemory_Threshold\u003e100000\u003c/Memory_Threshold\u003e\n        \u003cRestartDay\u003eMonday\u003c/RestartDay\u003e\n        \u003cRestartTime\u003e12:02\u003c/RestartTime\u003e\n        \u003cCheckMemoryTime\u003e00:00\u003c/CheckMemoryTime\u003e\n        \u003cCheckTimedMemoryThreshold\u003e150000\u003c/CheckTimedMemoryThreshold\u003e\n    \u003c/Application\u003e\n\n#### The \\\u003cApplication\u003e root-node defines the app to execute and watch\n\n- Attributes are as follows:\n  - 'binary'     - defines the binary filename\n  - 'directory'  - watchdog changes to this directory before executing app [optional]\n  - 'logFile'    - watchdog will redirect all stdout and stderr outputs to this filename [optional, Linux/OSX only]\n  - 'logFormatter' - add a timestring in this format to the filename, empty string means use default [optional, Linux/OSX only]\n  - 'showWindow' - maximized|minimized can be set, default is maximized [optional, Windows only]\n  - 'windowtitle' - when set the watchdog tries to find the window with the title and if found gracefully stops or restarts the application. If not set the watchdog by default terminates the application [optional, Windows only]\n\n- Optional nodes:\n\n  - \\\u003cArguments\u003e defines a list of application arguments\n    and has children of \\\u003cArgument\u003e-nodes with childnode definition of the environment variable\n    with the use of CDATA-definition it is possible to handle specials character easier (i.e. '\\').\n\n  - \\\u003cEnvironmentVariables\u003e defines a list of environment variables, that will be set before app executing\n    and has children of \\\u003cEnvironmentVariable\u003e-nodes with key-value definition of the environment variable\n    with the use of CDATA-definition it is possible to handle specials character easier (i.e. '\\').\n\n  - \\\u003cHeartbeat\u003e Heartbeat detection will check the content of a given file and expects the seconds since 1970 in a format like this:\n  \\\u003cheartbeat secondsSince1970=\"1332154365\"/\u003e\n     - \\\u003cHeartbeat_File\u003e will define the heartbeat file in its childnode.\n     - \\\u003cAllow_Missing_Heartbeats\u003e will define the allowed mssing heartbeat before the watchdog assumes a app to be dead.\n     - \\\u003cHeartbeat_Frequency\u003e will define expected frequency ot the heartbeat in seconds.\n     - \\\u003cFirstHeartBeatDelay\u003e will define delay in seconds, before the heartbeat detection begins (i.e. for a longer app starttime).\n\n  - \\\u003cWaitDuringStartup\u003e will define a startup time before the app starts\n  - \\\u003cWaitDuringRestart\u003e will define a wait time before the app restarts\n  - \\\u003cRestartTime\u003e will define a time string, at which the apps restarts\n  - \\\u003cRestartDay\u003e will define a day on which the \\\u003cRestartTime\u003e will be used to restart the app\n  - \\\u003cMemory_Threshold\u003e will define a threshold of free system memory, the undercut of the threshold will lead to a  app restart\n  - \\\u003cCheckMemoryTime\u003e will define a threshold of free system memory which will be used with node \\\u003cCheckTimedMemoryThreshold\u003e to check memory\n     assumption at a given timestamp.\n  - \\\u003cCheckTimedMemoryThreshold\u003e will define a timestamp at which memory-assumption threshold from node \\\u003cCheckMemoryTime \u003ewill be used to check\n\n\n### Systemcommand execution\n\nFull featured systemcommand configuration node:\n\n    \u003cRebootTime\u003e15:30\u003c/RebootTime\u003e\n    \u003cHaltTime\u003e16:10\u003c/HaltTime\u003e\n    \u003cAppPreTerminateCommand\u003e\n        \u003c![CDATA[dir]]\u003e\n    \u003c/AppPreTerminateCommand\u003e\n    \u003cAppTerminateCommand ignoreOnUdpRestart=\"false\"\u003e\n        \u003c![CDATA[dir]]\u003e\n    \u003c/AppTerminateCommand\u003e\n    \u003cPreShutdownCommand\u003e\n        \u003c![CDATA[dir]]\u003e\n    \u003c/PreShutdownCommand\u003e\n    \u003cPreStartupCommand\u003e\n        \u003c![CDATA[dir]]\u003e\n    \u003c/PreStartupCommand\u003e\n    \u003cPreAppLaunchCommand\u003e\n    \u003c![CDATA[dir]]\u003e\n    \u003c/PreAppLaunchCommand\u003e\n    \u003cPostAppLaunchCommand\u003e\n    \u003c![CDATA[dir]]\u003e\n    \u003c/PostAppLaunchCommand\u003e\n\nFully Optional nodes:\n\n- \\\u003cRebootTime\u003e will define a timestamp at which the computer will reboot\n- \\\u003cHaltTime\u003e will define a timestamp at which the computer will shutdown\n- \\\u003cAppPreTerminateCommand\u003e will define a systemcommand to be executed before the app will be terminated\n- \\\u003cAppTerminateCommand\u003e will define a systemcommand to be executed after the app terminated\n   - attributes:\n        - `ignoreOnUdpRestart` - can be made dependent if the app is restarted via udp or exited internally\n- \\\u003cPreShutdownCommand\u003e will define a systemcommand to be executed before the computer is shutdown\n- \\\u003cPreStartupCommand\u003e will define a systemcommand to be executed when the watchdog is started\n- \\\u003cPreAppLaunchCommand\u003e will define a systemcommand to be executed before the application is launched\n- \\\u003cPostAppLaunchCommand\u003e will define a systemcommand to be executed when the application has launched\n\n### Udpcontrol interface\n\nFull featured Udpcontrol configuration node:\n\n    \u003cUdpControl port=\"2346\" returnmessage=\"false\" returnMessagePort=\"-1\"\u003e\n        \u003cIpWhitlelist\u003e\n            \u003cIp\u003e10.1.3.91\u003c/Ip\u003e\n            \u003cIp\u003e127.0.0.1\u003c/Ip\u003e\n        \u003c/IpWhitlelist\u003e\n        \u003cSystemHalt command=\"halt\"/\u003e\n        \u003cSystemReboot command=\"reboot\"/\u003e\n        \u003cRestartApplication command=\"restart\"/\u003e\n        \u003cSwitchApplication command=\"switch_app\"/\u003e\n        \u003cStopApplication command=\"stop\"/\u003e\n        \u003cStartApplication command=\"start\"/\u003e\n        \u003cStatusReport command=\"status\" loadingtime=\"2\"/\u003e\n        \u003cContinuousStatusChangeReport ip=\"10.1.1.106\" port=\"6655\"/\u003e\n    \u003c/UdpControl\u003e\n\n#### The \\\u003cUdpControl\u003e root-node enabled the udp control functionality of the watchdog\n\n- Attributes:\n  - 'port'    - port the watchdog will listen to\n  - 'returnmessage' - flag to toggle if the watchdog will return all messages to the client using the sender port. Default is 'false'\n  - 'returnMessagePort' - port the watchdog will return messages to, default (-1 or unset) is incoming port\n\n- Optional:\n  - \\\u003cIpWhitlelist\u003e defines a list of ip-adresses, for which the watchdog allows udp control\n    and has children of \\\u003cIp\u003e-nodes that define the whitelist. If defined only senderhost with the\n    configured ip will be accepted.\n\n  - \\\u003cSystemHalt\u003e will add the listener to the specified command, if a udp-packet with this content is accepted, the computer\n    will shutdown\n\n  - \\\u003cSystemReboot\u003e will add the listener to the specified command, if a udp-packet with this content is accepted, the computer will reboot\n\n  - \\\u003cRestartApplication\u003e will add the listener to the specified command, if a udp-packet with this content is accepted, the watchdog will restart the application\n\n  - \\\u003cSwitchApplication\u003e will add the listener to the specified command, if a udp-packet with this content is accepted, the watchdog will restart the application with the watchdog-file identified by 'id'.\n\n  - \\\u003cStopApplication\u003e will add the listener to the specified command, if a udp-packet with this content is accepted, the watchdog will stop the application\n\n  - \\\u003cStartApplication\u003e will add the listener to the specified command, if a udp-packet with this content is accepted, the watchdog  will start the application\n\n  - \\\u003cStatusReport\u003e will add the listener to the specified command, if a udp-packet with this content is accepted, the watchdog sends back the status of the application [running, loading, terminated]. If the attribute \\\u003cloadingtime\u003e in seconds is specified, the status  loading will be send for the given amount of seconds to simulate loading procedure\n\n  - \\\u003cContinuousStatusChangeReport\u003e triggers a continuous status change udp command to given ip and port\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fartcom%2Fwatchdog","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fartcom%2Fwatchdog","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fartcom%2Fwatchdog/lists"}