Home Directory Addons Components ModGearman XI Manager

Search Exchange

Search All Sites

Nagios Live Webinars

Let our experts show you how Nagios can help your organization.

Contact Us

Phone: 1-888-NAGIOS-1
Email: sales@nagios.com


Remember Me

ModGearman XI Manager

Current Version
Last Release Date
Compatible With
  • Nagios XI

Help Support Ethan Galstad's New Project:

Help Support Ethan

A Message From The Founder...

As the founder of Nagios, I'm asking for your help in a cause that's dear to my heart.

I'm launching a new project to help better the world by providing the information, ideas, and inspiration that I believe can improve the lives of people everywhere.

I know you're busy managing networks, but I would appreciate it if you would consider liking my Facebook page and showing your support for the content and messages I produce by sharing them with your friends and family.

You can learn more about my project by visiting ethangalstad.me/nagios. Thank you for your time. I wish you all the best in your endeavors, whatever they may be.

- Ethan

This is a component used to manage a variety of ModGearman Servers/Workers, possibly running different versions of ModGearman, from a central location - within the Nagios XI interface.

Updated for systemd by MyCatHasEyes (Thanks Steve!) https://github.com/hedenface/ModGearmanXIManager/commits/master?author=MyCatHasEyes

Update to fix some PHP log errors and SSH (Thanks again Steve! ;) )
Fork of: https://exchange.nagios.org/directory/Addons/Components/ModGearman-Manager/details

* Improved codebase
* Accounts for more significant worker variables [username to connect as, configuration file location, service control script]
* Tests and prints meaningful output as to the state of gearman worker processes on remote servers

How to Use
1) Download the ZIP file (http://heden.consulting/nagios/modgearmanxi.zip)
2) Upload it to your Nagios XI instance (Admin -> Manage Components -> Upload)
3) Run the included setup.sh file, which sets up necessary permissions on the workers
4) Update the $gearmanxi_cfg array in modgearmanxi.php to reflect your environment
5) Click on Admin -> ModGearman XI Manager and enjoy managing your ModGearman instances!
Reviews (2)
I have tried to test the component but when loading it to Nagios XI (version 5.4.4), it displays the message "Component installation failed. Uploaded file is not a component."
Very nice software, it gives the ability to change worker options and check status of each, but it doesn't support systemctl yet, only initd.
The best thing to do IMO would be to add to the cfg array in modgearmanxi.config.inc.php a key like 'bootmgr' with values 'initd' or 'systemctl' to handle this.

for now, to enable it for systemctl i did the following:

On the worker server:
Added the following to /etc/sudoers with command "visudo" (at the bottom of the file):
myuser ALL = NOPASSWD: /usr/bin/systemctl start mod-gearman2-worker
myuser ALL = NOPASSWD: /usr/bin/systemctl stop mod-gearman2-worker
myuser ALL = NOPASSWD: /usr/bin/systemctl restart mod-gearman2-worker

NOTE: change "myuser" to whatever user you configured on setup.sh
This enables remote ssh to sudo the command on the worker without asking for a pw.

On the XI Server:

cd /usr/local/nagiosxi/html/includes/components/modgearmanxi/

Changed modgearmanxi.config.inc.php:
in each entry in the array i put the following:
'initd' => 'mod-gearman2-worker.service'

Changed modgearmanxi.php:
1) replaced function service_status with the following:
function service_status($user, $host, $script, &$return_output) {
exec_ssh_command($user, $host, "systemctl status $script", $output, $return_var);
$output = $output[2];
if ($return_var == 0) {
$return_output = $output;
if (strpos($output, "Active: active") !== false)
return true;
} else {
if (strpos($output, "Active: inactive") !== false)
$return_output = $output;
$return_output = "Unknown error running service control script";
return false;

2) replaced function control_worker with the following:
function control_worker($action) {

global $gearmanxi_cfg;
global $errors;
$worker_id = base64_decode(grab_request_var("worker_id", ""));
if ($worker_id === false) {
$errors[] = "Attempted to control worker with no worker specified";
return false;

// make sure user input sane
if ($action !== "start" && $action !== "restart" && $action !== "stop") {
$errors[] = "Available options for service control: start/restart/stop";
return false;

$worker = $gearmanxi_cfg["worker"][$worker_id];
exec_ssh_command($worker["user"], $worker["ip"], "sudo systemctl $action " . $worker["initd"], $output, $return_var);
if ($return_var == 0)
return true;

return false;

Owner's reply

This has been updated in the most recent version. Thanks!