Page 1 of 1

DNX Master + Slaves - Load balancing.

Posted: Tue Feb 03, 2015 9:29 am
by Farido
Hello,

I am trying to create the following structure:
Image

The monitoring services are working but i want to create more load balancing by creating 1 Master DNX server, with multiple DNX Slaves/Workers.
As described in Using Nagios for Load Balancing PDF i tried the following but i keep getting errors. This is my first time using nagios, excuse me.

This is what i did:

Code: Select all

1. Log on to one of your Nagios servers that will serve as a “slave”, or worker client, as the root user.
2. Download the automated installation script to the /tmp directory:
cd /tmp
wget http://assets.nagios.com/downloads/nagiosxi/scripts/NagiosXI-DNX.sh
3. Make the script executable:
chmod +x NagiosXI-DNX.sh
4. Run the script in client mode
./NagiosXI-DNX.sh -c
5. Repeat steps 1-4 for each slave system.
6. Repeat steps 1-3 on the master Nagios server.
7. Run the script in server mode, optionally enabling automatic synchronization of check plugins by ssh (recommended).
./NagiosXI-DNX.sh -s -e
Response After step 4:

Code: Select all

sed: can't read /usr/local/nagios/etc/dnxClient.cfg: No such file or directory
sed: can't read /usr/local/nagios/etc/dnxClient.cfg: No such file or directory
ln: creating symbolic link `/etc/init.d/dnxcld': File exists
error reading information on service dnxcld: No such file or directory
error reading information on service dnxcld: No such file or directory
dnxcld: unrecognized service
What should i have done or should i do to realize what i want? I used a mod_gearman version for nagios.

Re: DNX Master + Slaves - Load balancing.

Posted: Tue Feb 03, 2015 1:17 pm
by lmiltchev
The last release date on the DNX project was 2010-04-13 (on the Nagios Exchange)...
The steps, outlined in our documentation worked the last time I tried them, but this was a long time ago. I will try to recreate the issue in house. Can you run the following commands on the master and all of the slaves, and show us the output?

Code: Select all

uname -a
cat /etc/*release
In my opinion, mod gearman is a lot better option. Have you tried setting it up? Here's a document that you can follow:

http://assets.nagios.com/downloads/nagi ... ios_XI.pdf

Re: DNX Master + Slaves - Load balancing.

Posted: Wed Feb 04, 2015 8:41 am
by litsupport.box
Hello lmiltchev Farido here,

Thank you for your response, I have done what you asked me to do. and these are the results:
Master:

Code: Select all

Last login: Wed Feb  4 12:17:44 2015 from pc5995.COMPANYNAME.net
[root@sr0336 ~]# uname -a
Linux sr0336.COMPANYNAME.net 2.6.32-431.29.2.el6.x86_64 #1 SMP Tue Sep 9 21:36:05 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux
[root@sr0336 ~]# cat /etc/*release
CentOS release 6.5 (Final)
CentOS release 6.5 (Final)
CentOS release 6.5 (Final)
Worker:

Code: Select all

Last login: Wed Feb  4 10:28:18 2015 from pc5995.COMPANYNAME.net
[root@boxsr0338 ~]# uname -a
Linux sr0338.COMPANYNAME.net 2.6.32-431.29.2.el6.x86_64 #1 SMP Tue Sep 9 21:36:05 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux
[root@sr0338 ~]# cat /etc/*release
CentOS release 6.5 (Final)
CentOS release 6.5 (Final)
CentOS release 6.5 (Final)
I started following this guide as you mentioned: http://assets.nagios.com/downloads/nagi ... ios_XI.pdf

When i try gearman_top on a worker i get the following:

Code: Select all

2015-02-04 14:15:31  -  localhost:4730

 failed to connect to localhost:4730 - Connection refused
When i try the same on the master i get the following:

Code: Select all

2015-02-04 14:38:18  -  localhost:4730  -  v1.1.8

 Queue Name                                  | Worker Available | Jobs Waiting | Jobs Running
-----------------------------------------------------------------------------
 eventhandler                                 |               0  |           0  |           0
 host                                              |               0  |           0  |           0
 service                                          |               0  |           0  |           0
 worker_sr0336.COMPANYNAME.net |               1  |           0  |           0
-----------------------------------------------------------------------------
**Shouldn't the other worker be here too? i set the IP to the one of the master server during the installation?
I found this topic about the same thing: http://support.nagios.com/forum/viewtop ... 16&t=22300 but as this is my first time using nagios i'm curious if this is what i want to achieve. 1 Master server with the monitoring results (which will be displayed in the office), multiple workers/slaves that will run checks on all servers. What is the most simple solution to this? i hope you can understand my way of explaining as i'm new to this.

Re: DNX Master + Slaves - Load balancing.

Posted: Wed Feb 04, 2015 10:54 am
by slansing
The easiest way I can think of would be to designate host groups to the workers, you can do so through the configuration file. This way, you can control which slaves are running which checks, and since you are doing it by hostgroups, you can assign multiple hosts at once.

Re: DNX Master + Slaves - Load balancing.

Posted: Thu Feb 05, 2015 4:10 am
by litsupport.box
To come back to my main question, i followed the following guides on http://sites.box293.com/nagios/guides/m ... -nagios-xi i started over and followed his guide. Now it seems to work.

@slansing: thank you for pointing me into that direction thats exactly what i want.

I've encountered some other problems now but i will roam through the forum to see if i can find anything about that first.

Re: DNX Master + Slaves - Load balancing.

Posted: Thu Feb 05, 2015 11:17 am
by lmiltchev
Farido, I am glad your issue has been resolved! Is is safe to lock this topic?

Re: DNX Master + Slaves - Load balancing.

Posted: Fri Feb 06, 2015 3:05 am
by litsupport.box
Yes, thank you. If i run into anything else now it would be a completely different subject.