Fresh 5.2.3 install, no autopostgresqlbackup script?

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
vAJ
Posts: 456
Joined: Thu Nov 08, 2012 5:09 pm
Location: Austin, TX

Fresh 5.2.3 install, no autopostgresqlbackup script?

Post by vAJ »

Noticed some cron errors for autopostgresqlbackup:

Code: Select all

/bin/sh: /root/scripts/autopostgresqlbackup: No such file or directory
Sure enough. No file present. MySQL script is there and runs fine. Checked the install log, no reference to it. cron references that are called by install script create the job, but the dbbackups script fails to copy the file (it's not even in /tmp/nagiosxi/nagiosxi)

Code: Select all

[root@brnxip01 nagiosxi]# cat nagiosxi.cron.d
# /etc/cron.d/nagiosxi: crontab fragment for nagiosxi

# Backup MySQL & PostgreSQL Databases
0   7 * * * root   /root/scripts/automysqlbackup
0   8 * * * root   /root/scripts/autopostgresqlbackup
9-dbbackups:

Code: Select all

[root@brnxip01 nagiosxi]# cat 9-dbbackups
#!/bin/bash -e

. ./xi-sys.cfg

# Was previous step completed?
if [ ! -f installed.selinux ]; then
        echo "SELinux was not configured - run previous script" >&2
        exit 1
fi

# Was this step already completed?
if [ -f installed.dbbackups ]; then
        echo "Database backups already configured - skipping."
        exit 0
fi

mkdir -p /store/backups/mysql /store/backups/nagiosxi /root/scripts
chown "$nagiosuser:$nagiosgroup" -R /store/backups/nagiosxi
cp nagiosxi/automysqlbackup /root/scripts

echo "Database backups configured OK"
touch installed.dbbackups
Do I need to grab this script or drop the cron job?
Andrew J. - Do you even grok?
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Fresh 5.2.3 install, no autopostgresqlbackup script?

Post by lmiltchev »

Do I need to grab this script or drop the cron job?
You can just drop the cron job. Postgres is no longer used in the new installs of XI. The data is stored in the "nagiosxi" database in mysql instead. You can double check if this is the case on your system by running:

Code: Select all

echo '\d' | psql nagiosxi nagiosxi
and

Code: Select all

echo 'show tables;' | mysql -t -u root -pnagiosxi nagiosxi
Be sure to check out our Knowledgebase for helpful articles and solutions!
vAJ
Posts: 456
Joined: Thu Nov 08, 2012 5:09 pm
Location: Austin, TX

Re: Fresh 5.2.3 install, no autopostgresqlbackup script?

Post by vAJ »

Sweet. When did I miss that change? I'll have to review changelog.

On a side note, the install scripts need to be sanitized to remove the addition of that cron job.
Andrew J. - Do you even grok?
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Fresh 5.2.3 install, no autopostgresqlbackup script?

Post by lmiltchev »

On a side note, the install scripts need to be sanitized to remove the addition of that cron job.
You are absolutely right. I will discuss this with our developers. In my opinion these two cron jobs:

Code: Select all

0   7 * * * root   /root/scripts/automysqlbackup
0   8 * * * root   /root/scripts/autopostgresqlbackup
don't need to be set up by default. These backups "saved the day" in a few cases, where we needed to restore the databases for customers, but in the majority of the cases they just take lots of disk space. :)
BTW, both - mysqld & postgres db (on older systems) are backed up anyway when you run the "/usr/local/nagiosxi/scripts/backup_xi.sh" script.
Be sure to check out our Knowledgebase for helpful articles and solutions!
vAJ
Posts: 456
Joined: Thu Nov 08, 2012 5:09 pm
Location: Austin, TX

Re: Fresh 5.2.3 install, no autopostgresqlbackup script?

Post by vAJ »

Exactly. I think we can lock this one up.
Andrew J. - Do you even grok?
Locked