Page 1 of 2

backend_ID error message ( Nagivs )

Posted: Thu Dec 09, 2021 5:00 am
by ABBsupervision
Hello teams,

I have a problem with backend ID, when i created the backend i cant see it in the drop-down list. But when i select this backend i receive an error message.

Please find below the error message :

Code: Select all

Failed to get objects: Error: (0) Undefined property: CorePDOHandler::$data<div class="details">URL: /nagvis/server/core/ajax_handler.php?mod=Map&act=addModify&_ajaxid=1639043537<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(248): 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>
Could you help us ?
Best regards,
SOUHAIB

Re: backend_ID error message ( Nagivs )

Posted: Thu Dec 09, 2021 6:11 pm
by ssax
The backend_id by default should be nagiosxi in your /usr/local/nagvis/etc/nagvis.inc.php, so it must've been modified based on your screenshot.

Please run this command as root and PM me the resulting /tmp/NAGVISFILES.tar.gz file:

Code: Select all

GZIP=-9 tar czf /tmp/NAGVISFILES.tar.gz /usr/local/nagvis
What version of XI are you using? You can grab it from the bottom left hand side of the web interface.

Re: backend_ID error message ( Nagivs )

Posted: Fri Dec 10, 2021 2:58 am
by ABBsupervision
Hello,

please find attached the requested file.

the version used is Nagios XI 5.7.5

I inform you that I also have another error message when I try to add a host or a server in the map ( see attached file - error 2 )

Best regards,
SOUHAIB

Re: backend_ID error message ( Nagivs )

Posted: Fri Dec 10, 2021 5:07 pm
by ssax
Run this to fix the permissions issue:

Code: Select all

chown -R apache.apache /usr/local/nagvis/etc/ma*

Re: backend_ID error message ( Nagivs )

Posted: Fri Dec 10, 2021 5:27 pm
by ssax
All I had to do was change the permissions on the maps via the previous post and it started working.

If it's still failing after that you'll need to check DB connectivity to all FOUR nagvis backends you have defined in your /usr/local/nagvis/etc/nagvis.inc.php via:
- You can find all four IP address in your nagvis.inc.php file, you can search for dbhost to find them

Code: Select all

mysql -h X.X.X.X -u'username' -p'password' nagios -e 'status;'

Re: backend_ID error message ( Nagivs )

Posted: Mon Dec 13, 2021 5:17 am
by ABBsupervision
Hello,

i was change the permissions on the maps via the previous post and it started working.

But i still have a problem with my backend [backend_nagiosxibkp], i can't import hosts/services from this server 172.19.2.110 ( see attachment.

Best regards,
SOUHAIB

Re: backend_ID error message ( Nagivs )

Posted: Mon Dec 13, 2021 6:07 pm
by ssax
Does communication work to it?

Code: Select all

mysql -h 172.19.2.110 -u'ndoutilsprod' -p'n@gweb' nagios -e 'status;'

Re: backend_ID error message ( Nagivs )

Posted: Tue Dec 14, 2021 3:21 am
by ABBsupervision
Hello teams,

the command line dosen't work for my backend 172.19.2.110, but for my backend id ( 172.19.2.55 ) the communication is working as you can see below :

Code: Select all

[root@DCPNAGIOSXIN1 ~]# mysql -h 172.19.2.55 -u'ndoutilsprod' -p'n@gweb' nagios -e 'status;'
mysql: [Warning] Using a password on the command line interface can be insecure.
--------------
mysql  Ver 8.0.21 for Linux on x86_64 (Source distribution)

Connection id:          33068
Current database:       nagios
Current user:           [email protected]
SSL:                    Cipher in use is TLS_AES_256_GCM_SHA384
Current pager:          stdout
Using outfile:          ''
Using delimiter:        ;
Server version:         8.0.21 Source distribution
Protocol version:       10
Connection:             172.19.2.55 via TCP/IP
Server characterset:    utf8mb4
Db     characterset:    utf8
Client characterset:    utf8mb4
Conn.  characterset:    utf8mb4
TCP port:               3306
Binary data as:         Hexadecimal
Uptime:                 8 hours 47 min 33 sec

Threads: 58  Questions: 2423792  Slow queries: 0  Opens: 571811  Flush tables: 3  Open tables: 32  Queries per second avg: 76.573
--------------

[root@DCPNAGIOSXIN1 ~]# mysql -h 172.19.2.110 -u'ndoutilsprod' -p'n@gweb' nagios -e 'status;'
mysql: [Warning] Using a password on the command line interface can be insecure.
^C
[root@DCPNAGIOSXIN1 ~]# mysql -h 172.19.2.110 -u'ndoutilsprod' -p'n@gweb'
mysql: [Warning] Using a password on the command line interface can be insecure.
^C
[root@DCPNAGIOSXIN1 ~]#
Any idea ?

Re: backend_ID error message ( Nagivs )

Posted: Tue Dec 14, 2021 7:33 pm
by ssax
You will need to grant permissions from your XI server to communicate with 172.19.2.110's nagios DB, once that's done the command and functionality should work:
- Change X.X.X.X to the IP address of your XI server
- The commands below will need to be run while connected to 172.19.2.110's DB

Code: Select all

use nagios;
GRANT ALL ON nagios.* TO ndoutilsprod@'X.X.X.X' IDENTIFIED BY 'n@gweb';
FLUSH PRIVILEGES;
EDIT: Run this on your XI server and send the output as well:

Code: Select all

nmap -Pn -p 3306 172.19.2.110

Re: backend_ID error message ( Nagivs )

Posted: Fri Dec 17, 2021 2:50 am
by ABBsupervision
Hello,

the issue was resolved after opening the stream through the port 3306 .

Best Regards,
SOUHAIB