Page 1 of 4

Backup before an upgrade

Posted: Wed Jan 05, 2022 12:41 pm
by jsalsbury
Howdy everyone,
I am getting ready to upgrade my Nagios from 5.8.3 to 5.8.7. However, when I do the backup command it is failing. See below message.

mysqldump: Got error: 144: "Table './nagios/nagios_logentries' is marked as crashed and last (automatic?) repair failed" when using LOCK TABLES

Error backing up MySQL database 'nagios' - check the password in this script!


I have been the Admin for a few years now and never had this issue nor have I changed my password recently. When I inherited it everything has worked except for this time. Anyone else ran into this issue?

Re: Backup before an upgrade

Posted: Wed Jan 05, 2022 1:02 pm
by pbroste
Hello @jsalsbury

Thanks for reaching out, appears that the nagios_logentries table has an issue, and recommend that we truncate that table then run through the database repair.

Code: Select all

echo 'truncate nagios_logentries;' |mysql -u root -pnagiosxi nagios
Then run through the database repair:

Code: Select all

/usr/local/nagiosxi/scripts/repair_databases.sh
Execute the backup and let us know how things are looking.

Thanks,
Perry

Re: Backup before an upgrade

Posted: Wed Jan 05, 2022 3:47 pm
by jsalsbury
Thank you I will try this

Re: Backup before an upgrade

Posted: Wed Jan 05, 2022 5:28 pm
by pbroste
Hello @jsalsbury

Please provide an update on the results, and let us know if you need further assistance.

Thanks,
Perry

Re: Backup before an upgrade

Posted: Wed Jan 05, 2022 9:14 pm
by jsalsbury
That assistance resolved my back up issue and I was able to back up.

Now I am running into this issue.

checking for pow in -lm... yes
checking for gdImageGif in -lgd... no
checking for gdImagePng in -lgd... no
checking for gdImagePng_jpg in -lgd... no
checking for gdImagePng_jpg_ft in -lgd... no
checking gd.h usability... no
checking gd.h presence... no
checking for gd.h... no

** Ooops, one of many bad things happened:

a) You don't have the GD library installed.
Get it from http://www.boutell.com, compile it and
use either --with-gd-lib=DIR and --with-gd-inc=DIR to specify
its location. You might also have to use --with-z-inc,
--with-z-lib and --with-png-inc, --with-png-lib for gd
versions 1.6 and higher. Check config.log for more
information on the problem.

b) You have the GD library installed, but not the gd.h
header file. Download the source (see above) and use
--with-gd-inc=DIR to specify where the file can be found.

c) You have the library and the header file installed, but
you also have a shared GD library in the same directory.
Remove the shared library files and/or links (e.g.
libgd.so.2.0.0, libgd.so and libgd.so.2). This is especially
likely if you're using a recent (post 1.8.4) version of GD
and didn't configure it with --disable-shared.

d) You have gd library installed and also it's headers, but you are
missing libpng (and headers) or freetype (and headers)
(mrtg does not use freetype, but if your copy of gd is precompiled
against it, you have to install it ...

Consider following the instructions in doc/mrtg-unix-guide.txt

I saw another forum post and tried some of those steps but still am unable to resolve them.

Re: Backup before an upgrade

Posted: Thu Jan 06, 2022 10:38 am
by pbroste
Hello @jsalsbury

Thanks for looking into this issue and providing the details.

Let's have you run through the following and then let us know how things look:

Code: Select all

yum install gd-devel
Thanks,
Perry

Re: Backup before an upgrade

Posted: Thu Jan 06, 2022 10:43 am
by jsalsbury
root@peplap02192:~# yum install gd-devel

Loaded plugins: langpacks, package_upload, product-id, search-disabled-repos, subscription-manager

No package gd-devel available.

Error: Nothing to do

Re: Backup before an upgrade

Posted: Thu Jan 06, 2022 3:15 pm
by pbroste
Hello @jsalsbury

Thanks for following up, depending on the distro you will need to add the repository that includes the gd-devel. Please follow with the following info so we can provide the correct repo to add.

Code: Select all

yum repolist
uname -a
cat /etc/*release
Thanks,
Perry

Re: Backup before an upgrade

Posted: Thu Jan 06, 2022 4:18 pm
by jsalsbury
root@peplap02192:~# yum repolist

Loaded plugins: langpacks, package_upload, product-id, search-disabled-repos, subscription-manager

repo id repo name status

rhel-7-server-rpms/7Server/x86_64 Red Hat Enterprise Linux 7 Server (RPMs) 32,204+367

repolist: 32,204

root@peplap02192:~# uname -a

Linux peplap02192 3.10.0-1160.45.1.el7.x86_64 #1 SMP Fri Sep 24 10:17:16 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux

root@peplap02192:~# cat /etc/*release

NAME="Red Hat Enterprise Linux Server"

VERSION="7.9 (Maipo)"

ID="rhel"

ID_LIKE="fedora"

VARIANT="Server"

VARIANT_ID="server"

VERSION_ID="7.9"

PRETTY_NAME="Red Hat Enterprise Linux"

ANSI_COLOR="0;31"

CPE_NAME="cpe:/o:redhat:enterprise_linux:7.9:GA:server"

HOME_URL=https://www.redhat.com/

BUG_REPORT_URL=https://bugzilla.redhat.com/



REDHAT_BUGZILLA_PRODUCT="Red Hat Enterprise Linux 7"

REDHAT_BUGZILLA_PRODUCT_VERSION=7.9

REDHAT_SUPPORT_PRODUCT="Red Hat Enterprise Linux"

REDHAT_SUPPORT_PRODUCT_VERSION="7.9"

Red Hat Enterprise Linux Server release 7.9 (Maipo)

Red Hat Enterprise Linux Server release 7.9 (Maipo)

Re: Backup before an upgrade

Posted: Thu Jan 06, 2022 6:17 pm
by pbroste
Hello @jsalsbury

Thanks for following up, after some checking on RHEL distros they have the option to enable/disable repositories.

Take a look at the following again with "all":

Code: Select all

yum repolist all
If you see one that is: rhel-x-server-optional-rpms ...... - Optional disabled; let's go ahead and enable that:

Code: Select all

yum install -y yum-utils
yum-config-manager --enable <repo-id>
or

Code: Select all

subscription-manager repos --list
subscription-manager repos --enable rhel-7-server-optional-rpms    #change the repo-name to match what you have
Verify that the optional repo is enabled and install the 'gd-devel'

Code: Select all

yum install gd-devel
Verify that all others are dependencies are installed too:

Code: Select all

yum install httpd php  gd gd-devel gcc glibc glibc-common openssl perl perl-devel make
Thanks,
Perry