Page 1 of 1
Need help getting nagvis to connect to remote Mysqldb
Posted: Mon Jun 06, 2016 9:55 am
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?
Re: Need help getting nagvis to connect to remote Mysqldb
Posted: Mon Jun 06, 2016 4:42 pm
by lmiltchev
Are you seeing any errors in the GUI & logs when accessing NagVis?
Re: Need help getting nagvis to connect to remote Mysqldb
Posted: Wed Jun 08, 2016 9:35 am
by benhank
wow after all this time i still forgot to put that in....
Capture.PNG
Re: Need help getting nagvis to connect to remote Mysqldb
Posted: Wed Jun 08, 2016 10:32 am
by rkennedy
Were you able to get it working or did you need further assistance?
Re: Need help getting nagvis to connect to remote Mysqldb
Posted: Wed Jun 08, 2016 10:39 am
by benhank
Yeah, i still need help with it.
Re: Need help getting nagvis to connect to remote Mysqldb
Posted: Wed Jun 08, 2016 11:13 am
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.
Re: Need help getting nagvis to connect to remote Mysqldb
Posted: Wed Jun 08, 2016 12:29 pm
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...
Re: Need help getting nagvis to connect to remote Mysqldb
Posted: Wed Jun 08, 2016 1:11 pm
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"
Re: Need help getting nagvis to connect to remote Mysqldb
Posted: Mon Jun 13, 2016 10:23 am
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
; 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
Re: Need help getting nagvis to connect to remote Mysqldb
Posted: Mon Jun 13, 2016 10:24 am
by mcapra
Thanks for sharing your solution! Marking this as resolved.