Backup Repository

This support forum board is for support questions relating to Nagios Log Server, our solution for managing and monitoring critical log data.
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Backup Repository

Post by scottwilkerson »

Sorry, the command we meant to have you run was

Code: Select all

curl -XPOST localhost:9200/nagioslogserver/commands/do_maintenance/_update -d '{ "doc": { "run_time": "10" } }' 
However, it appears to be executing already, are any backups now showing up?
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:Sorry, the command we meant to have you run was

Code: Select all

curl -XPOST localhost:9200/nagioslogserver/commands/do_maintenance/_update -d '{ "doc": { "run_time": "10" } }' 
However, it appears to be executing already, are any backups now showing up?
No backups are being created. Based on the apache conf for nagioslogserver

this is the root directory

/var/www/html/nagioslogserver/www/

I would expect to see commands/do_maintenance/_update under the root directory which I don't. Isn't this part of install?
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Backup Repository

Post by scottwilkerson »

This is not as you would expect, when you connect from the CLI to localhost:9200 iit is connecting directly to elasticsearch, NOT the web root.

Can you run the following in one terminal

Code: Select all

tail -f /usr/local/nagioslogserver/var/jobs.log
And then perform the following command in another terminal

Code: Select all

curl -XPOST localhost:9200/nagioslogserver/commands/do_maintenance/_update -d '{ "doc": { "run_time": "10" } }' 
By doing this we should see the maintenance jobs go by in the console looking for errors.
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:This is not as you would expect, when you connect from the CLI to localhost:9200 iit is connecting directly to elasticsearch, NOT the web root.

Can you run the following in one terminal

Code: Select all

tail -f /usr/local/nagioslogserver/var/jobs.log
And then perform the following command in another terminal

Code: Select all

curl -XPOST localhost:9200/nagioslogserver/commands/do_maintenance/_update -d '{ "doc": { "run_time": "10" } }' 
By doing this we should see the maintenance jobs go by in the console looking for errors.

[root@nlsserver ~]# curl -XPOST localhost:9200/nagioslogserver/commands/do_maintenance/_update -d '{ "doc": { "run_time": "10" } }'
{"error":"RemoteTransportException[[78a3bc74-18f9-46c6-a763-267d4860c047][inet[/10.68.1.246:9300]][update]]; nested: DocumentMissingException[[nagioslogserver][0] [commands][do_maintenance]: document missing]; ","status":404}[root@nlsserver ~]#


[root@nlsserver nagioslogserver]# tail -f /usr/local/nagioslogserver/var/jobs.log
Running command run_alerts with args ' ' for job id: TFP1dnsTSd6C-XrbJup5GA
SUCCESS
Running command run_alerts with args ' ' for job id: TFP1dnsTSd6C-XrbJup5GA
SUCCESS
Running command run_alerts with args ' ' for job id: TFP1dnsTSd6C-XrbJup5GA
SUCCESS
Processed 0 node jobs.
Processed 3 global jobs.
tail: /usr/local/nagioslogserver/var/jobs.log: file truncated
Running command run_alerts with args ' ' for job id: TFP1dnsTSd6C-XrbJup5GA
SUCCESS
Running command run_alerts with args ' ' for job id: TFP1dnsTSd6C-XrbJup5GA
SUCCESS
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Backup Repository

Post by scottwilkerson »

Lets do this one more time, I just looked over your previous post and it appears your ID's aren't what would be standard, lets run:

Code: Select all

tail -f /usr/local/nagioslogserver/var/jobs.log
And then perform the following command in another terminal

Code: Select all

curl -XPOST localhost:9200/nagioslogserver/commands/2VqRrvugSKe0xM1fzzKcJA/_update -d '{ "doc": { "run_time": "10" } }' 
We had to change the ID in the 2nd command
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:Lets do this one more time, I just looked over your previous post and it appears your ID's aren't what would be standard, lets run:

Code: Select all

tail -f /usr/local/nagioslogserver/var/jobs.log
And then perform the following command in another terminal

Code: Select all

curl -XPOST localhost:9200/nagioslogserver/commands/2VqRrvugSKe0xM1fzzKcJA/_update -d '{ "doc": { "run_time": "10" } }' 
We had to change the ID in the 2nd command
Seems to be working!!

drwxr-xr-x 3 nobody users 4096 Feb 3 11:39 indices
-rw-r--r-- 1 nobody users 61 Feb 3 11:39 metadata-logstash-2015.01.06
-rw-r--r-- 1 nobody users 187 Feb 3 11:39 snapshot-logstash-2015.01.06
[root@nlsserver nls_backup]#

So do I always run this command? What is that ID, does it always stay the same?
stecino
Posts: 248
Joined: Thu Mar 14, 2013 4:42 pm

Re: Backup Repository

Post by stecino »

stecino wrote:
scottwilkerson wrote:Lets do this one more time, I just looked over your previous post and it appears your ID's aren't what would be standard, lets run:

Code: Select all

tail -f /usr/local/nagioslogserver/var/jobs.log
And then perform the following command in another terminal

Code: Select all

curl -XPOST localhost:9200/nagioslogserver/commands/2VqRrvugSKe0xM1fzzKcJA/_update -d '{ "doc": { "run_time": "10" } }' 
We had to change the ID in the 2nd command
Seems to be working!!

drwxr-xr-x 3 nobody users 4096 Feb 3 11:39 indices
-rw-r--r-- 1 nobody users 61 Feb 3 11:39 metadata-logstash-2015.01.06
-rw-r--r-- 1 nobody users 187 Feb 3 11:39 snapshot-logstash-2015.01.06
[root@nlsserver nls_backup]#

So this backup generated metadata, snapshot info, and indices. So if I run backup again tomorrow, will it only backup the delta, or will it backup last 30 day retention data again?
So do I always run this command? What is that ID, does it always stay the same?
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Backup Repository

Post by scottwilkerson »

It will only backup indexes that have not been previously backed-up

Additionally, you should not need to run the script every day, it will automatically run 24 hours from the last successful run.
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:It will only backup indexes that have not been previously backed-up

Additionally, you should not need to run the script every day, it will automatically run 24 hours from the last successful run.
Thanks alot for the help, this can be closed.
stecino
Posts: 248
Joined: Thu Mar 14, 2013 4:42 pm

Re: Backup Repository

Post by stecino »

stecino wrote:
scottwilkerson wrote:It will only backup indexes that have not been previously backed-up

Additionally, you should not need to run the script every day, it will automatically run 24 hours from the last successful run.
Thanks alot for the help, this can be closed.
Actually before you close it :)

It seems that the backup kicked off at exact time to the backup i did yesterday. Is there a way to adjust the time so it runs at night?
Locked