Guides‎ > ‎Mod Gearman‎ > ‎Workers‎ > ‎

CentOS 6.5

My CentOS 6.5 x64 server is freshly deployed with a minimal install.

NOTE: This guide is about installing a Mod Gearman Worker on an EXTERNAL server (a completely different server to the Nagios server).

Install Nagios Plugins

This is required as the workers are going to need the plugins like check_http, check_nt, check_ping etc.


Install check_nrpe Plugin

If your workers are going to be running NRPE checks then the check_nrpe plugin needs to be installed on the workers.


Install EPEL Repository

NSClient++ requires some packages that are in the EPEL Repository.
  • Type yum -y install epel-release and press Enter
  • Wait while the component is downloaded and installed


Install Mod Gearman

  • Type cd /tmp and press Enter
  • Type wget http://assets.nagios.com/downloads/mod_gearman/rpms/mod_gearman-1.5.0b1-1.el6.x86_64.rpm and press Enter
  • Wait while the file is downloaded
  • Type yum -y localinstall --nogpgcheck mod_gearman-1.5.0b1-1.el6.x86_64.rpm and press Enter
  • Wait while the dependencies are downloaded/installed and mod gearman is installed

At this point:

  • Gearman (gearmand) is installed and stopped (this doesn't get used in a worker scenario)
  • Mod Gearman Worker (mod_gearman_worker) is installed and stopped


Worker Configuration

The default configuration file for the Worker is /etc/mod_gearman/mod_gearman_worker.conf

Now the worker needs to be configued to know the address of the Job server. I my case the Job server is using the IP Address 10.25.15.1.
  • Type nano /etc/mod_gearman/mod_gearman_worker.conf and press Enter
  • Add the following line to the config file, anywhere is fine (I'm adding it under the NDOUtils module)
  • Find the setting:
    • server=localhost:4730
  • Change this to:
    • server=10.25.15.1:4730
  • Press Ctrl + x
  • Type Y
  • Press Enter to save changes

Now start the worker service:
  • Type service mod_gearman_worker start and press Enter


Also, it's important to configure the service to start at boot,

  • Type chkconfig --add mod_gearman_worker and press Enter
  • Type chkconfig mod_gearman_worker on and press Enter

That's all there is to it.

Considerations

When remote checks are executed like check_nrpe, you'll need to make sure that the remote servers allow nrpe connections from the worker servers. This is defined in either:
  • /etc/xinetd.d/nrpe
    • only_from    =
  • /usr/local/nagios/etc/nrpe.cfg
    • allowed_hosts=