db repair failed

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
rtsupport
Posts: 188
Joined: Mon Jan 08, 2018 4:30 am

Re: db repair failed

Post by rtsupport »

we are using below sequence while restarting full nagios.
OS version we are using -- RHEL 7
sudo service nagios stop
sudo service httpd stop
sudo service npcd stop
sudo service ndo2db stop
sudo service mysqld stop
sudo service mariadb stop
sudo service postgresql stop
sudo service gearmand stop

sudo service gearmand start
sudo service postgresql start
sudo service mariadb start
sudo service mysqld start
sudo service ndo2db start
sudo service npcd start
sudo service httpd start
sudo service nagios start
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: db repair failed

Post by scottwilkerson »

In RHEL 7 this would be the preferred calls

Code: Select all

sudo systemctl stop nagios
sudo systemctl stop httpd
sudo systemctl stop npcd
sudo systemctl stop ndo2db
sudo systemctl stop mysqld
sudo systemctl stop mariadb
sudo systemctl stop postgresql
sudo systemctl stop gearmand

sudo systemctl start gearmand
sudo systemctl start postgresql
sudo systemctl start mariadb
sudo systemctl start mysqld
sudo systemctl start ndo2db
sudo systemctl start npcd
sudo systemctl start httpd
sudo systemctl start nagios
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
rtsupport
Posts: 188
Joined: Mon Jan 08, 2018 4:30 am

Re: db repair failed

Post by rtsupport »

yehh i know that and if we do service start nagios then it will be also redirecting to systemctl start nagios and i don't think so this will be in issue. however next weekend we have scheduled to restart this server and at this time we will stop and start the service using systemctl and will let you know the status accordingly.
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: db repair failed

Post by scottwilkerson »

rtsupport wrote:however next weekend we have scheduled to restart this server and at this time we will stop and start the service using systemctl and will let you know the status accordingly.
Sounds good.
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
rtsupport
Posts: 188
Joined: Mon Jan 08, 2018 4:30 am

Re: db repair failed

Post by rtsupport »

today we restarted the server, We stopped all service before restart the server but we observed that all service in start status when server reboot.

is this fine or do we need to change something so that whenever server reboot we will start the service manually with correct sequence?

Also found below error while restarting gearmand service where "gearmand" folder was deleted automatically during reboot process. after creating the gearmand folder under /var/run service restarted.

Code: Select all

bash-4.2$ sudo systemctl status gearmand
● gearmand.service - LSB: start and stop the Gearman server
   Loaded: loaded (/etc/rc.d/init.d/gearmand; bad; vendor preset: disabled)
   Active: failed (Result: timeout) since Wed 2019-01-23 07:32:37 EST; 2min 37s ago
     Docs: man:systemd-sysv-generator(8)
  Process: 9673 ExecStart=/etc/rc.d/init.d/gearmand start (code=exited, status=0/SUCCESS)
   CGroup: /system.slice/gearmand.service
           └─9745 /usr/sbin/gearmand -d --worker-wakeup=10 --retention-file=/tmp/gearmand.retention -q retention --log-file=/var/log/gea...

Jan 23 07:27:37 usa0300lv1126 systemd[1]: Starting LSB: start and stop the Gearman server...
Jan 23 07:27:38 usa0300lv1126 runuser[9709]: pam_unix(runuser:session): session opened for user gearmand by (uid=0)
Jan 23 07:27:38 usa0300lv1126 gearmand[9673]: Starting gearmand: [  OK  ]
Jan 23 07:27:38 usa0300lv1126 gearmand[9673]: /etc/rc.d/init.d/gearmand: line 43: /var/run/gearmand/gearmand.pid: No such file or directory
Jan 23 07:27:38 usa0300lv1126 systemd[1]: PID file /var/run/gearmand/gearmand.pid not readable (yet?) after start.
Jan 23 07:32:37 usa0300lv1126 systemd[1]: gearmand.service start operation timed out. Terminating.
Jan 23 07:32:37 usa0300lv1126 systemd[1]: Failed to start LSB: start and stop the Gearman server.
Jan 23 07:32:37 usa0300lv1126 systemd[1]: Unit gearmand.service entered failed state.
Jan 23 07:32:37 usa0300lv1126 systemd[1]: gearmand.service failed.
Hint: Some lines were ellipsized, use -l to show in full.
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: db repair failed

Post by scottwilkerson »

This all sounds fine except the gearman problem

You may want to edit /etc/rc.d/init.d/gearmand to add the following above line 43

Code: Select all

mkdir -p /var/run/gearmand
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
rtsupport
Posts: 188
Joined: Mon Jan 08, 2018 4:30 am

Re: db repair failed

Post by rtsupport »

is that fine?

FROM

Code: Select all

gearmand=/usr/sbin/gearmand
prog=gearmand

RETVAL=0

start() {
        echo -n $"Starting $prog: "
        daemon --pidfile=$pidfile --user=gearmand $gearmand -d $OPTIONS
        RETVAL=$?
        echo
        [ $RETVAL = 0 ] && (touch $lockfile; pgrep -f $gearmand > $pidfile)
        return $RETVAL
TO

Code: Select all

gearmand=/usr/sbin/gearmand
prog=gearmand

RETVAL=0

start() {
        echo -n $"Starting $prog: "
        daemon --pidfile=$pidfile --user=gearmand $gearmand -d $OPTIONS
        RETVAL=$?
        echo
	mkdir -p /var/run/gearmand
        [ $RETVAL = 0 ] && (touch $lockfile; pgrep -f $gearmand > $pidfile)
        return $RETVAL
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: db repair failed

Post by scottwilkerson »

that should do it
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
rtsupport
Posts: 188
Joined: Mon Jan 08, 2018 4:30 am

Re: db repair failed

Post by rtsupport »

ok, thank you! i will make the changes, and as we are good as of now you may close the thread now/

Thank you! again Scott, for your advise.
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: db repair failed

Post by scottwilkerson »

rtsupport wrote:ok, thank you! i will make the changes, and as we are good as of now you may close the thread now/

Thank you! again Scott, for your advise.
Great!

Locking thread
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
Locked