Goal : to make it work in newrelic
curl -X POST -F <data1> -F <data2> -F <data3> <URI>
Find substring 'Successful' on the result page
-------------------
API test should be created in newrelic. Code:
var assert = require('assert');
var options = {
body: "field1=data1&field2=data2",
headers: {
'Content-Type': 'application/x-www-formurlencoded'
}
};
//Define expected results using callback function.
function callback(error, response, body) {
//Log status code to Synthetics console.
console.log(response.statusCode + " status code")
//Verify endpoint returns 200 (OK) response code.
var match_result = body.match(/Successful/);
assert.ok((response.statusCode == 200) && (match_result != null), 'Expected 200 OK response and "Successful" on the page');
//Log end of script.
console.log("End reached");
}
$http.post(options, callback);
https://habr.com/ru/company/flant/blog/420055/
https://borgbackup.readthedocs.io/en/stable/installation.html
1. install borg on both backup server and client :
portsnap fetch update ; portmaster -Dbg archivers/py-borgbackup
2. Add user on server
# pw user add -n borg -m -s /sbin/nologin
3. on client generate ssh key :
# ssh-keygen -b 4096
4. on server add key :
# cd /home/borg//.ssh
# echo 'command="/usr/local/bin/borg serve" ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDNdaDfqUUf/XmSVWfF7PfjGlbKW00MJ63zal/E/mxm+vJIJRBw7GZofe1PeTpKcEUTiBBEsW9XUmTctnWE6p21gU/JNU0jITLx+vg4IlVP62cac71tkx1VJFMYQN6EulT0alYxagNwEs7s5cBlykeKk/QmteOOclzx684t9d6BhMvFE9w9r+c76aVBIdbEyrkloiYd+vzt79nRkFE4CoxkpvptMgrAgbx563fRmNSPH8H5dEad44/Xb5uARiYhdlIl45QuNSpAdcOadp46ftDeQCGLc4CgjMxessam+9ujYcUCjhFDNOoEa4YxVhXF9Tcv8Ttxolece6y+IQM7fbDR' > authorized_keys
# chown -R borg:borg /home/borg/.ssh/
5. on client init repo
# borg init -e none ssh:
6. on client run first backup :
# borg create --stats --list ssh://borg@host:port/path/to/backup::"MyFirstBackup-{now:%Y-%m-%d_%H:%M:%S}" /etc /root /usr/local/etc
------------------
List backups
on client machine :
borg list ssh://borg@host:port/path/to/backups
on server :
borg list /path/to/backups
-----------------
List files in backups :
borg list /path/to/backups::MyBackup-<date>
-------------
Extract file or directory from backup (on server) :
borg extract /path/to/backups::MyBackup-<date> etc/hostname
------------
in this case for zabbix database:
Convert tables from latin1 to utf-8 :
mysql zabbix -B -N -e 'show tables' | xargs -L 1 | awk '{print "ALTER TABLE "$1" CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin"}' | xargs -L 1 -I {} echo mysql zabbix -e \' {} \' | sh -x
convert database charset :
mysql -e 'ALTER DATABASE zabbix DEFAULT CHARACTER SET utf8 COLLATE utf8_bin'
After connecting pptp vpn dns servers recieved from vpn server are listed at the bottom of the list in /etc/resolv.conf and have lowest priority.
To make them have higher priority:
nmcli -p connection modify MY_VPN_CONNECTION ipv4.dns-priority -42
found this on: