Restore NagVis maps from the backups...

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
SteveBeauchemin
Posts: 524
Joined: Mon Oct 14, 2013 7:19 pm

Restore NagVis maps from the backups...

Post by SteveBeauchemin »

So, It finally happened that someone broke a NagVis map while trying to update it. It got really messed up.
In the file /usr/local/nagiosxi/scripts/backup_xi.sh the NagVis tool was missing for a while, but is now included.
It is even included in /usr/local/nagiosxi/scripts/restore_xi.sh too. It was missing from those in earlier versions.
Since it is now there for us to run manually, I thought... well...

So I decided to look in the file created by "Admin" -> "Scheduled Backups" and pull out a copy of the file from before it degraded. It turns out that of all the files in that tar.gz file there was no NagVis. So, I tried to look at the php code and add it. Nope. Not gonna happen... That code is part of the special stuff the end users are not able to change. (SourceGuardian)

So, can someone please look in /usr/local/nagiosxi/html/includes/components/scheduledbackups and make sure that NagVis gets included when scheduled backups run?

NagVis is part of the Nagios XI install... It should be included in the Nagios XI backups.
If it is already there, then tell me I'm crazy... If not, Please add it.
I did get the file restored from an OS backup but I should not have had to take that route.

Thanks

Steve B
XI 5.7.3 / Core 4.4.6 / NagVis 1.9.8 / LiveStatus 1.5.0p11 / RRDCached 1.7.0 / Redis 3.2.8 /
SNMPTT / Gearman 0.33-7 / Mod_Gearman 3.0.7 / NLS 2.0.8 / NNA 2.3.1 /
NSClient 0.5.0 / NRPE Solaris 3.2.1 Linux 3.2.1 HPUX 3.2.1
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Restore NagVis maps from the backups...

Post by lmiltchev »

H-m-m, I grepped for "nagvis" the "backup_xi.sh" & "restore_xi.sh" script, and it seems NagVis is being backup up...

Code: Select all

[root@localhost scripts]# pwd
/usr/local/nagiosxi/scripts
[root@localhost scripts]# grep -i nagvis backup_xi.sh
echo "Backing up Nagvis..."
tar czfp $mydir/nagvis.tar.gz /usr/local/nagvis

[root@localhost scripts]# grep -i nagvis restore_xi.sh
# Nagvis
if [ -f $backupdir/nagvis.tar.gz ]; then
        echo "Restoring Nagvis backups..."
        rm -rf /usr/local/nagvis
        cd $rootdir && tar xzfps $backupdir/nagvis.tar.gz
        chown -R apache.apache /usr/local/nagvis
Be sure to check out our Knowledgebase for helpful articles and solutions!
SteveBeauchemin
Posts: 524
Joined: Mon Oct 14, 2013 7:19 pm

Re: Restore NagVis maps from the backups...

Post by SteveBeauchemin »

When you run those files manually, sure, it is being backed up. I said that in my post.

But, what about the items I asked about? The scheduled backups. On the Admin tab, Scheduled backups, FTP, SSH, or Local.

I was very specific I thought.

Steve B
XI 5.7.3 / Core 4.4.6 / NagVis 1.9.8 / LiveStatus 1.5.0p11 / RRDCached 1.7.0 / Redis 3.2.8 /
SNMPTT / Gearman 0.33-7 / Mod_Gearman 3.0.7 / NLS 2.0.8 / NNA 2.3.1 /
NSClient 0.5.0 / NRPE Solaris 3.2.1 Linux 3.2.1 HPUX 3.2.1
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Restore NagVis maps from the backups...

Post by lmiltchev »

The Scheduled Backups component is using the same script to do the backups (backup_xi.sh). We don't have a "separate" script for scheduled backups...
Be sure to check out our Knowledgebase for helpful articles and solutions!
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Restore NagVis maps from the backups...

Post by lmiltchev »

BTW, one way to verify what I said, is to run a tail on the "cmdsubsys.log" while scheduled backup is running.
tail: /usr/local/nagiosxi/var/cmdsubsys.log: file truncated

PROCESSED 0 COMMANDS
MMANDS
tail: /usr/local/nagiosxi/var/cmdsubsys.log: file truncated
........................................PROCESSING COMMAND ID 18...
PROCESS COMMAND: CMD=1117, DATA=a:2:{i:0;s:19:"nagiosxi.1473961544";i:1;s:24:"/store/backups/nagiosxi/";}
CMDLINE=/usr/local/nagiosxi/scripts/backup_xi.sh -n nagiosxi.1473961544 -d /store/backups/nagiosxi
Failed to restart nagios.service: Interactive authentication required.
Backing up Core Config Manager (NagiosQL)...
tar: Removing leading `/' from member names
tar: Removing leading `/' from member names
Backing up Nagios Core...
tar: Removing leading `/' from member names
tail: /usr/local/nagiosxi/var/cmdsubsys.log: file truncated
.......tar: /usr/local/nagios/var/rw/nagios.qh: socket ignored
tar: /usr/local/nagios/var/ndo.sock: socket ignored
Backing up Nagios XI...
tar: Removing leading `/' from member names
tar: /usr/local/nagiosxi/var/components/nagiosim.log: file changed as we read it
Backing up MRTG...
tar: Removing leading `/' from member names
Backing up NRDP...
tar: Removing leading `/' from member names
Backing up Nagvis...
tar: Removing leading `/' from member names
Backing up MySQL databases...
Backing up logrotate config files...
Backing up Apache config files...
Compressing backup...

===============
BACKUP COMPLETE
===============
Backup stored in /store/backups/nagiosxi/nagiosxi.1473961544.tar.gz
OUTPUT=Backup stored in /store/backups/nagiosxi/nagiosxi.1473961544.tar.gz
RETURNCODE=0

PROCESSED 1 COMMANDS

Code: Select all

# tar -tvf /store/backups/nagiosxi/nagiosxi.1473961544.tar.gz | grep -i nagvis
-rw-r--r-- nagios/nagios  2381621 2016-09-15 12:46 nagiosxi.1473961544/nagvis.tar.gz
Be sure to check out our Knowledgebase for helpful articles and solutions!
SteveBeauchemin
Posts: 524
Joined: Mon Oct 14, 2013 7:19 pm

Re: Restore NagVis maps from the backups...

Post by SteveBeauchemin »

When I was unable to read the php I thought there was something special happening in the component that was a secret. So I did not chase it any further. I Appreciate the response. I'll go thru the tar file again and make sure not to miss the information this time. In case it happens again.

Thank you for clearing that up for me. My apologies...

Steve B
XI 5.7.3 / Core 4.4.6 / NagVis 1.9.8 / LiveStatus 1.5.0p11 / RRDCached 1.7.0 / Redis 3.2.8 /
SNMPTT / Gearman 0.33-7 / Mod_Gearman 3.0.7 / NLS 2.0.8 / NNA 2.3.1 /
NSClient 0.5.0 / NRPE Solaris 3.2.1 Linux 3.2.1 HPUX 3.2.1
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Restore NagVis maps from the backups...

Post by lmiltchev »

No problem, Steve. I am glad I was able to help! Is it ok if we lock this topic or you want us to keep it open for the time being?
Be sure to check out our Knowledgebase for helpful articles and solutions!
SteveBeauchemin
Posts: 524
Joined: Mon Oct 14, 2013 7:19 pm

Re: Restore NagVis maps from the backups...

Post by SteveBeauchemin »

Sure. Close it.
XI 5.7.3 / Core 4.4.6 / NagVis 1.9.8 / LiveStatus 1.5.0p11 / RRDCached 1.7.0 / Redis 3.2.8 /
SNMPTT / Gearman 0.33-7 / Mod_Gearman 3.0.7 / NLS 2.0.8 / NNA 2.3.1 /
NSClient 0.5.0 / NRPE Solaris 3.2.1 Linux 3.2.1 HPUX 3.2.1
Locked