pingcheck
14 years agoAdded doxygen comments in the most important places.
Guilherme Maciel Ferreira [Wed, 4 May 2011 16:26:27 +0000]
Added doxygen comments in the most important places.

14 years agoTurn BoostPinger into true async operation
Thomas Jarosch [Wed, 4 May 2011 16:10:38 +0000]
Turn BoostPinger into true async operation

14 years agoNo rescheduling in BoostPinger
Thomas Jarosch [Wed, 4 May 2011 15:01:15 +0000]
No rescheduling in BoostPinger

14 years agoImplemented the feature:
Guilherme Maciel Ferreira [Wed, 4 May 2011 13:29:20 +0000]
Implemented the feature:
- Make the link down interval also configurable. Today it is possible just to
  configure the amount of time the link must to be up to notify. Do another
  configuration to allow the time of link down.

14 years agoTwo TODO entrys solved
Thomas Jarosch [Wed, 4 May 2011 13:40:14 +0000]
Two TODO entrys solved

14 years agoReuse BoostPinger object
Thomas Jarosch [Wed, 4 May 2011 13:39:50 +0000]
Reuse BoostPinger object

14 years agoFix ping of IP addresses (don't do DNS lookup)
Thomas Jarosch [Wed, 4 May 2011 09:59:43 +0000]
Fix ping of IP addresses (don't do DNS lookup)

14 years agoSolved the item:
Guilherme Maciel Ferreira [Wed, 4 May 2011 09:41:06 +0000]
Solved the item:
- Perform a better treatment of missing configuration items, actually the
  application just crashes.

All items that are strictly required have default values, or are checked against
valid values. The last item missing was nameserver, which has a default value now.

14 years agoAlternative approach to solve:
Guilherme Maciel Ferreira [Wed, 4 May 2011 08:50:49 +0000]
Alternative approach to solve:
- If one of the "[host]" in the configuration file omit the "interval" entry,
  the application uses the next "[host]"'s "interval" entry, instead of a
  default value. The problem is specific to the configuration read classes
  that are not smart enough to verify which "[host]" have this entry and which
  don't.
  Example:
     [host]
     name=A
     [host]
     name=B
     interval=1
     [host]
     name=C
     interval=3
  Thus, the tuples will be (A,1) , (B,3), (C,?), but A should have a default
  value, instead of borrow B's value.

The approach consists of ensure the program only runs if there is an interval
for every single host.

14 years agoAllowing unknown options and changed the default host down limit to 0
Guilherme Maciel Ferreira [Wed, 4 May 2011 08:22:45 +0000]
Allowing unknown options and changed the default host down limit to 0

14 years agoClean thread shutdown
Thomas Jarosch [Tue, 3 May 2011 13:30:03 +0000]
Clean thread shutdown

14 years agoRemove boost signal handler: It's overdesigned for our use case and creates another...
Thomas Jarosch [Tue, 3 May 2011 12:55:40 +0000]
Remove boost signal handler: It's overdesigned for our use case and creates another thread just to wait for signals

14 years agoHandle signals in a thread safe way
Thomas Jarosch [Tue, 3 May 2011 12:53:35 +0000]
Handle signals in a thread safe way

14 years agoConvert signal handler library to unix line endings
Thomas Jarosch [Tue, 3 May 2011 11:37:37 +0000]
Convert signal handler library to unix line endings

14 years agoCreate unique identifier for every ping
Thomas Jarosch [Tue, 3 May 2011 09:56:41 +0000]
Create unique identifier for every ping

14 years agoMoved the boost signal handler library
Guilherme Maciel Ferreira [Tue, 3 May 2011 09:06:06 +0000]
Moved the boost signal handler library

14 years agoUpdated TODO
Guilherme Maciel Ferreira [Tue, 3 May 2011 09:04:44 +0000]
Updated TODO

14 years agoThe multi-threading approach solves the blocking
Guilherme Maciel Ferreira [Tue, 3 May 2011 08:34:09 +0000]
The multi-threading approach solves the blocking

14 years agoMerge branch 'pingcheck' of ssh://aqua.m.i2n/data/git/intranator/source into pingcheck
Guilherme Maciel Ferreira [Tue, 3 May 2011 08:26:30 +0000]
Merge branch 'pingcheck' of ssh://aqua.m.i2n/data/git/intranator/source into pingcheck

14 years agoTODO changes
Guilherme Maciel Ferreira [Tue, 3 May 2011 08:12:34 +0000]
TODO changes

14 years agoworking signal handler
Guilherme Maciel Ferreira [Tue, 3 May 2011 08:10:15 +0000]
working signal handler

14 years agoRenamed project from libpingcheck to pingcheck
Thomas Jarosch [Tue, 3 May 2011 08:04:15 +0000]
Renamed project from libpingcheck to pingcheck

14 years agoUpdate TODO
Thomas Jarosch [Tue, 3 May 2011 08:01:53 +0000]
Update TODO

14 years agoModularization of the main.cpp
Guilherme Maciel Ferreira [Mon, 2 May 2011 16:16:43 +0000]
Modularization of the main.cpp
- semantic order enforced by parameters
- less spaghetti code
- code more readable
- can be moved to a class more easily

14 years agoDefining the LinkStatusAnalyzerItem
Guilherme Maciel Ferreira [Mon, 2 May 2011 16:00:03 +0000]
Defining the LinkStatusAnalyzerItem
- to keep the standard
- to provide the same benefits as the other Item types

14 years agoDefining the type PingSchedulerList as a vector of PingSchedulerItem
Guilherme Maciel Ferreira [Mon, 2 May 2011 15:58:01 +0000]
Defining the type PingSchedulerList as a vector of PingSchedulerItem
- to keep the standard
- same benefits as HostList

14 years agoDefining the type HostList as a vector of HostItem
Guilherme Maciel Ferreira [Mon, 2 May 2011 15:56:16 +0000]
Defining the type HostList as a vector of HostItem
- provides a central point to change the container type
- makes the code more readable
- reduces the amount of code to read

14 years agoStarts pinging immediately, instead of schedule to start "interval" seconds later
Guilherme Maciel Ferreira [Mon, 2 May 2011 12:39:54 +0000]
Starts pinging immediately, instead of schedule to start "interval" seconds later

14 years agoRenamed handle_timeout_echo_reply() to handle_timeout_icmp_packet()
Guilherme Maciel Ferreira [Mon, 2 May 2011 12:17:11 +0000]
Renamed handle_timeout_echo_reply() to handle_timeout_icmp_packet()
- the name is more appropriate once the timeout is not triggered if any kind of ICMP packet arrive, not just echo reply

14 years agoUsing lock_guard to handle mutex locking/unlocking through RAII
Guilherme Maciel Ferreira [Mon, 2 May 2011 11:00:47 +0000]
Using lock_guard to handle mutex locking/unlocking through RAII

14 years agoThe BoostPinger is more picky about received packets, because when running in
Guilherme Maciel Ferreira [Mon, 2 May 2011 10:30:42 +0000]
The BoostPinger is more picky about received packets, because when running in
parallel with other BoostPingers, it could receive echo replies from any host,
leading to things like:
    26 bytes from 209.85.149.104: icmp_seq=1 ttl=54 time=24 ms   <-- pinger A received packet from host A
    26 bytes from 209.85.149.104: icmp_seq=1 ttl=54 time=1999 ms <-- pinger B received packet from host A??
     - Host up: www.postbank.de                                  <-- what? You didn't receive any packet from the host you had ping
     - Stick to the original ping interval: 10s
     - Time elapsed since last ping: 12s                         <-- OK, pinger A parsed the packet from host A
     - Stick to the original ping interval: 5s
     - Time elapsed since last ping: 6s                          <-- WRONG, pinger B should not parse the packet from host A

14 years agoRunning the BoostPingers in parallel (multi-thread approach instead of assynchronous)
Guilherme Maciel Ferreira [Mon, 2 May 2011 10:21:46 +0000]
Running the BoostPingers in parallel (multi-thread approach instead of assynchronous)

14 years agoRemoved fixed bugs
Guilherme Maciel Ferreira [Mon, 2 May 2011 09:58:57 +0000]
Removed fixed bugs

14 years agoAdded a mutex to avoid data race conditions in the shared link status object
Guilherme Maciel Ferreira [Mon, 2 May 2011 07:37:37 +0000]
Added a mutex to avoid data race conditions in the shared link status object

14 years agoBetter comments
Guilherme Maciel Ferreira [Fri, 29 Apr 2011 13:41:25 +0000]
Better comments

14 years agoIntroduce connd pingcheck subsystem based upon NTP subsystem
Thomas Jarosch [Fri, 29 Apr 2011 14:08:53 +0000]
Introduce connd pingcheck subsystem based upon NTP subsystem

fooo

14 years agoSeparated the endpoint creation in a method
Guilherme Maciel Ferreira [Fri, 29 Apr 2011 11:46:38 +0000]
Separated the endpoint creation in a method

14 years agoBuild rpm package in parallel
Thomas Jarosch [Fri, 29 Apr 2011 09:31:52 +0000]
Build rpm package in parallel

14 years agoMake the status notifcation cmd optional. Also make the status parameter optional
Thomas Jarosch [Fri, 29 Apr 2011 09:30:29 +0000]
Make the status notifcation cmd optional. Also make the status parameter optional

14 years agoSwitch log level to ::Info during development
Thomas Jarosch [Fri, 29 Apr 2011 09:29:52 +0000]
Switch log level to ::Info during development

14 years agoDon't bind the source interface if not specified
Thomas Jarosch [Fri, 29 Apr 2011 09:20:18 +0000]
Don't bind the source interface if not specified

14 years agoComment out -Werror as rpm will compile with -O2 - this results in warnings
Thomas Jarosch [Fri, 29 Apr 2011 09:02:13 +0000]
Comment out -Werror as rpm will compile with -O2 - this results in warnings

14 years agoIclude Intra2net commercial license for now
Thomas Jarosch [Fri, 29 Apr 2011 09:01:51 +0000]
Iclude Intra2net commercial license for now

14 years agoIncluded doxygen comments to member variables.
Guilherme Maciel Ferreira [Thu, 28 Apr 2011 14:24:01 +0000]
Included doxygen comments to member variables.

14 years agoLog messages via I2n::Logger instead of cout/cerr.
Guilherme Maciel Ferreira [Thu, 28 Apr 2011 12:29:04 +0000]
Log messages via I2n::Logger instead of cout/cerr.

14 years agoSplit Readme file.
Guilherme Maciel Ferreira [Thu, 28 Apr 2011 09:44:10 +0000]
Split Readme file.
- code conventions moved to Readme.code

14 years agoPingInterval class changed from template to regular class to make it simple.
Guilherme Maciel Ferreira [Thu, 28 Apr 2011 09:39:49 +0000]
PingInterval class changed from template to regular class to make it simple.

14 years agoFixed some issues issued by PC-lint
Guilherme Maciel Ferreira [Thu, 21 Apr 2011 09:29:37 +0000]
Fixed some issues issued by PC-lint

14 years agoImprovement of ConfigurationReader
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

14 years agoImplemented feature: Program runs as daemon
Guilherme Maciel Ferreira [Wed, 20 Apr 2011 09:32:14 +0000]
Implemented feature: Program runs as daemon

14 years agoThe speed_up method could set the Interval to zero, which is a bug.
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.

14 years agoFixed bug: If one ping fails, the subsequent analysis report that the ping is down.
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.

14 years agoSplit the code of DnsResolver::resolve into more methods
Guilherme Maciel Ferreira [Tue, 19 Apr 2011 07:25:04 +0000]
Split the code of DnsResolver::resolve into more methods

14 years agoImplemented feature: cache DNS requests info only until DNS reply is valid (TTL).
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)

14 years agoFixed the type punning from boost::net::dns::message class
Guilherme Maciel Ferreira [Mon, 18 Apr 2011 07:32:46 +0000]
Fixed the type punning from boost::net::dns::message class

14 years agoRemoved one level of indirection provided by PingScheduler::handle_next_ping
Guilherme Maciel Ferreira [Fri, 15 Apr 2011 13:44:51 +0000]
Removed one level of indirection provided by PingScheduler::handle_next_ping

14 years agoReading the nameserver form configuration file
Guilherme Maciel Ferreira [Fri, 15 Apr 2011 13:19:35 +0000]
Reading the nameserver form configuration file

14 years agoNon-virtual destructors for classes that are unlikely to be base classes
Guilherme Maciel Ferreira [Fri, 15 Apr 2011 12:10:01 +0000]
Non-virtual destructors for classes that are unlikely to be base classes

14 years agoUsing the boost-net-dns library to resolve DNS host names
Guilherme Maciel Ferreira [Fri, 15 Apr 2011 11:04:13 +0000]
Using the boost-net-dns library to resolve DNS host names

14 years agoCommented the -O2 optmization level because it activates the -Wstrict-aliasing warnin...
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.

14 years agoReplaced post-fixed by pre-fixed increment
Guilherme Maciel Ferreira [Wed, 13 Apr 2011 08:52:37 +0000]
Replaced post-fixed by pre-fixed increment

14 years agoIncreased the warning level
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

14 years agoUsing the std namespace within the souce file
Guilherme Maciel Ferreira [Wed, 13 Apr 2011 08:28:00 +0000]
Using the std namespace within the souce file

14 years agoOnly the "using namespace std" is allowed, classes from other namespaces are included...
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

14 years agoRenamed packages to more appropriate names
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

14 years agoEncapsulated the encode, decode, read and write methods within the IcmpMessagePayload...
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

14 years agoFixed more problems issued by PC-lint
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

14 years agoFixed more problems issued by PC-lint (3 times now, bad programmer!)
Guilherme Maciel Ferreira [Mon, 11 Apr 2011 13:51:42 +0000]
Fixed more problems issued by PC-lint (3 times now, bad programmer!)

14 years agoIncrement the replies count when receiving a destination unreachable, avoiding the...
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

14 years agoSeparate method to print the timeout of a echo request
Guilherme Maciel Ferreira [Fri, 8 Apr 2011 15:39:19 +0000]
Separate method to print the timeout of a echo request

14 years agoFound an issue with sequence number
Guilherme Maciel Ferreira [Fri, 8 Apr 2011 15:21:03 +0000]
Found an issue with sequence number

14 years agoPinger now handles ICMP Destination Unreachable messages
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

14 years agoRefactoring the ICMP message parsing
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

14 years agoMore meaningful name for timer objects.
Guilherme Maciel Ferreira [Fri, 8 Apr 2011 11:35:29 +0000]
More meaningful name for timer objects.

14 years agoGiven more meaningful names to the variables
Guilherme Maciel Ferreira [Thu, 7 Apr 2011 13:50:35 +0000]
Given more meaningful names to the variables

14 years agoMore wish list items
Guilherme Maciel Ferreira [Thu, 7 Apr 2011 10:57:01 +0000]
More wish list items

14 years agoImplemented the requirement "Support selection of the source network interface, so...
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.

14 years agoReading the network interface from the configuration file.
Guilherme Maciel Ferreira [Thu, 7 Apr 2011 10:47:17 +0000]
Reading the network interface from the configuration file.

14 years agoFixed more problems issued by PC-lint.
Guilherme Maciel Ferreira [Tue, 5 Apr 2011 09:58:47 +0000]
Fixed more problems issued by PC-lint.

14 years agoMessage aesthetical improvement
Guilherme Maciel Ferreira [Tue, 5 Apr 2011 07:23:21 +0000]
Message aesthetical improvement

14 years agoRemoved the address resolution from the pinger.
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.

14 years agoFixed problems issued by PC-lint.
Guilherme Maciel Ferreira [Fri, 1 Apr 2011 07:31:42 +0000]
Fixed problems issued by PC-lint.

14 years agoIncluded the unit in the variable names
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

14 years agoImplemented the requirement "If we notified an external system that a link is down...
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

14 years agoFound another BUG (its capitalization gives a hint about the severity of this one)
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)

14 years agoStandardizing the enumerations
Guilherme Maciel Ferreira [Tue, 29 Mar 2011 14:24:57 +0000]
Standardizing the enumerations

14 years agoRenamed stable-link-up-interval to link-up-interval
Guilherme Maciel Ferreira [Tue, 29 Mar 2011 08:03:52 +0000]
Renamed stable-link-up-interval to link-up-interval

14 years agoFixed return value, should be string, not boolean
Guilherme Maciel Ferreira [Mon, 28 Mar 2011 11:50:28 +0000]
Fixed return value, should be string, not boolean

14 years agoIncluded boost system to the required libraries
Guilherme Maciel Ferreira [Mon, 28 Mar 2011 09:19:39 +0000]
Included boost system to the required libraries

14 years agoRenamed StatusNotifier to LinkStatusAnalyzer
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

14 years agoRenamed PingAnalyzer to HostStatusAnalyzer
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.

14 years agoAdd TODO entry
Thomas Jarosch [Mon, 28 Mar 2011 09:27:33 +0000]
Add TODO entry

14 years agoRead the configured interval that a link must be up to notify
Guilherme Maciel Ferreira [Fri, 25 Mar 2011 14:30:22 +0000]
Read the configured interval that a link must be up to notify

14 years agoPlaced limit qualifier in the end of variables names (i.e. xxx_limit instead of limit...
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

14 years agoRenamed PingAnalyzer's update_ping_failed_statistics() to analyze_ping_failed_count()
Guilherme Maciel Ferreira [Fri, 25 Mar 2011 09:02:51 +0000]
Renamed PingAnalyzer's update_ping_failed_statistics() to analyze_ping_failed_count()

14 years agoImproved asserts
Guilherme Maciel Ferreira [Fri, 25 Mar 2011 09:37:45 +0000]
Improved asserts

14 years agoImplemented the requirement "Intelligently retry if a host doesn't reply: Try it...
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

14 years agoAttributes names according to the company's coding style.
Guilherme Maciel Ferreira [Thu, 24 Mar 2011 13:46:10 +0000]
Attributes names according to the company's coding style.

14 years agoRenamed PingStatusNotifier to StatusNotifier
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.

14 years agoIncluded script to notify when system is down or up
Guilherme Maciel Ferreira [Wed, 23 Mar 2011 16:53:00 +0000]
Included script to notify when system is down or up