multiple nagios instances on the same box
Posted: Mon Nov 02, 2015 8:40 am
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
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