Page 2 of 2

Re: Nagios XI and Nagvis Login Integration - Part 2.

Posted: Tue Dec 10, 2019 4:01 pm
by TBT
Okay, so we've replaced the old nagvis.ini.php with the clean copy and the login error went away.

Moving forward, all maps previously created were broken, so we've deleted them in an effort to recreate using the new version of NagVis.

NagVis > Edit Map > Add Icon > Host, then clicking produces the following error:
Failed to get objects: Error: (0) Undefined property: CorePDOHandler::$data<div class="details">URL: /nagvis/server/core/ajax_handler.php?mod=Map&act=addModify&show=TEMPLATE&type=host&x=517&y=213&_ajaxid=1576011345<br> File: /usr/local/nagvis/share/server/core/classes/CorePDOHandler.php<br> Line: 306<br> <code>#0 /usr/local/nagvis/share/server/core/classes/CorePDOHandler.php(306): nagvisExceptionErrorHandler(8, 'Undefined prope...', '/usr/local/nagv...', 306, Array)<br> #1 /usr/local/nagvis/share/server/core/classes/CorePDOHandler.php(332): CorePDOHandler->prep('SELECT name1,na...')<br> #2 /usr/local/nagvis/share/server/core/classes/GlobalBackendPDO.php(250): CorePDOHandler->query('SELECT name1,na...', Array)<br> #3 /usr/local/nagvis/share/server/core/mapcfg/default.php(145): GlobalBackendPDO->getObjects('host', '', '')<br> #4 /usr/local/nagvis/share/server/core/mapcfg/default.php(159): getObjectNames('host', Object(GlobalMapCfg), NULL, Array)<br> #5 /usr/local/nagvis/share/server/core/classes/ViewMapAddModify.php(394): listHostNames(Object(GlobalMapCfg), NULL, Array)<br> #6 /usr/local/nagvis/share/server/core/classes/ViewMapAddModify.php(509): ViewMapAddModify->drawField('host_name', Array, Array)<br> #7 /usr/local/nagvis/share/server/core/classes/ViewMapAddModify.php(537): ViewMapAddModify->drawFields(Array)<br> #8 /usr/local/nagvis/share/server/core/classes/ViewMapAddModify.php(620): ViewMapAddModify->drawForm()<br> #9 /usr/local/nagvis/share/server/core/classes/CoreModMap.php(133): ViewMapAddModify->parse()<br> #10 /usr/local/nagvis/share/server/core/functions/index.php(120): CoreModMap->handleAction()<br> #11 /usr/local/nagvis/share/server/core/ajax_handler.php(59): require('/usr/local/nagv...')<br> #12 {main}</code>Output: <pre><form id="addmodify" name="addmodify" action="javascript:submitForm('/nagvis/server/core/ajax_handler.php?mod=Map&amp;act=addModify', 'addmodify');" method="POST"> <input type="hidden" id="_form_name" name="_form_name" value="addmodify" /> <input type="hidden" id="_update" name="_update" value="0" /> <input type="hidden" id="sec" name="sec" value="general" /> <ul class="nav" id="nav"><li id="nav_general" class="active"><a href="javascript:toggle_section('general')">General</a></li><li id="nav_appearance" ><a href="javascript:toggle_section('appearance')">Appearance</a></li><li id="nav_state" ><a href="javascript:toggle_section('state')">Status</a></li><li id="nav_actions" ><a href="javascript:toggle_section('actions')">Actions</a></li><li id="nav_label" ><a href="javascript:toggle_section('label')">Label</a></li><li id="nav_worldmap" ><a href="javascript:toggle_section('worldmap')">Worldmap</a></li></ul><div id="sec_general" class="section" style=""><table class="mytable"><tr class="must"><td class=tdlabel>host_name</td><td class=tdbox></td><td class=tdfield></pre>

Re: Nagios XI and Nagvis Login Integration - Part 2.

Posted: Tue Dec 10, 2019 4:33 pm
by lmiltchev
Is your mysql db offloaded? Have you changed the "default" ndo user password? Open up the config that you backed up, and see if you have any "custom" entries in it, that you may need to transfer. If you are still having issues, I would recommend that you open a ticket via our Support Center here:

https://support.nagios.com/tickets/

Attach your latest profile to the ticket.

Re: Nagios XI and Nagvis Login Integration - Part 2.

Posted: Tue Dec 10, 2019 4:48 pm
by TBT
lmiltchev wrote:Is your mysql db offloaded? Have you changed the "default" ndo user password? Open up the config that you backed up, and see if you have any "custom" entries in it, that you may need to transfer. If you are still having issues, I would recommend that you open a ticket via our Support Center here:

https://support.nagios.com/tickets/

Attach your latest profile to the ticket.
1. Our nagios nagiosql and snmptt Databases are offloaded, NDOUtils is local.
2. ndoutils is using the default password.

Re: Nagios XI and Nagvis Login Integration - Part 2.

Posted: Tue Dec 10, 2019 5:24 pm
by lmiltchev
Oh, this explains it. So, you would need to modify the nagvis.ini.php file, and restart apache. Open the file in a text editor, and modify these lines (under the [backend_nagiosxi] section):

Code: Select all

dbhost=<ip address of the offloaded mysql server>
dbname="nagios"
dbuser="<dbuser>"
dbpass="<dbpass>"
dbinstancename="localhost"
If you are unsure of what the actual values are, you could open up the /usr/local/nagiosxi/html/config.inc.php file and look them up. Save, exit and restart apache. Try to add a host to your map to test the new config.

Re: Nagios XI and Nagvis Login Integration - Part 2.

Posted: Wed Dec 11, 2019 10:05 am
by TBT
That resolved the issue. But for the sake of interest, viewing the nagvis.ini.php.backup, both dbhost and dbname are commented out (see below) and make me question how it was working previously?

[backend_nagiosxi]
; type of backend - MUST be set
backendtype="ndomy"
; The status host can be used to prevent annoying timeouts when a backend is not
; reachable. This is only useful in multi backend setups.
;
; It works as follows: The assumption is that there is a "local" backend which
; monitors the host of the "remote" backend. When the remote backend host is
; reported as UP the backend is queried as normal.
; When the remote backend host is reported as "DOWN" or "UNREACHABLE" NagVis won't
; try to connect to the backend anymore until the backend host gets available again.
;
; The statushost needs to be given in the following format:
; "<backend_id>:<hostname>" -> e.g. "live_2:nagios"
;statushost=""
; hostname for NDO-db
;dbhost="localhost"
; portname for NDO-db
;dbport=3306
; database name for NDO-db
;dbname="nagios"
; username for NDO-db
dbuser="ndoutils"
; password for NDO-db
dbpass="REMOVED"
; prefix for tables in NDO-db
;dbprefix="nagios_"
; instance name for tables in NDO-db
dbinstancename="localhost"
; maximum delay of the NDO Database in seconds
;maxtimewithoutupdate=180
; path to the cgi-bin of this backend
;htmlcgi="/nagios/cgi-bin"

Re: Nagios XI and Nagvis Login Integration - Part 2.

Posted: Wed Dec 11, 2019 11:32 am
by lmiltchev
Honestly, I don't know how it was working before without the db connections to the remote server being specified. I wonder if in the process of upgrading NagVis, the "original" config was wiped out (rewritten) somehow. It's hard to say.

Re: Nagios XI and Nagvis Login Integration - Part 2.

Posted: Wed Dec 11, 2019 11:47 am
by TBT
Okay. We won't worry about it then.

So in the future, it should be noted that /usr/local/nagvis/etc/nagvis.ini.php needs to be modified if any of the offloaded DB credentials change.

Let's keep this thread open for a bit as we check out the new version of NagVis.

Thanks,

Re: Nagios XI and Nagvis Login Integration - Part 2.

Posted: Wed Dec 11, 2019 12:11 pm
by lmiltchev
Sounds good. We will keep the thread open.