Multiple instance on Nagios

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
nagiosnandha
Posts: 8
Joined: Thu Nov 07, 2013 2:06 am

Multiple instance on Nagios

Post by nagiosnandha »

Hi,

How to install multiple Nagios instances in single server. Please provide the configuration.
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: Multiple instance on Nagios

Post by tmcdonald »

Why would you want to do this? That would cause multiple issues (if it even worked) and is not something we would ever recommend.
Former Nagios employee
emikulic
Posts: 2
Joined: Fri Jun 27, 2014 3:09 pm

Re: Multiple instance on Nagios

Post by emikulic »

I would like to do this as well for a few reasons. This is pretty common in the Nix* world to be able to run multiple instances of whatever is needed for hosting, multi tenancy, operational, test, or load purposes. Usually just entails setting new base directories for each instance, a different init script, maybe a service name, and if it binds to a port, and alternate port number.

I am working on it a bit myself to get my own going v4.0.7 second nagios server on CentOS 6.5 x64 going.
It seems a few, but not enough, of the variables are avail during compile (./configure) but not all.
I am starting to look at items it seems are hard coded into the nagios.spec file.
In particular init script names it would seem but I am no expert on this and just starting down this road.

It seems out of the box its not cut and dry.

My configure items are straight forwards and I simply place them in a script:

Code: Select all

#!/bin/bash

#
# custom nagios 4.0.7 build
# see configure --help
#
mybasename="nagios2"
thisuser="nagios2"
thisgroup="nagios2"
thiscmdgroup="nagcmd2"
thishomedir="nagios2"
thishomefile="nagios2"

./configure \
 --prefix=/usr/local/${thishomedir} \
 --exec-prefix=/usr/local/${thishomedir} \
 --with-lockfile=$prefix/var/${mybasename}.lock \
 --with-cgiurl=/${thishomedir}/cgi-bin \
 --with-htmurl=/${thishomedir} \
 --with-httpd-conf=/etc/httpd/conf.d \
 --with-nagios-user=${thisuser} \
 --with-nagios-group=${thisgroup} \
 --with-command-user=${thisuser} \
 --with-command-group=${thiscmdgroup} 

exit

But the init items, http conf file, service names, process names, and a couple other items that typically land in /etc I don't have figured out yet.
That is where I started out editing the spec file to define new variables so this could be done but that is not so straight forwards.

Would be helpful to see the necessary variables created/exposed for configure script.
sreinhardt
-fno-stack-protector
Posts: 4366
Joined: Mon Nov 19, 2012 12:10 pm

Re: Multiple instance on Nagios

Post by sreinhardt »

You can put a feature request in on tracker.nagios.org if you wish, to see some of this added, but I'll be honest in saying I doubt it will get added unless many others request it as well. Putting multiple nagios instances on a single system is not a good idea, and will be completely unsupportable by us. Adding multiple nagios processes, not to mention the sheer amount of workers then on that same system will cause quite a lot of load on your system and not allow nagios to operate properly. You will also very likely hit max open connections and max open files within a very short period of time. Finally, considering they would be running on the same system, it doesn't really give you any form of multi-tennancy or failover, as there is still one large point of failure in your system.

This is the second post about running multiple nagios processes on a single system that is quite old. I will be locking this thread as well. But I will also add, this is something that we unfortunately will be unable to help with, as it is outside the scope of our support cases. You are absolutely more than welcome to continue trying to test though, that's the beauty of open source software!
Nagios-Plugins maintainer exclusively, unless you have other C language bugs with open-source nagios projects, then I am happy to help! Please pm or use other communication to alert me to issues as I no longer track the forum.
Locked