     Nagios automatic hosts self-registration software (NAR)

v0.1 - initial release
v0.2 - bugfixing
v0.21 - and bigfixing again

  NAR is designed to automate new hosts registration in Nagios monitoring system in 
any dynamic environment – IT service business, cloud computing and etc.

  NAR consists of several parts working together:
    * Special service (in terms of Nagios) assigned to main Nagios host with event 
      handler (file self_registrar)
    * Beanstalk task queue manager
    * Nagios-AR commands processor daemon
    * Self activate script (file self_activate)
    * Special host template assigned to any new dynamic host with event handler
      (heart-beat)
    
  The whole process:
    1. New dynamic host sends registration via self_activate (via NSCA) indicating 
       its DNS hostname or IP to Nagios host to service mentioned above.
    2. Service upon state change calls event handler (self_registrar).
    3. Event handler (self_registrar) saves command into Beanstalk queue.
    4. Nagios-AR daemon watches Beanstalk queue. When new command arrives it gets
       processed. Commands are:
         * add hostname(ip) list_of_hostgroups_separated_by_comma list_of_host_templates_separated_by_comma
         * remove hostname(ip)
         * register hostname(ip)
         * deregister hostname(ip)

       First complimentary pair of commands creates new Nagios configuration file/
       removes Nagios configuration file for a specific host.
       Second complimentary pair modifies parameter 'register' in existent host configuration
       file.
       If commands arrive less in 5 seconds intervals Nagios-AR continues processing them. 
       If nothing comes after last command Nagios-AR reloads Nagios daemon in order to
       activate configuration modifications.
    5. Because dynamic hosts use special host template with NAR event handler when host
       becomes unavailable or down Nagios calls that event handler and thus deregisters
       'dead' host.

Requirements:
    Pyhon packages - beanstalkc, daemon. The rest are IMHO standard in Ubuntu/Debian
    Nagios V3 - up and running
    NSCA server - up and running
    Beanstalkd - up and running

That's all. I hope I'm not along who needs that ;-)

Best regards 
Andrey A. Porodko <andrey.porodko@gmail.com>
