Need help getting nagvis to connect to remote Mysqldb

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
User avatar
benhank
Posts: 1264
Joined: Tue Apr 12, 2011 12:29 pm

Need help getting nagvis to connect to remote Mysqldb

Post by benhank »

Hey guys!

My Nagios install has an offloaded mysqldb. Can you show me what I need to change in the nagvis ini that will point it to the remote db?
Proudly running:
NagiosXI 5.4.12 2 node Prod Env 2500 hosts, 13,000 services
Nagiosxi 5.5.7(test env) 2500 hosts, 13,000 services
Nagios Logserver 2 node Prod Env 500 objects sending
Nagios Network Analyser
Nagios Fusion
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Need help getting nagvis to connect to remote Mysqldb

Post by lmiltchev »

Are you seeing any errors in the GUI & logs when accessing NagVis?
Be sure to check out our Knowledgebase for helpful articles and solutions!
User avatar
benhank
Posts: 1264
Joined: Tue Apr 12, 2011 12:29 pm

Re: Need help getting nagvis to connect to remote Mysqldb

Post by benhank »

wow after all this time i still forgot to put that in....
Capture.PNG
You do not have the required permissions to view the files attached to this post.
Proudly running:
NagiosXI 5.4.12 2 node Prod Env 2500 hosts, 13,000 services
Nagiosxi 5.5.7(test env) 2500 hosts, 13,000 services
Nagios Logserver 2 node Prod Env 500 objects sending
Nagios Network Analyser
Nagios Fusion
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: Need help getting nagvis to connect to remote Mysqldb

Post by rkennedy »

Were you able to get it working or did you need further assistance?
Former Nagios Employee
User avatar
benhank
Posts: 1264
Joined: Tue Apr 12, 2011 12:29 pm

Re: Need help getting nagvis to connect to remote Mysqldb

Post by benhank »

Yeah, i still need help with it.
Proudly running:
NagiosXI 5.4.12 2 node Prod Env 2500 hosts, 13,000 services
Nagiosxi 5.5.7(test env) 2500 hosts, 13,000 services
Nagios Logserver 2 node Prod Env 500 objects sending
Nagios Network Analyser
Nagios Fusion
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Need help getting nagvis to connect to remote Mysqldb

Post by lmiltchev »

Here's what I have in the "/usr/local/nagvis/etc/nagvis.ini.php" on a XI server with offloaded DB (which works for me):

Code: Select all

[backend_ndomy_1]

;dbhost="localhost"
dbhost="<remote mysql server ip address>"
dbport=3306
dbname="nagios"
dbuser="ndoutils"
dbpass="n@gweb"
Hope this helps.
Be sure to check out our Knowledgebase for helpful articles and solutions!
User avatar
benhank
Posts: 1264
Joined: Tue Apr 12, 2011 12:29 pm

Re: Need help getting nagvis to connect to remote Mysqldb

Post by benhank »

mine is the same, but maybe its that dbinstancename="localhost" option.

Code: Select all

; Example definition for a MySQL backend
; in this example the ID of the Backend is "ndomy_1" you can define another ID.
[backend_ndomy_1]
; 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="172.22.3.125"
; portname for NDO-db
dbport=3306
; database name for NDO-db
dbname="nagios"
; username for NDO-db
dbuser="ndoutils"
; password for NDO-db
dbpass="n@gweb"
; 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"
on a side note, nagvis really makes me appreciate how you guys develop the stuff you do. and i really wish *hint hint* that you guys came out with your own version of nagvis...
Proudly running:
NagiosXI 5.4.12 2 node Prod Env 2500 hosts, 13,000 services
Nagiosxi 5.5.7(test env) 2500 hosts, 13,000 services
Nagios Logserver 2 node Prod Env 500 objects sending
Nagios Network Analyser
Nagios Fusion
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Need help getting nagvis to connect to remote Mysqldb

Post by lmiltchev »

mine is the same, but maybe its that dbinstancename="localhost" option.
I don't think so - I also have this line... Did you follow our official documentation for offloading mysql db?

https://assets.nagios.com/downloads/nag ... Server.pdf

Double check what was the user/password that you set up for accessing nagios db. I used ndoutils/n@gweb, but you could have nagios/nagios. I don't know what you used... :)

Try:

Code: Select all

[backend_ndomy_1]

dbhost="<remote mysql server ip address>"
dbport=3306
dbname="nagios"
dbuser="nagios"
dbpass="nagios"
Be sure to check out our Knowledgebase for helpful articles and solutions!
User avatar
benhank
Posts: 1264
Joined: Tue Apr 12, 2011 12:29 pm

Re: Need help getting nagvis to connect to remote Mysqldb

Post by benhank »

That did the trick bro! YOu do have to put the remote host in there however.
Thanks to all!

just in canse anyone else has this problem here is my working settings:
line 306ish of

Code: Select all

/usr/local/nagvis/nagvis.ini.php

Code: Select all

; The statushost needs to be given in the following format:
;   "<backend_id>:<hostname>" -> e.g. "live_2:nagios"
;statushost=""
; hostname for NDO-db
dbhost="IPaddress of remotedb"
; portname for NDO-db
dbport=3306
; database name for NDO-db
dbname="nagios"
; username for NDO-db
dbuser="nagios"
; password for NDO-db
dbpass="nagios"
; 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"
Hope it helps someone out there!
Lock it up boys its a wrap
Proudly running:
NagiosXI 5.4.12 2 node Prod Env 2500 hosts, 13,000 services
Nagiosxi 5.5.7(test env) 2500 hosts, 13,000 services
Nagios Logserver 2 node Prod Env 500 objects sending
Nagios Network Analyser
Nagios Fusion
User avatar
mcapra
Posts: 3739
Joined: Thu May 05, 2016 3:54 pm

Re: Need help getting nagvis to connect to remote Mysqldb

Post by mcapra »

Thanks for sharing your solution! Marking this as resolved.
Former Nagios employee
https://www.mcapra.com/
Locked