Page 1 of 1

Question on backup script moditication

Posted: Thu Nov 10, 2016 12:08 pm
by corkyman
I am migrating Nagios from using localhost to external MySQL db and following this doc https://assets.nagios.com/downloads/nag ... Server.pdf

I have question about this step:

"e) Modify the backup script
Edit the file “/root/scripts/automysqlbackup” script on your Nagios XI server and change line #34 from this:
DBHOST=localhost
to this (where you type in the actual IP address of the offloaded mysql server):
DBHOST=<IP_OF_MYSQL_OR MARIADB_SERVER>"

Should I also add the port number at the end like this since I do not use a standard port: DBHOST=<IP>:3382

In the common section the only step where it should be done is not this one

"Issue – How do we use a port other than the default 3306?
In all of the steps you follow it should be clear when you need to change the port from the default. The only section where it is not clear
is in the config.inc.php file, you need to define it as:
“dbserver” => '<IP_OF_MYSQL_OR_MARIADB_SERVER>:<PORT>',
Example: “dbserver” => '192.168.5.88:55555',"

Re: Question on backup script moditication

Posted: Thu Nov 10, 2016 12:48 pm
by avandemore
For now you will have to edit the script and add the -P parameter to the script manually.

I have create FR 10085 for this. You can inquire here about its status.

If you modify the script make sure you keep a copy of the original and fully the backup process.

Re: Question on backup script moditication

Posted: Thu Nov 10, 2016 1:48 pm
by corkyman
Where would I add this parameter? On the DBHOST statement like this below?
DBHOST=<IP> -P 3382

Re: Question on backup script moditication

Posted: Thu Nov 10, 2016 2:10 pm
by avandemore
That should work if you wrap it in single or double quotes, or in the calls to the mysql client itself. On my system those are line 409 and 471.

Re: Question on backup script moditication

Posted: Thu Nov 10, 2016 6:01 pm
by corkyman
Thank you, please close this incident.