Backup Repository

This support forum board is for support questions relating to Nagios Log Server, our solution for managing and monitoring critical log data.
stecino
Posts: 248
Joined: Thu Mar 14, 2013 4:42 pm

Backup Repository

Post by stecino »

Hello,

I have created a common NFS mount for my NLS cluster nodes. In the Backup and Maintenance section I have configured the Repository to store the backups.
How do I kick off a backup process? I don't see anything on the UI, it must be from the command line then?
User avatar
lgroschen
Posts: 384
Joined: Wed Nov 27, 2013 1:17 pm

Re: Backup Repository

Post by lgroschen »

Hey stencino!

GIve this a try and check to see if there was a backup created:

Code: Select all

curl -XPOST localhost:9200/nagioslogserver/commands/backup_maintenance/_update -d '{ "doc": { "run_time": "10" } }' 
run_time is going to force it to execute if its less than current epoch time. Share your results :)

We also have talked about adding a feature to do this from the UI in the future.
/Luke
stecino
Posts: 248
Joined: Thu Mar 14, 2013 4:42 pm

Re: Backup Repository

Post by stecino »

lgroschen wrote:Hey stencino!

GIve this a try and check to see if there was a backup created:

Code: Select all

curl -XPOST localhost:9200/nagioslogserver/commands/backup_maintenance/_update -d '{ "doc": { "run_time": "10" } }' 
run_time is going to force it to execute if its less than current epoch time. Share your results :)

We also have talked about adding a feature to do this from the UI in the future.

By the way is there any documentation that I can refer to in terms, NLS known performance tweaks, back-end commands, etc?
What exactly is this going to back up(folders) and how much resources does it usually take?
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Backup Repository

Post by scottwilkerson »

stecino wrote:By the way is there any documentation that I can refer to in terms, NLS known performance tweaks, back-end commands, etc?
What exactly is this going to back up(folders) and how much resources does it usually take?
It is going to backup all the log data you have collected, one index per day that can be restored at a later time.

As for documentation, we have some here
http://library.nagios.com/library/produ ... umentation
and the admin guide here
http://assets.nagios.com/downloads/nagi ... nistrator/

Also, the 2 main components that use resources are logstash and elasticsearch and they both have documentation as well
http://logstash.net/docs/1.4.2/
http://www.elasticsearch.org/guide/en/e ... index.html
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
stecino
Posts: 248
Joined: Thu Mar 14, 2013 4:42 pm

Re: Backup Repository

Post by stecino »

Wouldn't these scripts in:

/usr/local/nagioslogserver/scripts

create_backup.sh
restore_backup.sh

handle the same thing? I just need to externalize the backup location as input parameter and will back things up. I can tie this crontab, instead of making a http call trigerring the backup.
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Backup Repository

Post by scottwilkerson »

stecino wrote:Wouldn't these scripts in:

/usr/local/nagioslogserver/scripts

create_backup.sh
restore_backup.sh

handle the same thing? I just need to externalize the backup location as input parameter and will back things up. I can tie this crontab, instead of making a http call trigerring the backup.
No, these create backups of all of the other indexes (not incoming log data)
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
stecino
Posts: 248
Joined: Thu Mar 14, 2013 4:42 pm

Re: Backup Repository

Post by stecino »

scottwilkerson wrote:
stecino wrote:Wouldn't these scripts in:

/usr/local/nagioslogserver/scripts

create_backup.sh
restore_backup.sh

handle the same thing? I just need to externalize the backup location as input parameter and will back things up. I can tie this crontab, instead of making a http call trigerring the backup.
No, these create backups of all of the other indexes (not incoming log data)
Got it thanks
stecino
Posts: 248
Joined: Thu Mar 14, 2013 4:42 pm

Re: Backup Repository

Post by stecino »

lgroschen wrote:Hey stencino!

GIve this a try and check to see if there was a backup created:

Code: Select all

curl -XPOST localhost:9200/nagioslogserver/commands/backup_maintenance/_update -d '{ "doc": { "run_time": "10" } }' 
run_time is going to force it to execute if its less than current epoch time. Share your results :)

We also have talked about adding a feature to do this from the UI in the future.
Here is what I am getting

[root@pden2nls1 nagioslogserver]# curl -XPOST localhost:9200/nagioslogserver/commands/backup_maintenance/_update -d '{ "doc": { "run_time": "10" } }'
{"error":"DocumentMissingException[[nagioslogserver][0] [commands][backup_maintenance]: document missing]","status":404}[root@pden2nls1 nagioslogserver]#
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Backup Repository

Post by scottwilkerson »

That is weird, can you run the following to see what else you may be missing

Code: Select all

curl -XGET localhost:9200/nagioslogserver/commands/_search?pretty
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
stecino
Posts: 248
Joined: Thu Mar 14, 2013 4:42 pm

Re: Backup Repository

Post by stecino »

scottwilkerson wrote:That is weird, can you run the following to see what else you may be missing

Code: Select all

curl -XGET localhost:9200/nagioslogserver/commands/_search?pretty
[root@pden2nls1 nagioslogserver]# curl -XGET localhost:9200/nagioslogserver/commands/_search?pretty
{
"took" : 34,
"timed_out" : false,
"_shards" : {
"total" : 1,
"successful" : 1,
"failed" : 0
},
"hits" : {
"total" : 5,
"max_score" : 1.0,
"hits" : [ {
"_index" : "nagioslogserver",
"_type" : "commands",
"_id" : "V92d-I5KQrmDoDgaC4PV6A",
"_score" : 1.0,
"_source":{"created":"2014-11-20 20:00:05","created_by":"1","active":1,"status":"waiting","type":"system","node":"global","command":"update_check","run_time":1422666192,"frequency":"86400","last_run_time":"2015-01-29 17:03:12","last_run_status":"SUCCESS"}
}, {
"_index" : "nagioslogserver",
"_type" : "commands",
"_id" : "URScqqg3Rl6rdxRuDOznZw",
"_score" : 1.0,
"_source":{"created":"2014-11-20 20:00:05","created_by":"1","active":1,"status":"waiting","type":"system","node":"global","command":"do_backups","run_time":1422666077,"frequency":"86400","last_run_time":"2015-01-29 17:01:17","last_run_status":"SUCCESS"}
}, {
"_index" : "nagioslogserver",
"_type" : "commands",
"_id" : "2VqRrvugSKe0xM1fzzKcJA",
"_score" : 1.0,
"_source":{"created":"2014-11-20 20:00:05","created_by":"1","active":1,"status":"waiting","type":"system","node":"global","command":"do_maintenance","run_time":1422666702,"frequency":"86400","last_run_output":"Maintenance and Backup jobs are being executed","last_run_time":"2015-01-29 17:11:42","last_run_status":"SUCCESS"}
}, {
"_index" : "nagioslogserver",
"_type" : "commands",
"_id" : "hQzM7yyKSJGPqd2UIRB4xA",
"_score" : 1.0,
"_source":{"created":"2014-11-20 20:00:05","created_by":"1","active":1,"status":"waiting","type":"system","node":"global","command":"cleanup","run_time":1422655817,"frequency":"3600","last_run_time":"2015-01-30 13:10:17","last_run_status":"SUCCESS"}
}, {
"_index" : "nagioslogserver",
"_type" : "commands",
"_id" : "TFP1dnsTSd6C-XrbJup5GA",
"_score" : 1.0,
"_source":{"created":"2014-11-20 20:00:05","created_by":"1","active":1,"status":"waiting","type":"system","node":"global","command":"run_alerts","run_time":1422654147,"frequency":"20","last_run_time":"2015-01-30 13:42:07","last_run_status":"SUCCESS"}
} ]
}
}
Locked