Restore postgresql!!!!!

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
User avatar
BanditBBS
Posts: 2474
Joined: Tue May 31, 2011 12:57 pm
Location: Scio, OH
Contact:

Restore postgresql!!!!!

Post by BanditBBS »

Hey, one of my team is an idiot and changed everyone's notificaiton settings. That is stored in the backup of the postgresql db, right? Whats the procedure to restore just that?

Also, that wont screw up any dashboards will it?
2 of XI5.6.14 Prod/DR/DEV - Nagios LogServer 2 Nodes
See my projects on the Exchange at BanditBBS - Also check out my Nagios stuff on my personal page at Bandit's Home and at github
jolson
Attack Rabbit
Posts: 2560
Joined: Thu Feb 12, 2015 12:40 pm

Re: Restore postgresql!!!!!

Post by jolson »

Hey, one of my team is an idiot and changed everyone's notificaiton settings. That is stored in the backup of the postgresql db, right? Whats the procedure to restore just that?
Which notification settings are talking about exactly? It's possible that they're stored in the MySQL database, in which case we could simply restore a table or two.

Were the settings described in the below screenshot affected?
2015-04-29 09_52_18-Nagios XI - Nagios Core Config Manager.png
You do not have the required permissions to view the files attached to this post.
Twits Blog
Show me a man who lives alone and has a perpetually clean kitchen, and 8 times out of 9 I'll show you a man with detestable spiritual qualities.
User avatar
BanditBBS
Posts: 2474
Joined: Tue May 31, 2011 12:57 pm
Location: Scio, OH
Contact:

Re: Restore postgresql!!!!!

Post by BanditBBS »

The XI users settings: The notification methods(email, mobile txt, sms) and preferences tab.
2 of XI5.6.14 Prod/DR/DEV - Nagios LogServer 2 Nodes
See my projects on the Exchange at BanditBBS - Also check out my Nagios stuff on my personal page at Bandit's Home and at github
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Restore postgresql!!!!!

Post by abrist »

it is easiest to restore the db from the newest nagiosxi backup (as the daily cron backups do not have all the necessary drop sequences that the full XI backup does).
Expand a nagios XI backup tarball, descend into the pgsql directory of the the expanded archive, and then run:

Code: Select all

psql -U nagiosxi nagiosxi < nagiosxi.sql
You may want to run a nagiosxi backup first just in case.
BanditBBS wrote: Also, that wont screw up any dashboards will it?
It *should* not effect them - they should be restored to the state in the backup.
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
User avatar
BanditBBS
Posts: 2474
Joined: Tue May 31, 2011 12:57 pm
Location: Scio, OH
Contact:

Re: Restore postgresql!!!!!

Post by BanditBBS »

abrist wrote:it is easiest to restore the db from the newest nagiosxi backup (as the daily cron backups do not have all the necessary drop sequences that the full XI backup does).
Expand a nagios XI backup tarball, descend into the pgsql directory of the the expanded archive, and then run:

Code: Select all

psql -U nagiosxi nagiosxi < nagiosxi.sql
You may want to run a nagiosxi backup first just in case.
BanditBBS wrote: Also, that wont screw up any dashboards will it?
It *should* not effect them - they should be restored to the state in the backup.
I love you.....wait...I mean thank you very much! Done and worked...now to yell at someone!
2 of XI5.6.14 Prod/DR/DEV - Nagios LogServer 2 Nodes
See my projects on the Exchange at BanditBBS - Also check out my Nagios stuff on my personal page at Bandit's Home and at github
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Restore postgresql!!!!!

Post by abrist »

Awesome, just remember to use compliment sandwiches when yelling at your staff:
[compliment]
[yelling]
[compliment]
...
[beer?]
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
vAJ
Posts: 456
Joined: Thu Nov 08, 2012 5:09 pm
Location: Austin, TX

Re: Restore postgresql!!!!!

Post by vAJ »

Where's the like or LMAO button in phpBB?
Andrew J. - Do you even grok?
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: Restore postgresql!!!!!

Post by tmcdonald »

BanditBBS wrote:
abrist wrote:it is easiest to restore the db from the newest nagiosxi backup (as the daily cron backups do not have all the necessary drop sequences that the full XI backup does).
Expand a nagios XI backup tarball, descend into the pgsql directory of the the expanded archive, and then run:

Code: Select all

psql -U nagiosxi nagiosxi < nagiosxi.sql
You may want to run a nagiosxi backup first just in case.
BanditBBS wrote: Also, that wont screw up any dashboards will it?
It *should* not effect them - they should be restored to the state in the backup.
I love you.....wait...I mean thank you very much! Done and worked...now to yell at someone!
New shirt for this year's conference.
Former Nagios employee
Locked