Disable scheduled backups via command line for test server

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
fullsail
Posts: 11
Joined: Tue Feb 25, 2020 10:18 am

Disable scheduled backups via command line for test server

Post by fullsail »

Not sure if anyone posted about this before, but I am trying to automate a test server build and do that via a scheduled backups / restore. I would like to disable via script the scheduled backups on the test server after the restore and trying to see if there is a way to do it besides trying to manipulate the db table xi_options containing this:

| 106 | scheduled_ftp_backups | a:15:{s:6:"active";i:1;s:4:"freq";s:5:"daily";s:3:"day";s:1:"0";s:5:"hours";s:1:"00";s:4:"mins";s:1:"1";s:6:"server";s:11:"1.1.1.1";s:4:"port";s:2:"21";s:8:"username";s:6:"xxxxxx";s:8:"password";s:80:"xxxxxx";s:3:"dir";s:24:"/xxx/xxx/";s:7:"passive";i:0;s:6:"secure";i:0;s:5:"limit";s:1:"1";s:7:"lastrun";s:10:"111111111111";s:7:"nextrun";i:11111111111;}

I know I could grab the value and change the 1 to 0 after the active variable, keeping the rest of the options but is there any other way via a Nagios command or script I have missed that already exists?
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Disable scheduled backups via command line for test serv

Post by scottwilkerson »

fullsail wrote:Not sure if anyone posted about this before, but I am trying to automate a test server build and do that via a scheduled backups / restore. I would like to disable via script the scheduled backups on the test server after the restore and trying to see if there is a way to do it besides trying to manipulate the db table xi_options containing this:

| 106 | scheduled_ftp_backups | a:15:{s:6:"active";i:1;s:4:"freq";s:5:"daily";s:3:"day";s:1:"0";s:5:"hours";s:1:"00";s:4:"mins";s:1:"1";s:6:"server";s:11:"1.1.1.1";s:4:"port";s:2:"21";s:8:"username";s:6:"xxxxxx";s:8:"password";s:80:"xxxxxx";s:3:"dir";s:24:"/xxx/xxx/";s:7:"passive";i:0;s:6:"secure";i:0;s:5:"limit";s:1:"1";s:7:"lastrun";s:10:"111111111111";s:7:"nextrun";i:11111111111;}

I know I could grab the value and change the 1 to 0 after the active variable, keeping the rest of the options but is there any other way via a Nagios command or script I have missed that already exists?
Unfortunately at this time there isn't a scripted way to trigger them on/off other that what you already have noted above.
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
Locked