multiple nagios instances on the same box

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
sandra2
Posts: 2
Joined: Mon Nov 02, 2015 7:46 am

multiple nagios instances on the same box

Post by sandra2 »

I am trying to run multiple instances of nagios3 on the same host

section list
PROBLEM DESCRIPTION
MY QUESTIONS (and thanks)
CONFIGURATION DESCRIPTION
ENVIROMENT DESCRIPTION


PROBLEM DESCRIPTION
I have 2 nagios instances running without error (1st instance monitoring a group of hosts, 2nd instance monitoring a different group of hosts)

Both web pages of the two instances shows me the hosts of the first instance

It seems that when the cgi (for example) status.cgi is called, it does not use the configuration file the php page has as parameter
but always reads from "/etc/nagios3/cgi.cfg"
----------
/usr/lib/cgi-bin/nagios3# strings status.cgi |grep nagios
nagios_pid
/nagios3H
/nagios3H
/nagios3I
/nagios3H
/nagios3I
/etc/nagios3/cgi.cfg
nagios_check_command
....
----------------------------------------

a var_dump(cfg) on the side.php page which calls the status.cgi seems to know where the cgi.fcg file should be (/etc/nagios3/RETE/cgi.cfg)

array(5) { ["cgi_config_file"]=> string(25) "/etc/nagios3/RETE/cgi.cfg" ["cgi_base_url"]=> string(21) "/cgi-bin/nagios3/RETE" ["main_config_file"]=> string(28) "/etc/nagios3/RETE/nagios.cfg" ["status_file"]=> string(32) "/var/lib/nagios3/RETE/status.dat" ["state_retention_file"]=> string(35) "/var/lib/nagios3/RETE/retention.dat" }

MY QUESTIONS
I understand that I could have a single instance and use nagios group to get the job done. However, I need to understand whether
1) it is possible to give the cgi.cfg file/location as an argument to /usr/lib/cgi-bin/nagios3/*cgi
2) nagios is design to be run in multiple instances? if not, could you please give me an idea of the eventual drawback?

Thank you for all your support
Best Regards
Sandra



CONFIGURATION DESCRIPTION

I have created two instances which are using 2 separate sets of configuragion files
1st instance (running without errror)
/etc/init.d/nagios3
/etc/nagios3/nagios.cfg
/etc/nagios3/conf.d
/etc/nagios3/cgi.cfg
..

2nd instance (running without errror)
/etc/init.d/nagios3RETE
/etc/nagios3/RETE/nagios.cfg
/etc/nagios3/RETE/conf.d
/etc/nagios3/RETE/cgi.cfg
..

the apache conf is common i.e. they share the same virtuahost but have different path
different scriptalias and alias



ENVIROMENT DESCRIPTION

The host is a wheezy
I am using the debian package
ii nagios3 3.4.1-3+deb7u1 amd64 A host/service/network monitoring and management system

the nagios version is nagios3 -V

Nagios Core 3.4.1
Copyright (c) 2009-2011 Nagios Core Development Team and Community Contributors
Copyright (c) 1999-2009 Ethan Galstad
Last Modified: 05-11-2012
License: GPL
jdalrymple
Skynet Drone
Posts: 2620
Joined: Wed Feb 11, 2015 1:56 pm

Re: multiple nagios instances on the same box

Post by jdalrymple »

Let's start with this one:
sandra2 wrote:2) nagios is design to be run in multiple instances? if not, could you please give me an idea of the eventual drawback?
No - which segways us to:
sandra2 wrote:1) it is possible to give the cgi.cfg file/location as an argument to /usr/lib/cgi-bin/nagios3/*cgi
It just wasn't built with multi-tenancy in mind. Most of the important options are compile-time configured. That's not to say that you can't perform those configuration, but in today's world of "hardware as a service" I feel you'd be shooting yourself in the foot to not just spin up a new VM.

If you want to have a clear view of the specific compile time options - take a peek at the config.log. You'll find plenty of important paths within... one of the biggest (and possibly the one blowing you up) is cgiurl.
sandra2
Posts: 2
Joined: Mon Nov 02, 2015 7:46 am

Re: multiple nagios instances on the same box

Post by sandra2 »

thank you jdalrymple
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: multiple nagios instances on the same box

Post by rkennedy »

Has this answered your question @sandra2? Do you mind if I close this thread?
Former Nagios Employee
User avatar
hsmith
Agent Smith
Posts: 3539
Joined: Thu Jul 30, 2015 11:09 am
Location: 127.0.0.1
Contact:

Re: multiple nagios instances on the same box

Post by hsmith »

Is there anything else we can do for you in this thread, or are we all right to close it?
Former Nagios Employee.
me.
Locked