From: Christian Herdtweck Date: Fri, 20 Mar 2015 11:02:01 +0000 (+0100) Subject: update Readme, TODO and example pingcheck.conf X-Git-Url: http://developer.intra2net.com/git/?a=commitdiff_plain;h=e2a8862d3938ab2d1e08846f3e6e052fcff47844;p=pingcheck update Readme, TODO and example pingcheck.conf --- diff --git a/Readme b/Readme index ba2b941..c7fe6ad 100644 --- a/Readme +++ b/Readme @@ -1,9 +1,11 @@ Table of Contents ======================================= 1. Introduction -2. Configuration File -3. Command line -4. References +2. Building and Installing +3. Configuration File +4. Command line +5. Tools +6. References @@ -49,18 +51,40 @@ section. --------------------------------------- Most parts are licensed under the GPLv2 + linking exception. -The ICMP code, bost::net::dns and the "boost pinger" are licensed under the -boost license and include a note about this in the beginning of the source code. +Parts of the ICMP code are based on the ping example found in the boost Asio +documentation ((c) Christopher Kohlhoff) but are now heavily modified. The DNS +resolver mechanism is based on boost::net::dns and is therefore licensed under +the boost license. Notes about this are included in the beginning of the source +code. -2. Configuration file +2. Building and Installing +======================================= +After downloading the source code and necessary libraries (in particular boost) +and tools (cmake) you should be able to do: + +me@my_linux_host ~/some/dir/pingcheck> mkdir build +me@my_linux_host ~/some/dir/pingcheck> cd build +me@my_linux_host ~/some/dir/pingcheck/build> ccmake ../ + OR +me@my_linux_host ~/some/dir/pingcheck/build> cmake ../ +me@my_linux_host ~/some/dir/pingcheck/build> make help # show more options +me@my_linux_host ~/some/dir/pingcheck/build> make +me@my_linux_host ~/some/dir/pingcheck/build> make check +me@my_linux_host ~/some/dir/pingcheck/build> make install + +The default install location is /usr/local, the easiest way to change this is +through ccmake + + +3. Configuration file ======================================= In this section are described the configuration items, along with they possible values and meanings. This section is organized in each major configuration -block. +block. An example file is contained in the conf subdirectory. -2.1. General +3.1. General --------------------------------------- This configurations are shared among and affect all the hosts. - default-source-network-interface: the local network interface from where the @@ -85,9 +109,16 @@ This configurations are shared among and affect all the hosts. application consider the link down. - ratio-random-hosts: expects a value in [0,1]; if <1 will only use the given ratio of hosts, selecting them at random +- ping-reply-timeout: Amount of time to wait for an EchoReply to an Echo Request + before sending the next ping +- max-address-resolution-attempts: For hosts given as DNS names, will first do + a DNS lookup to get corresponding IPs. This number specifies how often that is + attempted before declaring the host offline +- resolved-ip-ttl-threshold: When the TTL for an IP falls below this threshold, + a new DNS lookup will be scheduled -2.2. Host +3.2. Host --------------------------------------- (All these settings must always be present!) - name: the DNS or IP of the host to ping. Take in consideration that, if a @@ -102,11 +133,11 @@ This configurations are shared among and affect all the hosts. as fixed number (e.g. "30") or as a range (e.g. "30..60"), from which the interval will be picked at random (e.g. 42) at startup - ping-protocol: indicates which protocol to use to ping the destination host, - the currently supported protocols are TCP (tcp, tcp_ipv6) and ICMP (icmp, icmpv6). - + the currently supported protocols are TCP (tcp, tcp_ipv6) and ICMP (icmp, + icmpv6). -3. Command line +4. Command line ======================================= The command line accepts the general configuration file options plus the following: @@ -115,16 +146,25 @@ following: - daemon: run the application as a daemon. - log-level: apply a filter of which log messages will be printed. The available options are the default Unix levels (e.g. debug, info, etc.). -- log-output: select the place where the log messages will be printed. The available - options are CONSOLE, TERMINAL and SYSLOG. +- log-output: select the place where the log messages will be printed. The + available options are CONSOLE, TERMINAL and SYSLOG. +5. Tools +======================================= +Along with pingcheck, the binary feed_packet_data will be built but not copied +like the pingcheck binary to the install location (you will find it in your +build_directory/src/feed_packet_data). It allows direct access to the ICMP/TCP +parser factories that interpret incoming network data. It can be fed data in +pcap format or as raw binary data, either from file or stdin. + -4. References +6. References ======================================= [1] http://tools.ietf.org/html/rfc792 [2] http://en.wikipedia.org/wiki/Ping [3] http://en.wikipedia.org/wiki/Internet_Control_Message_Protocol -[4] http://www.boost.org/doc/libs/1_45_0/doc/html/boost_asio.html -[5] http://www.boost.org/doc/libs/1_45_0/doc/html/program_options.html -[6] http://www.networkuptime.com/nmap/page4-5.shtml +[4] http://en.wikipedia.org/wiki/ICMPv6 +[5] http://www.boost.org/doc/libs/1_45_0/doc/html/boost_asio.html +[6] http://www.boost.org/doc/libs/1_45_0/doc/html/program_options.html +[7] http://www.networkuptime.com/nmap/page4-5.shtml diff --git a/TODO b/TODO index b3c0525..e5abd04 100644 --- a/TODO +++ b/TODO @@ -15,10 +15,3 @@ In December 2014 / January 2015 did a lot of changes to ICMP pinger (IPv4) which Also, removed threads for each pingchecker, leaving only one thread with one io_service for all pingers. Tested that a lot with ICMP v4 pinger, but no other. - -Furthermore, moved the parsing of incoming ICMP packages into central class - because every ICMP socket receives incoming data for all request from same - process, so each pinger had to parse all reply packages of requests from - other pingers, discarding most of them immediately after parsing. A central - IcmpPackageDistributor was created, which is constructed or updated in - static IcmpPinger::create functions. It handles all incoming ICMP traffic. diff --git a/conf/pingcheck.conf b/conf/pingcheck.conf index dfb7912..fc97cfb 100644 --- a/conf/pingcheck.conf +++ b/conf/pingcheck.conf @@ -1,5 +1,5 @@ default-source-network-interface=eth0 -nameserver=localhost +nameserver=127.0.0.1 hosts-down-limit=0 ping-fail-limit=40 status-notifier-cmd=./system_status_alert.sh ${status} @@ -10,4 +10,4 @@ name=www.ufsc.br interval=10 ping-protocol=ICMPv4 port=80 -source-network-interface=eth0 +source-network-interface=default