A way to remote monitor backup status?

Sorry for inexperience.
I use this:

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…

and no more

Well, something like this then:

for client in server.get_status():
    print(client)

Thanks! Now OK.
Now I’ve:

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)

So, if i run:

monitor.py>monitor.results.txt

I get a the file monitor.results.txt with:

Logging in…
{‘os_version_string’: ‘Microsoft (build 9600), 64-bit’, ‘online’: True, ‘lastseen’: ‘2014-09-15 10:52’, ‘client_version_string’: ‘1.4’, ‘image_ok’: True, ‘lastbackup_image’: ‘2014-09-14 02:11’, ‘name’: ‘DUO’, ‘delete_pending’: ‘’, ‘file_ok’: True, ‘done_pc’: 33, ‘id’: 6, ‘lastbackup’: ‘2014-09-15 10:55’, ‘ip’: ‘10.0.0.80’, ‘status’: 3}

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?

Thanks.

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.

Thanks, MDS for bringing this up.

After a successfull file backup the client executes C:\Program Files\UrBackup\postfilebackup.bat (if present) and you can add something like

EVENTCREATE /T SUCCESS /L URBACKUP /ID 100 /D “File backup succeeded.”

there.

2 Likes

interesting feature too

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!

Nice!
Works good on Full file backup, but when an Incremental file backup completes it does not seems like it runs the postfilebackup.bat script.

EDIT:
I found that you can run urbackup/post_incr_filebackup.bat on the Urbackup server, but it does not work on clients.

Any clue?

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.

Hmm ok then, I will try and reinstall the clients and hope for the best! At least now I know it should be working :smile:
Thanks!

[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!

2 Likes

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

Essentially, client use:
prefilebackup.bat
postfilebackup.bat
preimagebackup.bat
postimagebackup.bat

And the server uses:
post_full_filebackup.bat
post_incr_filebackup.bat
post_full_imagebackup.bat
post_incr_imagebackup.bat

Only the Windows server/clients use .bat file extension. Linux server/clients do not use a file extension.

I got this! :slight_smile:
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?

{
‘client_version_string’: ‘2.2.6’,
’delete_pending’: ‘’,
‘file_disabled’: True,
‘file_ok’: False,
‘groupname’: ‘Workstations’,
‘id’: 6,
‘image_ok’: True,
‘ip’: ‘192.168.0.20’,
’last_filebackup_issues’: 0,
‘lastbackup’: 1542345130,
‘lastbackup_image’: 1545128760,
‘lastseen’: 1545156219,
‘name’: ‘solid’,
‘online’: True,
‘os_simple’: ‘windows’,
‘os_version_string’: ‘Microsoft Windows 7 Ultimate Service Pack 1 (build 7601), 64-bit’,
‘processes’: [],
’status’: 0
}

Thanks!

1 Like

Don’t know what you try to do, but here is on older version of
a similar script for icinga/nagios, which I’ve adapted for our needs.

Maybe this is of some help for you.

I’ve got a quick script to export the urbackup api data to prometheus:

2 Likes

Reporting.zip (494.8 KB)

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.

image

1 Like

Hi, We are also interested in Zabbix monitoring of backups, did you get it to work?

Regards
Jens

Yes.
Some scripts can be found there: https://github.com/artyomtsybulkin/zabbix-solutions/tree/master/linux


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.

Artyomtsybulkin, your link was broken. Can u publish your solution again? Thanks a lot.

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:

  1. Main item: system.run[/path/to/sqlitecli -attributes,wait] - always return string, this is why you need JS parsing.
  2. 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})

  1. 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.