From c2e98d262d9e6003dfe7aadee5713028fb4d27cb Mon Sep 17 00:00:00 2001 From: James Meyer Date: Fri, 4 Jan 2013 20:41:23 -0600 Subject: xymon: hbnotes, for MBE systems generate a notes file that allows the download/upload of backup files. refs #893 --- abs/core/xymon/PKGBUILD | 4 +- abs/core/xymon/hbnotes.py | 127 +++++++++++++++++++++++++++++++++------------- 2 files changed, 94 insertions(+), 37 deletions(-) diff --git a/abs/core/xymon/PKGBUILD b/abs/core/xymon/PKGBUILD index 91fdb49..8441779 100755 --- a/abs/core/xymon/PKGBUILD +++ b/abs/core/xymon/PKGBUILD @@ -1,7 +1,7 @@ pkgbase=xymon pkgname=(xymonserver xymonclient) pkgver=4.3.5 -pkgrel=43 +pkgrel=44 pkgdesc="Hobbit is a system for monitoring servers and networks. " license="GPL" arch=('i686' 'x86_64') @@ -125,7 +125,7 @@ md5sums=('31923ec126fe1c264fceb459d2175161' '2d88e59ab17114030da514ba3f0a5b64' 'ee608dcafc050d790e28647a670f6b60' 'b2f98ac0df013332deedc1efae0a270d' - '8ad9dded90acc96e9186ba846a91bbb9' + 'fc24435b97254f0954233319ba09689b' '0f70e76a164f648f0a4a01110137cb20' 'f6921f0413215ae174e81306be80d37f' '80d9cfac86c6d96836e6f406e35e7cf5' diff --git a/abs/core/xymon/hbnotes.py b/abs/core/xymon/hbnotes.py index 8d73dbf..be34dc6 100644 --- a/abs/core/xymon/hbnotes.py +++ b/abs/core/xymon/hbnotes.py @@ -173,8 +173,8 @@ def create_dot_file(): def createdropdown(currenthostype): dir = "/data/storage/disk0/backup/system_backups" - dropdown=" " dropdown=''' +
Restore database + dropdown+=''' + +
      + Partial Restore
+
+ Upload file to restore + + +

Backup database
+ ''' + + #This is for the d/l backup option + dropdown+=''' + + + Download backup + + +
Optimize database
''' if currenthostype == "Master_backend": @@ -215,7 +239,8 @@ def create_notes(): cursor.execute("SELECT DISTINCT(hostname) from settings") result = cursor.fetchall() for row in result: - cursor.execute("select value,data from settings where hostname=%s and value in ('HostSystemType','HostHwuuid');",(row)) + #cursor.execute("select value,data from settings where hostname=%s and value in ('HostSystemType','HostHwuuid');",(row)) + cursor.execute("select value,data from settings where hostname=%s and value in ('HostSystemType','HardwareProfilePublicUUID');",(row)) hostvalues=cursor.fetchall() #This is here to ignore non LinHES hosts, or those that don't have a HostSystemType if len(hostvalues) == 0: @@ -261,6 +286,38 @@ function Do_it () alert(" database was not restored"); } } + else if (chosen == "Backup") + { + if (confirm('Continue with database backup?')) + { + do_submission(); + } + else + { + alert(" backup cancelled"); + } + } + else if (chosen == "Upload") + { + if (confirm('About to upload the backup file to server')) + { + alert("Uploading file to server"); + do_submission(); + } + } + else if (chosen == "Optimize") + { + if (confirm('Continue with database maintenance?')) + { + do_submission(); + } + else + { + alert("Optimization cancelled"); + } + } + + else if (chosen == "Shutdown") { @@ -318,7 +375,8 @@ function Do_it () data=hostvalues[i][1] currenthostype='' currenthostname='' - if value == "HostHwuuid" : + #if value == "HostHwuuid" : + if value == "HardwareProfilePublicUUID" : if data != "blank" : found_uuid="true" uuid=data @@ -337,46 +395,45 @@ function Do_it () file.write("\" >" + str(uuid) + "") else: file.write( "uuid not found, please submit a hardware profile" ) - - - buttonform_top=''' -
-
- ''' +
+ + ''' buttonform_bottom=''' - Update System - -
- - Restart interface: - -
- - Shutdown System
- Reboot System
- Wake on Lan
- Update System + +
+ + Restart interface: + +
+ + Shutdown System
+ Reboot System
+ Wake on Lan
+ - +
+

- - - +
+ + +
''' -- cgit v0.12