Bot is a small application that helps to keep an eye on network resources using a variety of predefined checks and to be extensible for custom needs.
In a broad context the app might be used as a scheduler for any kind of task.
- Provide an easy way to check network resource availability with different checks
- Ping
- Http
- Trace
- Make it runnable on major OS: Windows, Mac OS, *nix
- Easily customizable and manageable
- Set of predefined checks: Ping, HTTP, Trace
- Command line interface
- Configuration with XML config
- Modular design (just add jar with custom executors and/or reports to classpath)
- API for custom checks and reporting
<config>
<!-- Task group config -->
<group id="GitHub.com">
<!--
'gitHubPing' task, runs every 10 seconds with PING executor,
execution deadline - 3 secs
-->
<task id="gitHubPing" executor="PING">
<run>10</run>
<deadline>3</deadline>
</task>
<!--
'gitHubTrace' task, runs every 30 seconds with TRACE executor,
execution deadline - 10 secs
-->
<task id="gitHubTrace" executor="TRACE">
<run>30</run>
<deadline>10</deadline>
</task>
</group>
<!--
Un grouped 'Java.com' task, runs every 2 seconds with CUSTOM_EX executor,
execution deadline - 1 secs
Contains extra parameters for executor in executorConfig node
-->
<task id="Java.com" executor="CUSTOM_EX">
<run>2</run>
<deadline>1</deadline>
<executorConfig>
<property key="key">value</property>
</executorConfig>
</task>
<!--
Un grouped 'runOnce' task
Runs only once with CUSTOM_ONE_RUN executor
-->
<task id="runOnce" executor="CUSTOM_ONE_RUN">
<run>-1</run>
</task>
</config>
#Build common module
cd <project_path>/common
mvn install
#Build worker module
cd <project_path>/worker
mvn install
Not implemented yet
Build modules with custom checks and reports, look into the sample project for more info
- To add custom check
- Implement TaskExecutor
- Annotate it with AutoService
- To add custom report
- Implement TaskResultProcessor
- Annotate it with AutoService
###Windows
java -cp "common.jar;worker.jar;checks.jar;custom.jar" com.bot.worker.BotStarter --task-config-file=path_to_config_file
###Unix
java -cp "common.jar:worker.jar:checks.jar:custom.jar" com.bot.worker.BotStarter --task-config-file=path_to_config_file
###Where
- worker.jar and common.jar - artifacts from Step 1
- checks.jar - artifact from Step 2
- checks.jar - artifact from Step 3
- path_to_config_file - path to tasks XML config
By default logs are written into the app home folder under ‘log’.
Console is used for command line interface. Type --help to get command list.
Bot is still in development. Core functionality has been implemented and significant code change are not expect, however some minor changes are likely. Stay tuned.
Copyright (C) 2017 Aleks Fedorov
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.