Thomas Jarosch [Fri, 29 Apr 2011 09:31:52 +0000]
Build rpm package in parallel
Thomas Jarosch [Fri, 29 Apr 2011 09:30:29 +0000]
Make the status notifcation cmd optional. Also make the status parameter optional
Thomas Jarosch [Fri, 29 Apr 2011 09:29:52 +0000]
Switch log level to ::Info during development
Thomas Jarosch [Fri, 29 Apr 2011 09:20:18 +0000]
Don't bind the source interface if not specified
Thomas Jarosch [Fri, 29 Apr 2011 09:02:13 +0000]
Comment out -Werror as rpm will compile with -O2 - this results in warnings
Thomas Jarosch [Fri, 29 Apr 2011 09:01:51 +0000]
Iclude Intra2net commercial license for now
Guilherme Maciel Ferreira [Thu, 28 Apr 2011 14:24:01 +0000]
Included doxygen comments to member variables.
Guilherme Maciel Ferreira [Thu, 28 Apr 2011 12:29:04 +0000]
Log messages via I2n::Logger instead of cout/cerr.
Guilherme Maciel Ferreira [Thu, 28 Apr 2011 09:44:10 +0000]
Split Readme file.
- code conventions moved to Readme.code
Guilherme Maciel Ferreira [Thu, 28 Apr 2011 09:39:49 +0000]
PingInterval class changed from template to regular class to make it simple.
Guilherme Maciel Ferreira [Thu, 21 Apr 2011 09:29:37 +0000]
Fixed some issues issued by PC-lint
Guilherme Maciel Ferreira [Wed, 20 Apr 2011 13:13:06 +0000]
Improvement of ConfigurationReader
- renamed is_generic_options() to halt_on_generic_options(), which describes more precisely the semantic of this method
- moved halt_on_generic_options() to outside the parse_configuration_options()
- config-file processing moved from parse_configuration_options() to parse_generic_options(), because it is part of generic options
- the test "if ( vm.count(xxx) )" is no longer implicit compared to integer
Guilherme Maciel Ferreira [Wed, 20 Apr 2011 09:32:14 +0000]
Implemented feature: Program runs as daemon
Guilherme Maciel Ferreira [Tue, 19 Apr 2011 12:00:25 +0000]
The speed_up method could set the Interval to zero, which is a bug.
- also added asserts to harden the code and ensure the Interval will never become an invalid value.
Guilherme Maciel Ferreira [Tue, 19 Apr 2011 11:51:10 +0000]
Fixed bug: If one ping fails, the subsequent analysis report that the ping is down.
- The reason was that in HostStatusAnalyzer, analyze_ping_failed_count() was
called from within increase_ping_failed_count(), thus only when the ping
failed the ExceededPingFailedLimit was updated, to false. There were no path
where ExceededPingFailedLimit was updated to true.
Now, the analyze_ping_failed_count() is called everytime we call
update_ping_statistics(), which updates ExceededPingFailedLimit everytime.
Guilherme Maciel Ferreira [Tue, 19 Apr 2011 07:25:04 +0000]
Split the code of DnsResolver::resolve into more methods
Guilherme Maciel Ferreira [Mon, 18 Apr 2011 10:46:45 +0000]
Implemented feature: cache DNS requests info only until DNS reply is valid (TTL).
- created a class TimeToLive which is self updatable, and can get the ttl updated
- before each ping checks if the address is valid, if not, builds another IP list (which renews the ttl)
Guilherme Maciel Ferreira [Mon, 18 Apr 2011 07:32:46 +0000]
Fixed the type punning from boost::net::dns::message class
Guilherme Maciel Ferreira [Fri, 15 Apr 2011 13:44:51 +0000]
Removed one level of indirection provided by PingScheduler::handle_next_ping
Guilherme Maciel Ferreira [Fri, 15 Apr 2011 13:19:35 +0000]
Reading the nameserver form configuration file
Guilherme Maciel Ferreira [Fri, 15 Apr 2011 12:10:01 +0000]
Non-virtual destructors for classes that are unlikely to be base classes
Guilherme Maciel Ferreira [Fri, 15 Apr 2011 11:04:13 +0000]
Using the boost-net-dns library to resolve DNS host names
Guilherme Maciel Ferreira [Fri, 15 Apr 2011 11:02:18 +0000]
Commented the -O2 optmization level because it activates the -Wstrict-aliasing warning, which is issued by the boost-net-dns libraries.
Guilherme Maciel Ferreira [Wed, 13 Apr 2011 08:52:37 +0000]
Replaced post-fixed by pre-fixed increment
Guilherme Maciel Ferreira [Wed, 13 Apr 2011 08:48:29 +0000]
Increased the warning level
- included -pedantic, -Wshadow, -Wcast-qual and -Wconversion warnings
- fixed some warnings regarding lost of precision from conversions
- asserted that intermediate products from arithmetic operations fall within certain range
Guilherme Maciel Ferreira [Wed, 13 Apr 2011 08:28:00 +0000]
Using the std namespace within the souce file
Guilherme Maciel Ferreira [Tue, 12 Apr 2011 14:35:02 +0000]
Only the "using namespace std" is allowed, classes from other namespaces are included via "using"
- avoid conflicts with the boost DNS library classes
Guilherme Maciel Ferreira [Tue, 12 Apr 2011 12:10:07 +0000]
Renamed packages to more appropriate names
- ping to host, because it contains classes to deal with host
- notify to link, contains classes that deal with many hosts, on link basis
Guilherme Maciel Ferreira [Tue, 12 Apr 2011 08:43:25 +0000]
Encapsulated the encode, decode, read and write methods within the IcmpMessagePayload class
- simplify the message classes
Guilherme Maciel Ferreira [Mon, 11 Apr 2011 13:56:15 +0000]
Fixed more problems issued by PC-lint
- alternative initialization to avoid calling virtual methods from constructor
Guilherme Maciel Ferreira [Mon, 11 Apr 2011 13:51:42 +0000]
Fixed more problems issued by PC-lint (3 times now, bad programmer!)
Guilherme Maciel Ferreira [Fri, 8 Apr 2011 15:44:49 +0000]
Increment the replies count when receiving a destination unreachable, avoiding the request timeout message
Guilherme Maciel Ferreira [Fri, 8 Apr 2011 15:39:19 +0000]
Separate method to print the timeout of a echo request
Guilherme Maciel Ferreira [Fri, 8 Apr 2011 15:21:03 +0000]
Found an issue with sequence number
Guilherme Maciel Ferreira [Fri, 8 Apr 2011 14:34:53 +0000]
Pinger now handles ICMP Destination Unreachable messages
- handle_receive_echo_reply rename to handle_receive_icmp_packet, once it handles not just echo replies
- timer member variable has a more meaningful name
Guilherme Maciel Ferreira [Fri, 8 Apr 2011 13:25:27 +0000]
Refactoring the ICMP message parsing
- IcmpType enum separated from the IcmpHeader class, thus it has its own header without requiring to add the IcmpHeader's header file
- the IcmpHeader class delegates the parsing polymorphically to specialized IcmpMessage classes (i.e. allowing the parsing of Destination unreachable messages)
- IcmpHeader class does not requires the Payload member variable anymore, once it delegates the parsing to IcmpMessage classes
Guilherme Maciel Ferreira [Fri, 8 Apr 2011 11:35:29 +0000]
More meaningful name for timer objects.
Guilherme Maciel Ferreira [Thu, 7 Apr 2011 13:50:35 +0000]
Given more meaningful names to the variables
Guilherme Maciel Ferreira [Thu, 7 Apr 2011 10:57:01 +0000]
More wish list items
Guilherme Maciel Ferreira [Thu, 7 Apr 2011 10:54:37 +0000]
Implemented the requirement "Support selection of the source network interface, so we can change the source ip address when ping"
- unfortunately, I couldn't find a way to bind to an interface through Bosst Asio. So it was required to rely on native Unix Socket interface.
Guilherme Maciel Ferreira [Thu, 7 Apr 2011 10:47:17 +0000]
Reading the network interface from the configuration file.
Guilherme Maciel Ferreira [Tue, 5 Apr 2011 09:58:47 +0000]
Fixed more problems issued by PC-lint.
Guilherme Maciel Ferreira [Tue, 5 Apr 2011 07:23:21 +0000]
Message aesthetical improvement
Guilherme Maciel Ferreira [Mon, 4 Apr 2011 10:14:30 +0000]
Removed the address resolution from the pinger.
- There is a special class to translate DNS to IP, thus makes no sense to keep this feature here, which simplify this class.
Guilherme Maciel Ferreira [Fri, 1 Apr 2011 07:31:42 +0000]
Fixed problems issued by PC-lint.
Guilherme Maciel Ferreira [Thu, 31 Mar 2011 10:13:06 +0000]
Included the unit in the variable names
- states clear that we expect seconds, minutes or whatever
Guilherme Maciel Ferreira [Wed, 30 Mar 2011 10:12:21 +0000]
Implemented the requirement "If we notified an external system that a link is down, also notify it if the link is back up (=stable for a configurable period of time)"
- the status of the link is reported only once, when it changes from down to up, or vice versa
- allows to configure the minimum amount of time the link must stays stable in order to report its status
Guilherme Maciel Ferreira [Wed, 30 Mar 2011 10:06:24 +0000]
Found another BUG (its capitalization gives a hint about the severity of this one)
Guilherme Maciel Ferreira [Tue, 29 Mar 2011 14:24:57 +0000]
Standardizing the enumerations
Guilherme Maciel Ferreira [Tue, 29 Mar 2011 08:03:52 +0000]
Renamed stable-link-up-interval to link-up-interval
Guilherme Maciel Ferreira [Mon, 28 Mar 2011 11:50:28 +0000]
Fixed return value, should be string, not boolean
Guilherme Maciel Ferreira [Mon, 28 Mar 2011 09:19:39 +0000]
Included boost system to the required libraries
Guilherme Maciel Ferreira [Fri, 25 Mar 2011 16:45:06 +0000]
Renamed StatusNotifier to LinkStatusAnalyzer
- the main purpose of this class is to decide whether the link is down or up, by keeping track the amount of hosts down.
- renamed the variable Analyzer to HostAnalyzer to avoid confusion with the LinkAnalyzer
Guilherme Maciel Ferreira [Fri, 25 Mar 2011 15:58:20 +0000]
Renamed PingAnalyzer to HostStatusAnalyzer
- this describes better what the class is suppode to do, analyze the status of the host, using the pings.
Thomas Jarosch [Mon, 28 Mar 2011 09:27:33 +0000]
Add TODO entry
Guilherme Maciel Ferreira [Fri, 25 Mar 2011 14:30:22 +0000]
Read the configured interval that a link must be up to notify
Guilherme Maciel Ferreira [Fri, 25 Mar 2011 13:53:30 +0000]
Placed limit qualifier in the end of variables names (i.e. xxx_limit instead of limit_xxx)
- this keeps a pleasing symmetry with other qualifiers, for example xxx_count, xxx_limit, xxx_index
Guilherme Maciel Ferreira [Fri, 25 Mar 2011 09:02:51 +0000]
Renamed PingAnalyzer's update_ping_failed_statistics() to analyze_ping_failed_count()
Guilherme Maciel Ferreira [Fri, 25 Mar 2011 09:37:45 +0000]
Improved asserts
Guilherme Maciel Ferreira [Thu, 24 Mar 2011 13:51:47 +0000]
Implemented the requirement "Intelligently retry if a host doesn't reply: Try it more often"
- PingAnalyzer::exceeded_ping_failed_count_limit() made public, thus the Analyzer can check when is required to speed up the ping (or back to the original interval)
- Included a PingInterval template class to hide the computation logic of interval speed up and slow down
Guilherme Maciel Ferreira [Thu, 24 Mar 2011 13:46:10 +0000]
Attributes names according to the company's coding style.
Guilherme Maciel Ferreira [Thu, 24 Mar 2011 10:35:15 +0000]
Renamed PingStatusNotifier to StatusNotifier
- the class scope is not restricted to ping status notification, it is
responsible to notify the system when certain amount of hosts are down,
independently of the number of pings given to that host.
Guilherme Maciel Ferreira [Wed, 23 Mar 2011 16:53:00 +0000]
Included script to notify when system is down or up
Guilherme Maciel Ferreira [Wed, 23 Mar 2011 16:11:04 +0000]
Added the requirement "If XX servers don't reply, it has to notify another system (e.g. execute a script)"
- moved the class PingStatusNotifier from ping to notify directory.
- included a new class that encapsulate the process of system notification
Guilherme Maciel Ferreira [Wed, 23 Mar 2011 12:48:53 +0000]
Linking against libi2ncommon
Guilherme Maciel Ferreira [Wed, 23 Mar 2011 10:42:49 +0000]
Renamed PingStatusNotifier::alert_host_up/down() methods to notify_host_up/down()
Guilherme Maciel Ferreira [Wed, 23 Mar 2011 10:37:30 +0000]
Added intelligence to know how many hosts are down
Guilherme Maciel Ferreira [Wed, 23 Mar 2011 10:38:29 +0000]
Const-ification
Guilherme Maciel Ferreira [Wed, 23 Mar 2011 09:39:25 +0000]
Reorganization of cmake files
- included package build
- layout change (don't know why package system was complaining about white spaces in the commands)
- redistribuition of the commands across the files
Guilherme Maciel Ferreira [Wed, 23 Mar 2011 09:37:31 +0000]
Included spec file to build the RPM package
Guilherme Maciel Ferreira [Tue, 22 Mar 2011 10:02:39 +0000]
Removed UML file, because it is out-dated and is not longer required.
Guilherme Maciel Ferreira [Tue, 22 Mar 2011 09:40:55 +0000]
Removed Pinger abstract class, thus avoiding the "design ahead" issue
- BoostPinger do not inherit form Pinger anymore
- reference from Code Complete 2nd edition, page 146, item "Be suspicious of base classes of which there is only one derived class"
Guilherme Maciel Ferreira [Tue, 22 Mar 2011 09:31:58 +0000]
Changed PingStatusNotifier interface, it is now an object shared among N hosts
- this shared property allows to know how many hosts are down, once we can keep track of all hosts
- only one PingStatusNotifier instance for all PingAnalyzers objects, they pass the host to identify themselves within the notifier object
Guilherme Maciel Ferreira [Tue, 22 Mar 2011 08:49:21 +0000]
Added status-notifier-cmd options to indicate which command to call when the system is down/up.
Guilherme Maciel Ferreira [Mon, 21 Mar 2011 14:58:20 +0000]
The limit-ping-fail option is available (and read) from the configuration file
- this option sets the threshold of pings to a host that must fail in order to mark the host as down.
Guilherme Maciel Ferreira [Mon, 21 Mar 2011 09:51:09 +0000]
Renamed the limit-to-notify configuration option to limit-hosts-down, because it is a better description of the intention.
Guilherme Maciel Ferreira [Fri, 18 Mar 2011 16:50:04 +0000]
Replaced uint by int.
- documented that a integer is non-negative using assertions, not unsigned int (uint).
Guilherme Maciel Ferreira [Fri, 18 Mar 2011 11:39:53 +0000]
Handle the error when a host cannot be resolved
- reorganization of PingScheduler to do not ping a host that was not resolved
- from now, the DnsResolver::resolve() method must be explicitly called by the client of the class
Guilherme Maciel Ferreira [Fri, 18 Mar 2011 11:30:55 +0000]
Errors flushed through cerr not cout.
Guilherme Maciel Ferreira [Fri, 18 Mar 2011 11:29:40 +0000]
Included an invalid host and a host that does not reply.
Guilherme Maciel Ferreira [Fri, 18 Mar 2011 09:47:50 +0000]
More bugs discovered and annotated
Guilherme Maciel Ferreira [Tue, 15 Mar 2011 10:55:50 +0000]
Uses the ping analyzer to evaluate the ping statistics after each ping.
Guilherme Maciel Ferreira [Tue, 15 Mar 2011 11:26:59 +0000]
Returns the amount of IPs that were resolved for the DNSResolver host.
Guilherme Maciel Ferreira [Tue, 15 Mar 2011 11:25:35 +0000]
Returns a boolean indicating if the ping was successful or not.
Guilherme Maciel Ferreira [Tue, 15 Mar 2011 10:48:05 +0000]
Bring aboard the ping analyze and notification classes.
- PingAnalyzer implements the requirement to analyze if there are multiple dns entries for a host, only call this host "failed" if can't reach any of these multiple entries.
- PingStatusNotifier implements the requirement to notify an external system that a link is down, also notify it if the link is back up.But needs improvements.
Guilherme Maciel Ferreira [Mon, 14 Mar 2011 14:44:25 +0000]
Replaced the times-to-ping parameter to simplify the code, now it pings just one time and uses a status on/off approach to check if the ping was performed.
- also BoostPinger::create_echo_request() method is const and self sufficient, use parameter instead of changing the SequenceNumber member variable
Guilherme Maciel Ferreira [Mon, 14 Mar 2011 12:42:55 +0000]
Re-organizing the headers files in order to...
- avoid hidden dependencies, by including the class header file first.
- keep a inclusion order of C headers, C++ headers, Boost headers and Project headers.
- be relative to the source directory, this keeps clear which package the source file belongs.
Guilherme Maciel Ferreira [Mon, 14 Mar 2011 12:44:52 +0000]
Explicit constructor to avoid implicit constructor-conversions-calls
Guilherme Maciel Ferreira [Fri, 11 Mar 2011 10:02:15 +0000]
PingScheduler now pings hosts IPs cyclically
- included a DNS resolver member variable to keep track of resolved IPs
- PingScheduler's constructor takes specific arguments instead of a generic Host object, this states clear which data the PingScheduler needs
Guilherme Maciel Ferreira [Fri, 11 Mar 2011 09:26:59 +0000]
Bring aboard the first scratch of a DNS resolver
- given a host DNS, this class resolves and keeps a list of IPs for that host
Guilherme Maciel Ferreira [Fri, 11 Mar 2011 09:48:39 +0000]
Aesthetic change to header files according to the project standard
Guilherme Maciel Ferreira [Thu, 10 Mar 2011 10:22:43 +0000]
Code improvements on BoostPinger
- included an assert to make sure a non-empty address is sent to the socket
- better names for the handlers methods
Guilherme Maciel Ferreira [Thu, 10 Mar 2011 14:34:25 +0000]
Moved Host class from ping directory to config directory, because it is a configuration item
Guilherme Maciel Ferreira [Thu, 10 Mar 2011 10:26:09 +0000]
Added TODO file, including known bugs report
Guilherme Maciel Ferreira [Thu, 10 Mar 2011 10:21:00 +0000]
More descriptions of the configuration in the Readme file
Guilherme Maciel Ferreira [Wed, 9 Mar 2011 09:40:34 +0000]
The echo reply timeout can be configured through parameter to BoostPinger
Guilherme Maciel Ferreira [Wed, 9 Mar 2011 08:47:23 +0000]
Renamed PingCheck class to PingScheduler.
- this name describes better the main purpose behind this class, which is to call the pinger in configured intervals
Guilherme Maciel Ferreira [Tue, 8 Mar 2011 17:56:29 +0000]
The application now pings many hosts in parallel
- uses an asynchronous approach, based on boost::asio::io_service::run() loop and asynchronous timers
Guilherme Maciel Ferreira [Tue, 8 Mar 2011 17:52:14 +0000]
Attribute renamed according to the code conventions
Guilherme Maciel Ferreira [Tue, 8 Mar 2011 17:51:37 +0000]
Included a section explaining the basics of the code