Launching Multiple Nagios instances on the same server
-
- Posts: 7
- Joined: Fri Jan 31, 2014 1:05 pm
Launching Multiple Nagios instances on the same server
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
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
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
If you do this, I would highly suggest you run them in chroots. You may run into issues if they share configs.
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
Re: Launching Multiple Nagios instances on the same server
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
#!/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
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.
Former Nagios employee