import urbackup_api
server = urbackup_api.urbackup_server(“http://10.0.0.95:55414/x”, “admin”, “xxxxxxxx”)
server.start_full_file_back(“pht”)
server.get_status()
but I only get
Python 3.4.1 (v3.4.1:c0e311e010fc, May 18 2014, 10:38:22) [MSC v.1600 32 bit (Intel)] on win32
Type “copyright”, “credits” or “license()” for more information.
================================ RESTART ================================
Logging in…
import urbackup_api
server = urbackup_api.urbackup_server(“http://10.0.0.95:55414/x”, “admin”, “xxxxxx”)
for client in server.get_status():
print(client)
Now I should read this content and decide where “file_ok” and “image_ok” are true.
Can you suggest me a more simply way?
The final scope is to run a .cmd or .vbs via “PRTG server Monitor” so that It can alert the admin into particular backup-status condition.
This is not like getting email on backup fails, because if a client die, we’ll never get that email.
Are you planning to introduce such a feature, so that you can send email if clients as not seen (succesfull) since xxx time?
I use an RMM as well. But I am monitoring the workstations as well. So if the client would drop event log entries, that would be enough for me… I just don’t know how to set something like that up.
BAM!!! URONI!!! That is Exactly what I needed for successful backups!! I can now track this on each machine and see if there has been a successful backup in the last 24 hours!!
I might suggest a Pre / Post input field on the interface that points to the default would have clued me in to it… but just knowing it helps a lot!!
Thanks again!!!
I used the following:
EVENTCREATE /T SUCCESS /L APPLICATION /SO UrBackup /ID 100 /D "File backup succeeded."
This seems to have done the trick!! Thanks again for the direction!
I run incremental backups all the time in which my installation does run the postfilebackup.bat. I use eventcreate to drop a message in the event log, as he suggested.
I use an RMM to check those event logs every day, and I know I am not running a full backup every day. Only occasionally do I get alarms for systems that have been shutdown during the backup window or a laptop that was taken off-site, but not turned on. Otherwise, the events are getting created, and the monitor finds them.
This has been working well for me since I got Uroni’s reply in January. I have upgraded to 1.4.10.0 at the end of October, and it is still functioning for me.
I have no idea why it wouldn’t work for incremental backups for you.
[SOLVED]
Just want to inform you that I have found the problem I had. And it was that the Urbackup client service was running as Local System account and therefor didn’t have permission to create event log on remote server.
Changed Log on account for the service to a domain user and now everything is working perfect!
I know this is an old thread, but an answer may help someone searching by topic.
The server and the clients use a slightly different format for the batch files executed. This table in the official documentation explains the file name conventions used by client and server: https://www.urbackup.org/administration_manual.html#x1-340006.4.1
I got this!
Zabbix 4.0
Pyhton Script to discover status, Zabbix Agent has user parameter.
But there is status codes in API response ‘status’: 0
What is 0/1/2/3 ? And other codes?
How can I map status codes to user-friendly view? May be you have guide somewhere?
I have made a solution that gives me a regular report of all the clients I’m backing up as well as the disk space. It will send me the report every day and gives a quick overview. If something is wrong then I’ll open UrBackup for further inquiry. The list shows all the backup clients, when they last backed up and when they were last online as well as the diskspace of the backup.
This is python script.
Prerequisite is urbackup web api module. Available with pip3.
I use names for groups in urBackup WEB interface: desktops_ClientTitle, servers_ClientTitle, vms_ClientTitle, laptops_ClientTitle.
Hi! Sorry for a while. Currently I use different solution based on sqlite cli and quering sqlite database of urBackup server. There is JSON return available. If it possible for you to run Zabbix ^4.0 you can use this metrics for example:
Main item: system.run[/path/to/sqlitecli -attributes,wait] - always return string, this is why you need JS parsing.
Use JavaScript preprocessing: there is a lot of basic standard Zabbix templates you can check it there.
Examble this script parse JSON return you have and prepare it for Zabbix ({data:[{metrics}, {metrics}…]}):
Blockquote
var value2 = JSON.parse(value)
var data = value2[“ata_smart_attributes”][“table”]
var temp =
for (var i = 0, len = data.length; i < len; i++) {
temp.push({
“{#PROPID}”: data[i][“id”],
“{#PROPNAME}”: data[i][“name”],
“{#VALUE}”: data[i][“value”],
“{#WORST}”: data[i][“worst”],
“{#RAW}”: data[i][“raw”][“value”],
“{#PREFAIL}”: data[i][“flags”][“prefailure”]
})
};
return JSON.stringify({data: temp})
Use discovery rule:
Create discovery rule of Dependent type using Master item from step 2.
And create items prototypes.
Check any Zabbix standard templates wehere master item like RAW data etc. And with Discovery rule on it.
This way you can set monitoring running without maintaining backup node local python scripts and avoid dependence from uroni web api and python dependences. Also there is different sqlite clients you can use your own created on any language you want. urBackup databases as I remeber can be found in /usr/share/urbackup… There is several files choose with the latest data or copy it on your GUI machine for internal research with SQLite GUI client. DB structure very simple.