Page 1 of 1
Launching Multiple Nagios instances on the same server
Posted: Sat Feb 08, 2014 7:05 pm
by rshankar93
I have a server on which I have installed nagios. I have duplicated the nagios.cfg file and changed some configuration properties in the duplicated file. I am trying to now launch both instances of nagios. However, both these instances would be listening on the same port. I wasn't able to find a configuration property for the port in nagios.cfg. How do I go about launching both these nagios instances, but on different ports?
Re: Launching Multiple Nagios instances on the same server
Posted: Sun Feb 09, 2014 6:09 pm
by jsmurphy
The devs may need to correct me here as my knowledge in this area is a bit out of date. There are several reasons why you probably shouldn't run multiple instances of Nagios on a single box but there's one reason in particular why you may not be able to at all. Historically in versions 2.x and early 3.x there was a particularly nasty bug where Nagios could end up running a duplicated process that would cause all kinds of unexpected weirdness. As a result there were some fail safes built in that would prevent a duplicate process running... I don't know for certain if this would affect a separate install but I suspect it might.
If you want to try it out anyway, basic Nagios Core doesn't (as far as I can remember off hand) use any port other than the basic http port. You can change this by telling Apache to bind to a different port for one of the installs.
http://httpd.apache.org/docs/current/bind.html
Re: Launching Multiple Nagios instances on the same server
Posted: Mon Feb 10, 2014 11:08 am
by abrist
If you do this, I would highly suggest you run them in chroots. You may run into issues if they share configs.
Re: Launching Multiple Nagios instances on the same server
Posted: Mon Jun 30, 2014 4:06 pm
by emikulic
I believe this should be possible if compiling from source and into different directories like:
#!/bin/bash
#
# custom nagios 4.0.7 build
# see configure --help
#
thishomedir="nagios-2"
thishomefile="nagios-2"
./configure \
--prefix=/usr/local/${thishomedir} \
--exec-prefix=/usr/local/${thishomedir} \
--with-lockfile=$prefix/var/nagios-2.lock \
--with-cgiurl=/${thishomedir}/cgi-bin \
--with-htmurl=/${thishomedir} \
--with-httpd-conf=/etc/httpd/conf.d \
--with-nagios-user=nagios \
--with-nagios-group=nagios \
--with-command-user=nagios \
--with-command-group=nagcmd
Re: Launching Multiple Nagios instances on the same server
Posted: Mon Jun 30, 2014 4:10 pm
by tmcdonald
Thank you for the input, but this thread is somewhat old and the original poster has not been back in quite a while. I will be locking this thread now.