Mysql-zrm-reporter: Difference between revisions

From wiki.zmanda.com
Jump to navigation Jump to search
No edit summary
 
No edit summary
 
(33 intermediate revisions by the same user not shown)
Line 1: Line 1:
==NAME==
==NAME==


mysql-zrm-reporter - MySQL backup reporting tool.
mysql-zrm-reporter - ZRM for MySQL backup reporting utility.


==SYNOPSIS==
==SYNOPSIS==


mysql-zrm-reporter --fields <name1,name2,name3 ....>
  mysql-zrm-reporter [--fields name1, name2, name3, name4, name5 ....]
                    [--directory <dir> ]  
                      [--destination dir ]
                    [--key <name=value>]
                      [--where  fieldname=value]
                    [--help]
                      [--type  html]
                      [--output filename]
                      [--latest ]
                      [--noheader ]
                      [--show  backup-method-info |
                                backup-status-info |
                                backup-retention-info |
                                backup-performance-info |
                                restore-full-info |
                                restore-incr-info |
                                replication-info |
                                backup-app-performance-info ]
                      [--help]


==DESCRIPTION==
==DESCRIPTION==


This tool is part  of  Zmanda Recovery Manager for MySQL (MySQL ZRM). This tool can be used to display various information regarding MySQL database backups created using [[mysql-zrm]](1) tool.
mysql-zrm-reporter  utility  provides pre-defined  and user-defined reports about various MySQL database backup runs. The reports can be in text or HTML format. Backup report can be sent  as  a  RSS feed.


==BACKUP INFORMATION==
Backup        reports        can        be      configured      using ''/etc/mysql-zrm/mysql-zrm-reporter.conf''  file  parameters.  For  supported formats, see [[mysql-zrm-reporter.conf]](5).


The list of information available for each backup run:
ZRM  for MySQL configuration file, [[mysql-zrm.conf]](5) file contains HTML configuration  and  RSS    feed    configuration    parameters    for mysql-zrm-reporter      utility.      The     list     of mysql-zrm-reporter parameters are:


; backup-set : Name of the Backup Set
;html-report-directory : Set the directory where  text/HTML  reports  are written.  This parameter        is        optional.      Example: /var/www/html/mysql-zrm-reports/


; backup-date : Date and time stamp of Backup
; html-reports : List of pre-defined report(s) to be  generated  after  a  backup run. Example: backup-status-info


; mysql-version : MySQL server version
; webserver-url : RSS  feeds  URL  of  a  directory under document root of the web server. If this  value  is  not  specified  in  the [[mysql-zrm.conf]](5) configuration  file,  RSS  feeds will not be generated. Example: <nowiki>http://backupserver.company.com/reports/ </nowiki>


; backup-directory : The location of backup directory
; rss-header-location : The location of RSS feed properties  file  contain ing  RSS  feed channel  and  item properties. This parameter must be provided if webserver-url is  specified.  Example:  /etc/mysql-zrm/RSS.header


; backup-level : Backup level (full or incremental)
===BACKUP INFORMATION===


; raw-databases : List of databases that have raw backups
Each  backup run generates the following information about the backup:


; backup-time : Time taken to do the backup
; backup-date : Date and time stamp of backup run.
; mysql-version : MySQL server version.
; backup-directory : The location of backup directory.
; backup-level : Lists the backup-level - 0 for a  full  and  1  for incremental backup.
; raw-databases : List  of  databases  backed up using mysqlhotcopy.  If raw-tables parameter is  present,  this  will  have  only  one database listed.
; raw-tables : List  of  tables backed up using mysqlhotcopy.  The name  of  the database these tables  belong  to  is  found  under raw-databases.
; raw-databases-snapshot : List  of  databases  backed up using snapshots.  When raw-tables parameter is specified, this  will  list  only  one database.
; raw-tables-snapshot : List  of  tables backed up using mysqlhotcopy.  The name  of  the database these tables  belong  to  is  found  under raw-databases.
; backup-time : Time taken for the complete backup run. Format is HH:MM:SS
; read-locks-time : Time  read  lock  was  held  during  the  backup run. Format is HH:MM:SS
; flush-logs-time : Time  for flushing database pages to the disk. Format is HH:MM:SS
; backup-size : The size, in megabytes, of data backed up.
; backup-status : Status  has three  values.  "Backup  Failed"  value means that there was  a fatal error. "Backup done with errors" means that  though there was some error during backup but some of  the databases and tables were probably backed up. "Backup  succeeded" means  that the backup run was completed successfully.
; logical-databases : List  of  databases  backed  up using mysqldump(1).  When -tables parameter  is  specified,  this  will  only  one database.
; logical-tables : List  of  tables  belonging  to  logical-databases backed  up  using mysqldump(1). The name of the database these tables belong to is found under -databases.
; replication : List of  replication  files  backed  up  namely master.info  and relay-log.info
; slave-load-files : Names of SQL_LOAD* files that were backed up.
; incremental : Names of the binary log files backed up.
; backup-set :  Name of the backup set this backup belongs to.
; comment : Comment  about  the  backup  added  by  the administrator in the [[mysql-zrm.conf]](5) file.
; retention-policy : Backup image will be retained for the  time  specified as  parameter  in  Days/Weeks/Months/Years.  For  example: if the value is "10D" means the backup image will  be  retained  10 days  from  the backup-date.  This  policy  assumes  365 days in a year and 30 days in a month.
; compress : Specifies that the backup was  compressed.  Default compression method  is  gzip  program.  The  program used for compression is value for this parameter.
; encrypt : Program used for encryption if the backups are  encrypted.
; host : Hostname of the MySQL server that was backed up.
; compress-encrypt-time : Time  taken  by  compression  and/or  encryption.  This  time  is included in the backup time
; innodb-data : List of InnoDB shared data files backed up.
; innodb-logs : List of InnoDB logs backed up.


; backup-size : Size of backup
==OPTIONS==


; next-binlog : Next binary log file name
      --show    backup-method-info  |  backup-status-info    | backup-retention-info |
                backup-performance-info    |    restore-info    | selective-restore-info  |
                replication-info


; last-backup : Location of the last backup for this backup set
To  display  predefined  reports set  this  option.  The predefined reports, and what they contain, are listed below:


; backup-status : Status of the backup  run. The values can be "Backup Failed", "Backup done with errors", "Backup succeeded".
; backup-status-info  :   backup-set,  backup-date, backup-level, backup-status, backup comment
; backup-method-info : backup-set, raw-databases, raw-databases, logical-databases
; backup-retention-info  : backup-set,  backup-date, backup-level, backup-size, retention-policy
; backup-performance-info : backup-set,  backup-date, backup-level, backup-size, backup-size-compressed,    backup-time, compress-encrypt-time
; backup-app-performance-info : backup-set, backup-date, backup-level,              backup-size,backup-time, read-locks-time, flush-logs-time
; restore-info    :    backup-set,    backup-date, backup-level, backup-directory, backup-status, comment
; selective-restore-info : backup-set, backup-date, incremental
; replication-info  :    backup-set,    backup-date, replication, slave-load-files


; raw-tables(snapshot) : List of tables backed up using LVM snapshots
; --destination dir : Set  the  backup  root  directory.  This  parameter is  optional.  Default value is /var/lib/mysql-zrm


; raw-tables : List of tables backed up using mysqlhotcopy
; --fields name1,name2,name3... : Set  the  list  of  backup parameters  to  display.  List of valid field  names  are  described in BACKUP  INFORMATION section.  This field          is          optional. By default ''backup-set,backup-date,backup-level,backup-status,comment'' are displayed.  Spaces  are  not  allowed with  in  the parameter name list.  If  spaces  must  be  used, list must within quotes.


; logical-databases : List of databases backed up using mysqldump(1)
; --where fieldname=value : The utility will display the MySQL  backup  parameters  where  the field name matches value. This field is optional.


; logical-tables : List  of  tables  belonging  to "logical-databases" backed up using mysqldump(1)
; --type html : Report will be in HTML format.


; replication : Names of replication files that were backed up
; --output filename : HTML  report  will  be  written to filename under "html" directory and text reports will be written to filename  under "text" direc- tory.    By  default, these directories are created under the current working directory.  The utility  allows  users to  specify explicit  directory  location  for  reports  in [[mysql-zrm.conf]](5) using "html-report-directory" parameter.  If  this parameter  is set,  then the utility will create "html-report-directory" directory (if it does  not  exist)  and  output  report with  name  file name  will be written to "html" and/or "text" sub-directory under "html-report-directory" path.


; slave-load-files : Names of SQL_LOAD* files that were backed up
; --latest : Report about the most recent backup run.


==OPTIONS==
; --noheader : Generate TEXT reports with no page header, This option  will  be ignored for HTML reports.


; --directory <dir> : Specify the backup root directory, default value is /var/lib/mysql-zrm
; --help : Displays help message and exits.


; --fields <name1,name2,name3...> :  Specify  list  of  backup  parameters  to  display.  List of field names are described in BACKUP INFORMATION section.
==EXAMPLES==


; --key <name=value> : The tool will display the MySQL backup parameters where the key matches value.
* To  display  backup date, location of backups, and backup set name use:
  mysql-zrm-reporter --destination /var/lib/mysql-zrm/backup  --fields backup-date,backup-directory,backup-set


; --help : Display help message and exit.
* To  display  backup  date,  backup  set  name,  and size of backup use:
  mysql-zrm-reporter --destination /var/lib/mysql-zrm/backup  --fields backup-date,backup-set,backup-size


==EXAMPLES==
* To  display  size  of  backup, backup set name, and date of backup  for"config1"    backup    set    use:
  mysql-zrm-reporter --destination /var/lib/mysql-zrm/backup      --fields      backup-date, backup-set, backup-size --where backup-set=config1


Following command displays backup date, location of backups, backup set name:          
* To  display  backup status  report  for  "config1"  backup set   use:
  mysql-zrm-reporter  --destination /var/lib/mysql-zrm/backup  --show backup-status-info --where backup-set=config1


  # mysql-zrm-reporter --directory /var/lib/mysql-zrm/backup --fields backup-date,backup-directory,backup-set
* To display backup status report for "config1" backup set in HTML format and    write    a    file    use:


Following command displays size of backupbackup set name, and date of backup:
  mysql-zrm-reporter --destination /var/lib/mysql-zrm/backup --show backup-status-info    --where backup-set=config1 --type html --output myreport.html


# mysql-zrm-reporter --directory /var/lib/mysql-zrm/backup --fields backup-date,backup-set,backup-size
Following command searches all  index files for "config1" backup-set name  and  displays size  of backup, backup set name and date  of  backup
     
# mysql-zrm-reporter --directory /var/lib/mysql-zrm/backup --fields backup-date,backup-set,backup-size \
  --key backup-set=config1


==FILES==
==FILES==
Line 81: Line 126:
; /var/lib/mysql-zrm : Directory under which all backup data is stored.
; /var/lib/mysql-zrm : Directory under which all backup data is stored.


; /etc/mysql-zrm/<backup set name>/mysql-zrm.conf : Configuration file read by mysql-zrm tool.
; /etc/mysql-zrm/mysql-zrm-reporter.conf : Configuration file read by mysql-zrm-reporter utility.


==RETURN VALUES==
==RETURN VALUES==


On  success, zero is returned. On error, non-zero value is returned.
On  success, zero is returned. On error, non-zero value is returned.  Output  messages  are written to STDOUT and error messages are to STDERR.


==SEE ALSO==
==SEE ALSO==
 
[[mysql-zrm]](1), [[mysql-zrm-backup]](1), [[mysql-zrm-manage-backup]](1), [[mysql-zrm-restore]](1), [[mysql-zrm-check]](1),  [[mysql-zrm-list]](1), [[mysql-zrm-getconf]](1), [[mysql-zrm-setconf]](1),  [[mysql-zrm-parse-binlogs]](1),  [[mysql-zrm-purge]](1), [[mysql-zrm-extract-backup]](1), [[mysql-zrm-verify-backup]](1), [[mysql-zrm-abort-backup]](1), [[mysql-zrm-scheduler]](1), [[mysql-zrm-reporter.conf]](5)
[[mysql-zrm]](1), [[mysql-zrm-scheduler]](1), mysql(1)


==AUTHOR==
==AUTHOR==
Zmanda Inc. (http://www.zmanda.com)
Zmanda Inc. (http://www.zmanda.com)

Latest revision as of 18:35, 28 June 2010

NAME

mysql-zrm-reporter - ZRM for MySQL backup reporting utility.

SYNOPSIS

  mysql-zrm-reporter  [--fields  name1, name2, name3, name4, name5 ....]
                      [--destination dir ]
                      [--where  fieldname=value]
                      [--type  html]
                      [--output filename]
                      [--latest ]
                      [--noheader ]
                      [--show  backup-method-info |
                               backup-status-info |
                               backup-retention-info |
                               backup-performance-info |
                               restore-full-info |
                               restore-incr-info |
                               replication-info |
                               backup-app-performance-info ]
                      [--help]

DESCRIPTION

mysql-zrm-reporter utility provides pre-defined and user-defined reports about various MySQL database backup runs. The reports can be in text or HTML format. Backup report can be sent as a RSS feed.

Backup reports can be configured using /etc/mysql-zrm/mysql-zrm-reporter.conf file parameters. For supported formats, see mysql-zrm-reporter.conf(5).

ZRM for MySQL configuration file, mysql-zrm.conf(5) file contains HTML configuration and RSS feed configuration parameters for mysql-zrm-reporter utility. The list of mysql-zrm-reporter parameters are:

html-report-directory
Set the directory where text/HTML reports are written. This parameter is optional. Example: /var/www/html/mysql-zrm-reports/
html-reports
List of pre-defined report(s) to be generated after a backup run. Example: backup-status-info
webserver-url
RSS feeds URL of a directory under document root of the web server. If this value is not specified in the mysql-zrm.conf(5) configuration file, RSS feeds will not be generated. Example: http://backupserver.company.com/reports/
rss-header-location
The location of RSS feed properties file contain ing RSS feed channel and item properties. This parameter must be provided if webserver-url is specified. Example: /etc/mysql-zrm/RSS.header

BACKUP INFORMATION

Each backup run generates the following information about the backup:

backup-date
Date and time stamp of backup run.
mysql-version
MySQL server version.
backup-directory
The location of backup directory.
backup-level
Lists the backup-level - 0 for a full and 1 for incremental backup.
raw-databases
List of databases backed up using mysqlhotcopy. If raw-tables parameter is present, this will have only one database listed.
raw-tables
List of tables backed up using mysqlhotcopy. The name of the database these tables belong to is found under raw-databases.
raw-databases-snapshot
List of databases backed up using snapshots. When raw-tables parameter is specified, this will list only one database.
raw-tables-snapshot
List of tables backed up using mysqlhotcopy. The name of the database these tables belong to is found under raw-databases.
backup-time
Time taken for the complete backup run. Format is HH:MM:SS
read-locks-time
Time read lock was held during the backup run. Format is HH:MM:SS
flush-logs-time
Time for flushing database pages to the disk. Format is HH:MM:SS
backup-size
The size, in megabytes, of data backed up.
backup-status
Status has three values. "Backup Failed" value means that there was a fatal error. "Backup done with errors" means that though there was some error during backup but some of the databases and tables were probably backed up. "Backup succeeded" means that the backup run was completed successfully.
logical-databases
List of databases backed up using mysqldump(1). When -tables parameter is specified, this will only one database.
logical-tables
List of tables belonging to logical-databases backed up using mysqldump(1). The name of the database these tables belong to is found under -databases.
replication
List of replication files backed up namely master.info and relay-log.info
slave-load-files
Names of SQL_LOAD* files that were backed up.
incremental
Names of the binary log files backed up.
backup-set
Name of the backup set this backup belongs to.
comment
Comment about the backup added by the administrator in the mysql-zrm.conf(5) file.
retention-policy
Backup image will be retained for the time specified as parameter in Days/Weeks/Months/Years. For example: if the value is "10D" means the backup image will be retained 10 days from the backup-date. This policy assumes 365 days in a year and 30 days in a month.
compress
Specifies that the backup was compressed. Default compression method is gzip program. The program used for compression is value for this parameter.
encrypt
Program used for encryption if the backups are encrypted.
host
Hostname of the MySQL server that was backed up.
compress-encrypt-time
Time taken by compression and/or encryption. This time is included in the backup time
innodb-data
List of InnoDB shared data files backed up.
innodb-logs
List of InnoDB logs backed up.

OPTIONS

      --show    backup-method-info   |   backup-status-info    | backup-retention-info |
                backup-performance-info     |     restore-info     | selective-restore-info  |
                replication-info

To display predefined reports set this option. The predefined reports, and what they contain, are listed below:

backup-status-info
backup-set, backup-date, backup-level, backup-status, backup comment
backup-method-info
backup-set, raw-databases, raw-databases, logical-databases
backup-retention-info
backup-set, backup-date, backup-level, backup-size, retention-policy
backup-performance-info
backup-set, backup-date, backup-level, backup-size, backup-size-compressed, backup-time, compress-encrypt-time
backup-app-performance-info
backup-set, backup-date, backup-level, backup-size,backup-time, read-locks-time, flush-logs-time
restore-info
backup-set, backup-date, backup-level, backup-directory, backup-status, comment
selective-restore-info
backup-set, backup-date, incremental
replication-info
backup-set, backup-date, replication, slave-load-files
--destination dir
Set the backup root directory. This parameter is optional. Default value is /var/lib/mysql-zrm
--fields name1,name2,name3...
Set the list of backup parameters to display. List of valid field names are described in BACKUP INFORMATION section. This field is optional. By default backup-set,backup-date,backup-level,backup-status,comment are displayed. Spaces are not allowed with in the parameter name list. If spaces must be used, list must within quotes.
--where fieldname=value
The utility will display the MySQL backup parameters where the field name matches value. This field is optional.
--type html
Report will be in HTML format.
--output filename
HTML report will be written to filename under "html" directory and text reports will be written to filename under "text" direc- tory. By default, these directories are created under the current working directory. The utility allows users to specify explicit directory location for reports in mysql-zrm.conf(5) using "html-report-directory" parameter. If this parameter is set, then the utility will create "html-report-directory" directory (if it does not exist) and output report with name file name will be written to "html" and/or "text" sub-directory under "html-report-directory" path.
--latest
Report about the most recent backup run.
--noheader
Generate TEXT reports with no page header, This option will be ignored for HTML reports.
--help
Displays help message and exits.

EXAMPLES

  • To display backup date, location of backups, and backup set name use:
 mysql-zrm-reporter --destination /var/lib/mysql-zrm/backup   --fields backup-date,backup-directory,backup-set
  • To display backup date, backup set name, and size of backup use:
 mysql-zrm-reporter --destination /var/lib/mysql-zrm/backup   --fields backup-date,backup-set,backup-size
  • To display size of backup, backup set name, and date of backup for"config1" backup set use:
 mysql-zrm-reporter --destination /var/lib/mysql-zrm/backup       --fields      backup-date, backup-set, backup-size --where backup-set=config1
  • To display backup status report for "config1" backup set use:
 mysql-zrm-reporter  --destination /var/lib/mysql-zrm/backup   --show backup-status-info --where backup-set=config1
  • To display backup status report for "config1" backup set in HTML format and write a file use:
 mysql-zrm-reporter --destination /var/lib/mysql-zrm/backup --show backup-status-info     --where backup-set=config1 --type html --output myreport.html


FILES

/var/lib/mysql-zrm
Directory under which all backup data is stored.
/etc/mysql-zrm/mysql-zrm-reporter.conf
Configuration file read by mysql-zrm-reporter utility.

RETURN VALUES

On success, zero is returned. On error, non-zero value is returned. Output messages are written to STDOUT and error messages are to STDERR.

SEE ALSO

mysql-zrm(1), mysql-zrm-backup(1), mysql-zrm-manage-backup(1), mysql-zrm-restore(1), mysql-zrm-check(1), mysql-zrm-list(1), mysql-zrm-getconf(1), mysql-zrm-setconf(1), mysql-zrm-parse-binlogs(1), mysql-zrm-purge(1), mysql-zrm-extract-backup(1), mysql-zrm-verify-backup(1), mysql-zrm-abort-backup(1), mysql-zrm-scheduler(1), mysql-zrm-reporter.conf(5)

AUTHOR

Zmanda Inc. (http://www.zmanda.com)