Is there a way to remote monitor backup status?
For example, is there a file that summarize the global clients backup status so that we can use a script to read that status and send an alert via email.
This way could be similar to take a look at web GUI state and see if all clients has green border
Maybe using this here? https://urbackup.atlassian.net/wiki/display/US/Python3+web+api+wrapper
Use the get_status() function to get the contents of the status screen as JSON/python object.
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.
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
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!
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!
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!
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:
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.
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.