├── dist └── proxmox_qemu_backup-2.0.10.mkp ├── docs ├── example-services-screenshot.png └── proxmox_qemu_backup_man-page.png ├── src ├── var │ └── check_mk │ │ └── packages │ │ └── proxmox_qemu_backup └── local │ ├── lib │ └── python3 │ │ ├── cmk │ │ └── base │ │ │ └── cee │ │ │ └── plugins │ │ │ └── bakery │ │ │ └── proxmox_qemu_backup.py │ │ └── cmk_addons │ │ └── plugins │ │ └── proxmox_qemu_backup │ │ ├── rulesets │ │ ├── proxmox_qemu_backup_bakery_rulesets.py │ │ └── proxmox_qemu_backup_rulesets.py │ │ ├── checkman │ │ └── proxmox_qemu_backup │ │ └── agent_based │ │ └── proxmox_qemu_backup.py │ └── share │ └── check_mk │ └── agents │ └── plugins │ └── proxmox_qemu_backup ├── check_mk ├── checkman │ └── proxmox_qemu_backup ├── agents │ └── plugins │ │ └── proxmox_qemu_backup ├── web │ └── plugins │ │ └── wato │ │ └── check_parameters_proxmox_qemu_backup.py └── checks │ ├── proxmox_lxc_backup │ └── proxmox_qemu_backup ├── README.md └── LICENSE.md /dist/proxmox_qemu_backup-2.0.10.mkp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/edvler/check_mk_proxmox-qemu-backup/HEAD/dist/proxmox_qemu_backup-2.0.10.mkp -------------------------------------------------------------------------------- /docs/example-services-screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/edvler/check_mk_proxmox-qemu-backup/HEAD/docs/example-services-screenshot.png -------------------------------------------------------------------------------- /docs/proxmox_qemu_backup_man-page.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/edvler/check_mk_proxmox-qemu-backup/HEAD/docs/proxmox_qemu_backup_man-page.png -------------------------------------------------------------------------------- /src/var/check_mk/packages/proxmox_qemu_backup: -------------------------------------------------------------------------------- 1 | {'author': 'Matthias Maderer ', 2 | 'description': 'This check outputs the status and age of Proxmox VE guest ' 3 | 'backups done via vzdump or Proxmox Backup Server.', 4 | 'download_url': 'https://github.com/edvler/check_mk_proxmox-qemu-backup', 5 | 'files': {'agents': ['plugins/proxmox_qemu_backup'], 6 | 'cmk_addons_plugins': ['proxmox_qemu_backup/agent_based/proxmox_qemu_backup.py', 7 | 'proxmox_qemu_backup/rulesets/proxmox_qemu_backup_rulesets.py', 8 | 'proxmox_qemu_backup/rulesets/proxmox_qemu_backup_bakery_rulesets.py', 9 | 'proxmox_qemu_backup/checkman/proxmox_qemu_backup'], 10 | 'lib': ['check_mk/base/cee/plugins/bakery/proxmox_qemu_backup.py']}, 11 | 'name': 'proxmox_qemu_backup', 12 | 'title': 'Proxmox Backup Logfile Check', 13 | 'version': '2.0.10', 14 | 'version.min_required': '2.3.0', 15 | 'version.packaged': 'cmk-mkp-tool 0.2.0', 16 | 'version.usable_until': None} 17 | -------------------------------------------------------------------------------- /src/local/lib/python3/cmk/base/cee/plugins/bakery/proxmox_qemu_backup.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | #Author: Matthias Maderer 4 | #E-Mail: matthias.maderer@web.de 5 | #URL: https://github.com/edvler/check_mk_proxmox-qemu-backup 6 | #License: GPLv2 7 | 8 | #only CEE! 9 | try: 10 | from pathlib import Path 11 | from typing import TypedDict 12 | from .bakery_api.v1 import Plugin, register, OS, FileGenerator 13 | 14 | class ProxmoxQemuBackupBakeryConfig(TypedDict, total=False): 15 | deployment: bool 16 | 17 | def get_proxmox_qemu_backup_files(conf: ProxmoxQemuBackupBakeryConfig) -> FileGenerator: 18 | deployment = conf["deployment"] 19 | 20 | if deployment == False: 21 | return 22 | 23 | yield Plugin( 24 | base_os=OS.LINUX, 25 | source=Path("proxmox_qemu_backup"), 26 | interval=None, 27 | asynchronous=False, 28 | ) 29 | 30 | register.bakery_plugin( 31 | name="proxmox_qemu_backup_bakery", 32 | files_function=get_proxmox_qemu_backup_files, 33 | ) 34 | except ModuleNotFoundError: 35 | pass -------------------------------------------------------------------------------- /src/local/lib/python3/cmk_addons/plugins/proxmox_qemu_backup/rulesets/proxmox_qemu_backup_bakery_rulesets.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # Author: Matthias Maderer 3 | # E-Mail: matthias.maderer@web.de 4 | # URL: https://github.com/edvler/check_mk_proxmox-qemu-backup 5 | # License: GPLv2 6 | 7 | from cmk.rulesets.v1 import Title, Help 8 | from cmk.rulesets.v1.form_specs import ( 9 | DefaultValue, 10 | DictElement, 11 | Dictionary, 12 | BooleanChoice 13 | ) 14 | 15 | from cmk.rulesets.v1.rule_specs import AgentConfig, Topic 16 | 17 | 18 | def _valuespec_agent_config_proxmox_qemu_backup_bakery(): 19 | return Dictionary( 20 | title=Title("Agent Plugin Parameters"), 21 | elements={ 22 | 'deployment': DictElement( 23 | required=True, 24 | parameter_form=BooleanChoice( 25 | title=Title('Deploy Proxmox Backup Logfile Check'), 26 | prefill=DefaultValue(True), 27 | ) 28 | ), 29 | }, 30 | ) 31 | 32 | 33 | rule_spec_agent_config_proxmox_qemu_backup_bakery = AgentConfig( 34 | title=Title("Proxmox Backup Logfile Check"), 35 | topic=Topic.OPERATING_SYSTEM, 36 | name="proxmox_qemu_backup_bakery", 37 | parameter_form=_valuespec_agent_config_proxmox_qemu_backup_bakery, 38 | ) 39 | -------------------------------------------------------------------------------- /check_mk/checkman/proxmox_qemu_backup: -------------------------------------------------------------------------------- 1 | title: Plugin to check Proxmox VM guest (QEMU) backups 2 | agents: linux 3 | author: Matthias Maderer 4 | license: GPLv2 5 | distribution: check_mk 6 | description: 7 | This check runs on Proxmox Servers. 8 | 9 | It reads all configs in the direcotry /etc/pve/qemu-server/. 10 | For each VM guest found a service is created. The service read all 11 | logfiles under /var/log/vzdump/ and parses it. 12 | 13 | The default is that the service gets {critical} if no backup exists or the backup is 14 | older than 30 hours. It gets {warning} if the backup is older than 26 hours. 15 | 16 | The {critical} and {warning} limits can be configured in WATO. 17 | The check can also be disabled for a VM guest. 18 | It's possible to define the runtime (duration) of the backup-process. 19 | In this time the checks stays {ok} if the backup task is currently running. 20 | Goto WATO - Host & Service Parameters. Search for proxmox. 21 | 22 | Newly created VM guest are displayed as new service by the check_mk 23 | inventory check. 24 | 25 | {Installation:} 26 | https://github.com/edvler/check_mk_proxmox-qemu-backup/README.md 27 | 28 | Check https://github.com/edvler/check_mk_proxmox-qemu-backup 29 | for more informations. 30 | 31 | inventory: 32 | One service will be created for each VM guest. 33 | -------------------------------------------------------------------------------- /src/local/lib/python3/cmk_addons/plugins/proxmox_qemu_backup/checkman/proxmox_qemu_backup: -------------------------------------------------------------------------------- 1 | title: Plugin to check Proxmox VM guest backups 2 | agents: linux 3 | author: Matthias Maderer 4 | license: GPLv2 5 | distribution: check_mk 6 | description: 7 | This check outputs the status and age of Proxmox VE guest backups done 8 | via vzdump or Proxmox Backup Server. 9 | 10 | It reads all configs in the direcotry /etc/pve/qemu-server/. 11 | For each VM guest found a service is created. The service read all 12 | logfiles under /var/log/vzdump/ and parses it for WARN and ERROR entrys. 13 | Logs from Proxmox Backup Server backup processes also located in /var/log/vzdump/ 14 | and are also checked. 15 | 16 | The {critical} and {warning} limits for the backup age can be configured in WATO. 17 | 18 | It's possible to check the runtime (duration) of the backup-process. 19 | In this time the checks stays {ok} if the backup task is currently running. 20 | 21 | Goto WATO - Host & Service Parameters. Search for proxmox. 22 | 23 | Newly created guest are displayed as new service by the check_mk 24 | inventory check. 25 | 26 | {Installation:} 27 | https://github.com/edvler/check_mk_proxmox-qemu-backup/README.md 28 | 29 | Check https://github.com/edvler/check_mk_proxmox-qemu-backup 30 | for more informations. 31 | 32 | inventory: 33 | One service will be created for each VM guest. -------------------------------------------------------------------------------- /check_mk/agents/plugins/proxmox_qemu_backup: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # Author: Matthias Maderer 4 | # E-Mail: edvler@edvler-blog.de 5 | # URL: https://github.com/edvler/check_mk_proxmox-qemu-backup 6 | # License: GPLv2 7 | 8 | QEMU_SERVER_DIR=/etc/pve/qemu-server 9 | LXC_SERVER_DIR=/etc/pve/lxc 10 | VZDUMP_LOG_DIR=/var/log/vzdump 11 | 12 | echo '<<>>' 13 | 14 | #get all proxmox qemu machines 15 | QEMU_MACHINES=$(find $QEMU_SERVER_DIR/ -type f) 16 | for qemu in $QEMU_MACHINES; do 17 | QEMU_VMID=$(basename $qemu | cut -d '.' -f 1) 18 | QEMU_MACHINE_NAME=$(cat $qemu|grep name:|awk '{print $2}') 19 | if [ -z "$QEMU_MACHINE_NAME" ]; then 20 | QEMU_MACHINE_NAME="NO-NAME" 21 | fi 22 | echo "QEMU-MACHINE;;;;;$qemu;;;;;$QEMU_MACHINE_NAME" 23 | awk '{print FILENAME, $0}' ${VZDUMP_LOG_DIR}/qemu-${QEMU_VMID}.log \ 24 | | grep -v "INFO: status:" 25 | done 26 | 27 | ###now lxc 28 | 29 | echo '<<>>' 30 | # LXC 31 | LXC_MACHINES=$(find $LXC_SERVER_DIR/ -type f) 32 | for lxc in $LXC_MACHINES; do 33 | LXC_VMID=$(basename $lxc | cut -d '.' -f 1) 34 | LXC_MACHINE_NAME=$(cat $lxc|grep name:|awk '{print $2}') 35 | if [ -z "$LXC_MACHINE_NAME" ]; then 36 | LXC_MACHINE_NAME="NO-NAME" 37 | fi 38 | echo "LXC-MACHINE;;;;;$lxc;;;;;$LXC_MACHINE_NAME" 39 | awk '{print FILENAME, $0}' ${VZDUMP_LOG_DIR}/lxc-${LXC_VMID}.log \ 40 | | grep -v "INFO: status:" 41 | done 42 | 43 | #Running processes 44 | psout=$(ps aux |grep vzdump |grep /bin/sh) 45 | echo "PSOUTPUT $psout" 46 | 47 | -------------------------------------------------------------------------------- /src/local/share/check_mk/agents/plugins/proxmox_qemu_backup: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # Author: Matthias Maderer 4 | # E-Mail: edvler@edvler-blog.de 5 | # URL: https://github.com/edvler/check_mk_proxmox-qemu-backup 6 | # License: GPLv2 7 | 8 | QEMU_SERVER_DIR=/etc/pve/qemu-server 9 | LXC_SERVER_DIR=/etc/pve/lxc 10 | VZDUMP_LOG_DIR=/var/log/vzdump 11 | 12 | if [ ! -d "$QEMU_SERVER_DIR" ]; then 13 | exit 0 14 | fi 15 | 16 | 17 | echo '<<>>' 18 | 19 | #get all proxmox qemu machines 20 | QEMU_MACHINES=$(find $QEMU_SERVER_DIR/ -type f) 21 | for qemu in $QEMU_MACHINES; do 22 | QEMU_VMID=$(basename $qemu | cut -d '.' -f 1) 23 | QEMU_MACHINE_NAME=$(cat $qemu|grep name:|awk '{print $2}') 24 | if [ -z "$QEMU_MACHINE_NAME" ]; then 25 | QEMU_MACHINE_NAME="NO-NAME" 26 | fi 27 | echo "QEMU-MACHINE;;;;;$qemu;;;;;$QEMU_MACHINE_NAME" 28 | awk '{print FILENAME, $0}' ${VZDUMP_LOG_DIR}/qemu-${QEMU_VMID}.log \ 29 | | grep -v "INFO: status:" 30 | done 31 | 32 | ###now lxc 33 | 34 | echo '<<>>' 35 | # LXC 36 | LXC_MACHINES=$(find $LXC_SERVER_DIR/ -type f) 37 | for lxc in $LXC_MACHINES; do 38 | LXC_VMID=$(basename $lxc | cut -d '.' -f 1) 39 | LXC_MACHINE_NAME=$(cat $lxc|grep name:|awk '{print $2}') 40 | if [ -z "$LXC_MACHINE_NAME" ]; then 41 | LXC_MACHINE_NAME="NO-NAME" 42 | fi 43 | echo "LXC-MACHINE;;;;;$lxc;;;;;$LXC_MACHINE_NAME" 44 | awk '{print FILENAME, $0}' ${VZDUMP_LOG_DIR}/lxc-${LXC_VMID}.log \ 45 | | grep -v "INFO: status:" 46 | done 47 | 48 | #Running processes 49 | psout=$(ps aux |grep vzdump |grep /bin/sh) 50 | echo "PSOUTPUT $psout" 51 | 52 | -------------------------------------------------------------------------------- /src/local/lib/python3/cmk_addons/plugins/proxmox_qemu_backup/rulesets/proxmox_qemu_backup_rulesets.py: -------------------------------------------------------------------------------- 1 | # Author: Matthias Maderer 2 | # E-Mail: matthias.maderer@web.de 3 | # URL: https://github.com/edvler/check_mk_proxmox-qemu-backup 4 | # License: GPLv2 5 | 6 | from cmk.rulesets.v1 import ( 7 | Title, 8 | ) 9 | from cmk.rulesets.v1.form_specs import ( 10 | DefaultValue, 11 | DictElement, 12 | Dictionary, 13 | InputHint, 14 | LevelDirection, 15 | migrate_to_upper_float_levels, 16 | SimpleLevels, 17 | TimeMagnitude, 18 | TimeSpan, 19 | ) 20 | from cmk.rulesets.v1.rule_specs import ( 21 | CheckParameters, 22 | HostAndItemCondition, 23 | Topic, 24 | ) 25 | 26 | def _migrate_running_time(model): 27 | if isinstance(model, (float,int)): 28 | return ('fixed',(float(model),float(model + 60*60))) #add 60min to create a critical level 29 | return model 30 | 31 | def _parameter_proxmox_qemu_backup(): 32 | return Dictionary( 33 | ignored_elements=("backup_minsize","check_backup"), 34 | elements={ 35 | 'backup_age': DictElement( 36 | required=True, 37 | parameter_form=SimpleLevels( 38 | title = Title('Age of Backup before changing to warn/critical'), 39 | migrate = lambda model: migrate_to_upper_float_levels(model), 40 | level_direction = LevelDirection.UPPER, 41 | form_spec_template = TimeSpan( 42 | displayed_magnitudes=[TimeMagnitude.DAY, TimeMagnitude.HOUR, TimeMagnitude.MINUTE], 43 | ), 44 | prefill_fixed_levels = InputHint( 45 | value=(1.5 * 86400.0, 2 * 86400.0), 46 | ) 47 | ) 48 | ), 49 | 'running_time': DictElement( 50 | required=True, 51 | parameter_form=SimpleLevels( 52 | title = Title('After a runtime of the backup process change to warn/critical (situations in which the backup not completes or hangs)'), 53 | migrate = lambda model: _migrate_running_time(model), 54 | level_direction = LevelDirection.UPPER, 55 | form_spec_template = TimeSpan( 56 | displayed_magnitudes=[TimeMagnitude.DAY, TimeMagnitude.HOUR, TimeMagnitude.MINUTE], 57 | ), 58 | prefill_fixed_levels = DefaultValue( 59 | value=(0.5 * 86400.0, 1 * 86400.0), 60 | ) 61 | ) 62 | ), 63 | } 64 | ) 65 | 66 | rule_spec_urbackup = CheckParameters( 67 | name="proxmox", 68 | topic=Topic.STORAGE, 69 | parameter_form=_parameter_proxmox_qemu_backup, 70 | title=Title("Proxmox Backup Logfile Check"), 71 | condition=HostAndItemCondition(item_title=Title("Proxmox Guest Service item")), 72 | ) -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # [Check MK](https://checkmk.com) Plugin to check [Proxmox](https://www.proxmox.com) VM guest (QEMU) backups 2 | 3 | # Installation 4 | 5 | ## On the Monitoring Server where Check_mk is installed: 6 | For a detailed description how to work with mkp's goto [https://docs.checkmk.com/latest/de/mkps.html](https://docs.checkmk.com/latest/de/mkps.html). 7 | 8 | ### Short tasks 9 | 1. copy the XXXXXX.mkp (see [dist](dist) folder) to your Check_mk server into the /tmp folder. 10 | 2. su - (mkp has to be installed on every site you are running!) 11 | 3. mkp install /tmp/XXXXXX.mkp (replace XXXXXX with the filename downloaded) 12 | 4. Check if installation worked 13 | ``` 14 | SITEUSER@monitoring01:/opt/omd# find . -name '*proxmox_qemu_*' 15 | ./sites/XXXX/local/share/check_mk/checks/proxmox_qemu_backup 16 | ./sites/XXXX/local/share/check_mk/checkman/proxmox_qemu_backup 17 | ./sites/XXXX/local/share/check_mk/web/plugins/wato/check_parameters_proxmox_qemu_backup.py 18 | ./sites/XXXX/local/share/check_mk/agents/plugins/proxmox_qemu_backup 19 | ``` 20 | 5. Goto your Check_mk webinterface. Open "Service Rules" and search for proxmox. 21 | 22 | ## On the Proxmox Server (NOT THE CHECK_MK SERVER!): 23 | 1. Copy the plugin script [check_mk/agents/plugins/proxmox_qemu_backup](check_mk/agents/plugins/proxmox_qemu_backup) into /usr/lib/check_mk_agent/plugins/ 24 | 2. chmod 755 /usr/lib/check_mk_agent/plugins/proxmox_qemu_backup 25 | 3. Execute the script: /usr/lib/check_mk_agent/plugins/proxmox_qemu_backup. If everythings works the output should look like this 26 | ``` 27 | root@pve:/usr/lib/check_mk_agent/plugins# ./proxmox_qemu_backup 28 | <<>> 29 | QEMU-MACHINE;;;;;/etc/pve/qemu-server/103.conf;;;;;machine1 30 | QEMU-MACHINE;;;;;/etc/pve/qemu-server/102.conf;;;;;machine2 31 | QEMU-MACHINE;;;;;/etc/pve/qemu-server/101.conf;;;;;machine3 32 | QEMU-MACHINE;;;;;/etc/pve/qemu-server/105.conf;;;;;machine4 33 | QEMU-MACHINE;;;;;/etc/pve/qemu-server/104.conf;;;;;machine5 34 | /var/log/vzdump/qemu-100.log Jul 12 12:00:01 INFO: Starting Backup of VM 100 (qemu) 35 | /var/log/vzdump/qemu-100.log Jul 12 12:00:01 INFO: status = running 36 | /var/log/vzdump/qemu-100.log Jul 12 12:00:02 INFO: update VM 100: -lock backup 37 | /var/log/vzdump/qemu-100.log Jul 12 12:00:02 INFO: VM Name: machine1 38 | /var/log/vzdump/qemu-100.log Jul 12 12:00:02 INFO: backup mode: snapshot 39 | /var/log/vzdump/qemu-100.log Jul 12 12:00:02 INFO: ionice priority: 7 40 | /var/log/vzdump/qemu-100.log Jul 12 12:00:02 INFO: creating archive '/vmfs/bkp-fs-stor-001/dump/vzdump-qemu-100-2017_07_12-12_00_01.vma.gz' 41 | /var/log/vzdump/qemu-100.log Jul 12 12:00:02 INFO: started backup task '0a8d0864-ffd8-497c-83ae-5422162ca8cd' 42 | /var/log/vzdump/qemu-100.log Jul 12 12:30:31 INFO: transferred 16106 MB in 1829 seconds (8 MB/s) 43 | /var/log/vzdump/qemu-100.log Jul 12 12:30:31 INFO: archive file size: 594MB 44 | /var/log/vzdump/qemu-100.log Jul 12 12:30:31 INFO: delete old backup '/vmfs/bkp-fs-stor-001/dump/vzdump-qemu-100-2017_07_07-12_00_01.vma.gz' 45 | /var/log/vzdump/qemu-100.log Jul 12 12:30:31 INFO: Finished Backup of VM 100 (00:30:30) 46 | /var/log/vzdump/qemu-101.log 2018-02-23 07:40:02 INFO: Starting Backup of VM 101 (qemu) 47 | /var/log/vzdump/qemu-101.log 2018-02-23 07:40:02 INFO: status = running 48 | /var/log/vzdump/qemu-101.log 2018-02-23 07:40:02 INFO: update VM 101: -lock backup 49 | ... 50 | ... 51 | ... 52 | ``` 53 | 54 | ## Functions of the plugin 55 | ![](https://github.com/edvler/check_mk_proxmox-qemu-backup/blob/master/docs/proxmox_qemu_backup_man-page.png) 56 | 57 | ## Services screenshot 58 | ![](https://github.com/edvler/check_mk_proxmox-qemu-backup/blob/master/docs/example-services-screenshot.png) 59 | 60 | 61 | -------------------------------------------------------------------------------- /check_mk/web/plugins/wato/check_parameters_proxmox_qemu_backup.py: -------------------------------------------------------------------------------- 1 | # Author: Matthias Maderer 2 | # E-Mail: edvler@edvler-blog.de 3 | # URL: https://github.com/edvler/check_mk_proxmox-qemu-backup 4 | # License: GPLv2 5 | 6 | from cmk.gui.i18n import _ 7 | from cmk.gui.plugins.wato import ( 8 | HostRulespec, 9 | rulespec_registry, 10 | ) 11 | from cmk.gui.valuespec import ( 12 | DropdownChoice, 13 | ) 14 | #import cmk.utils.version as cmk_version 15 | 16 | register_check_parameters( 17 | RulespecGroupCheckParametersVirtualization, 18 | "proxmox", 19 | _("Proxmox VM guest backup"), 20 | Dictionary( 21 | elements = [ 22 | ("check_backup", 23 | DropdownChoice( 24 | title = _("Enable (default) or disable check of VM guest backup"), 25 | help=_("If disabled is choosen, the check will always return OK. To enable checks of the backup, select enable. This is usefull if you have clients in UrBackup, for which no regular backups are done and you dont want them to be checked."), 26 | choices = [ 27 | ("ignore", _("disable")), 28 | ("check", _("enable")), 29 | ] 30 | ) 31 | ), 32 | ('backup_age', 33 | Tuple(title = "Age of Backup before changing to warn (default 26h) or error (default 30h). This parameters are only used, if modi Backup Age is choosen!", 34 | elements = [ 35 | Age(title=_("Warning at or above backupage"), 36 | default_value = 93600, 37 | help=_("If the backup is older than the specified time, the check changes to warning. (24h=1440m; 26h=1560m)") 38 | ), 39 | Age(title=_("Critical at or above backupage"), 40 | default_value = 108000, 41 | help=_("If the backup is older than the specified time, the check changes to critical. (24h=1440m; 26h=1560m)") 42 | ), 43 | ] 44 | ) 45 | ), 46 | ("backup_minsize", 47 | Tuple( 48 | title = _("Minimal size of vzdump archive"), 49 | elements = [ 50 | Filesize(title = _("Warning if below")), 51 | Filesize(title = _("Critical if below")), 52 | ] 53 | ) 54 | ), 55 | ('running_time', 56 | Age(title=_("Runtime (default 30min) of the backup process"), 57 | default_value = 1800, 58 | help=_("Define here how long the backup process is running. If the Backup is running, the check dont change to warning or error for the specified time. If the backup runs longer as specified here, the check changes to warning.") 59 | ), 60 | ) 61 | ] 62 | ), 63 | TextAscii( 64 | title = _("Description"), 65 | allow_empty = True 66 | ), 67 | match_type = "dict", 68 | ) 69 | 70 | #if cmk_version.is_enterprise_version() or cmk_version.is_managed_version(): 71 | # from cmk.gui.cee.plugins.wato.agent_bakery.rulespecs.utils import ( 72 | # RulespecGroupMonitoringAgentsAgentPlugins, 73 | # ) 74 | # 75 | # 76 | # def _valuespec_proxmox_qemu_backup(): 77 | # return DropdownChoice( 78 | # title = _("Proxmox VE guest backup"), 79 | # help = _( 80 | # "This will deploy the agent plugin proxmox_qemu_backup" 81 | # ), 82 | # choices = [ 83 | # (True, _("Deploy plugin for Proxmox VE guest backups")), 84 | # (False, _("Do not deploy plugin for Proxmox VE guest backups")), 85 | # ] 86 | # ) 87 | # 88 | # rulespec_registry.register( 89 | # HostRulespec( 90 | # group=RulespecGroupMonitoringAgentsAgentPlugins, 91 | # name="agent_config:proxmox_qemu_backup", 92 | # valuespec=_valuespec_proxmox_qemu_backup, 93 | # ) 94 | # ) 95 | 96 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | The GNU General Public License, Version 2, June 1991 (GPLv2) 2 | ============================================================ 3 | 4 | > Copyright (C) 2018, Matthias Maderer (edvler@edvler-blog.de) 5 | 6 | Everyone is permitted to copy and distribute verbatim copies of this license 7 | document, but changing it is not allowed. 8 | 9 | 10 | Preamble 11 | -------- 12 | 13 | The licenses for most software are designed to take away your freedom to share 14 | and change it. By contrast, the GNU General Public License is intended to 15 | guarantee your freedom to share and change free software--to make sure the 16 | software is free for all its users. This General Public License applies to most 17 | of the Free Software Foundation's software and to any other program whose 18 | authors commit to using it. (Some other Free Software Foundation software is 19 | covered by the GNU Lesser General Public License instead.) You can apply it to 20 | your programs, too. 21 | 22 | When we speak of free software, we are referring to freedom, not price. Our 23 | General Public Licenses are designed to make sure that you have the freedom to 24 | distribute copies of free software (and charge for this service if you wish), 25 | that you receive source code or can get it if you want it, that you can change 26 | the software or use pieces of it in new free programs; and that you know you can 27 | do these things. 28 | 29 | To protect your rights, we need to make restrictions that forbid anyone to deny 30 | you these rights or to ask you to surrender the rights. These restrictions 31 | translate to certain responsibilities for you if you distribute copies of the 32 | software, or if you modify it. 33 | 34 | For example, if you distribute copies of such a program, whether gratis or for a 35 | fee, you must give the recipients all the rights that you have. You must make 36 | sure that they, too, receive or can get the source code. And you must show them 37 | these terms so they know their rights. 38 | 39 | We protect your rights with two steps: (1) copyright the software, and (2) offer 40 | you this license which gives you legal permission to copy, distribute and/or 41 | modify the software. 42 | 43 | Also, for each author's protection and ours, we want to make certain that 44 | everyone understands that there is no warranty for this free software. If the 45 | software is modified by someone else and passed on, we want its recipients to 46 | know that what they have is not the original, so that any problems introduced by 47 | others will not reflect on the original authors' reputations. 48 | 49 | Finally, any free program is threatened constantly by software patents. We wish 50 | to avoid the danger that redistributors of a free program will individually 51 | obtain patent licenses, in effect making the program proprietary. To prevent 52 | this, we have made it clear that any patent must be licensed for everyone's free 53 | use or not licensed at all. 54 | 55 | The precise terms and conditions for copying, distribution and modification 56 | follow. 57 | 58 | 59 | Terms And Conditions For Copying, Distribution And Modification 60 | --------------------------------------------------------------- 61 | 62 | **0.** This License applies to any program or other work which contains a notice 63 | placed by the copyright holder saying it may be distributed under the terms of 64 | this General Public License. The "Program", below, refers to any such program or 65 | work, and a "work based on the Program" means either the Program or any 66 | derivative work under copyright law: that is to say, a work containing the 67 | Program or a portion of it, either verbatim or with modifications and/or 68 | translated into another language. (Hereinafter, translation is included without 69 | limitation in the term "modification".) Each licensee is addressed as "you". 70 | 71 | Activities other than copying, distribution and modification are not covered by 72 | this License; they are outside its scope. The act of running the Program is not 73 | restricted, and the output from the Program is covered only if its contents 74 | constitute a work based on the Program (independent of having been made by 75 | running the Program). Whether that is true depends on what the Program does. 76 | 77 | **1.** You may copy and distribute verbatim copies of the Program's source code 78 | as you receive it, in any medium, provided that you conspicuously and 79 | appropriately publish on each copy an appropriate copyright notice and 80 | disclaimer of warranty; keep intact all the notices that refer to this License 81 | and to the absence of any warranty; and give any other recipients of the Program 82 | a copy of this License along with the Program. 83 | 84 | You may charge a fee for the physical act of transferring a copy, and you may at 85 | your option offer warranty protection in exchange for a fee. 86 | 87 | **2.** You may modify your copy or copies of the Program or any portion of it, 88 | thus forming a work based on the Program, and copy and distribute such 89 | modifications or work under the terms of Section 1 above, provided that you also 90 | meet all of these conditions: 91 | 92 | * **a)** You must cause the modified files to carry prominent notices stating 93 | that you changed the files and the date of any change. 94 | 95 | * **b)** You must cause any work that you distribute or publish, that in whole 96 | or in part contains or is derived from the Program or any part thereof, to 97 | be licensed as a whole at no charge to all third parties under the terms of 98 | this License. 99 | 100 | * **c)** If the modified program normally reads commands interactively when 101 | run, you must cause it, when started running for such interactive use in the 102 | most ordinary way, to print or display an announcement including an 103 | appropriate copyright notice and a notice that there is no warranty (or 104 | else, saying that you provide a warranty) and that users may redistribute 105 | the program under these conditions, and telling the user how to view a copy 106 | of this License. (Exception: if the Program itself is interactive but does 107 | not normally print such an announcement, your work based on the Program is 108 | not required to print an announcement.) 109 | 110 | These requirements apply to the modified work as a whole. If identifiable 111 | sections of that work are not derived from the Program, and can be reasonably 112 | considered independent and separate works in themselves, then this License, and 113 | its terms, do not apply to those sections when you distribute them as separate 114 | works. But when you distribute the same sections as part of a whole which is a 115 | work based on the Program, the distribution of the whole must be on the terms of 116 | this License, whose permissions for other licensees extend to the entire whole, 117 | and thus to each and every part regardless of who wrote it. 118 | 119 | Thus, it is not the intent of this section to claim rights or contest your 120 | rights to work written entirely by you; rather, the intent is to exercise the 121 | right to control the distribution of derivative or collective works based on the 122 | Program. 123 | 124 | In addition, mere aggregation of another work not based on the Program with the 125 | Program (or with a work based on the Program) on a volume of a storage or 126 | distribution medium does not bring the other work under the scope of this 127 | License. 128 | 129 | **3.** You may copy and distribute the Program (or a work based on it, under 130 | Section 2) in object code or executable form under the terms of Sections 1 and 2 131 | above provided that you also do one of the following: 132 | 133 | * **a)** Accompany it with the complete corresponding machine-readable source 134 | code, which must be distributed under the terms of Sections 1 and 2 above on 135 | a medium customarily used for software interchange; or, 136 | 137 | * **b)** Accompany it with a written offer, valid for at least three years, to 138 | give any third party, for a charge no more than your cost of physically 139 | performing source distribution, a complete machine-readable copy of the 140 | corresponding source code, to be distributed under the terms of Sections 1 141 | and 2 above on a medium customarily used for software interchange; or, 142 | 143 | * **c)** Accompany it with the information you received as to the offer to 144 | distribute corresponding source code. (This alternative is allowed only for 145 | noncommercial distribution and only if you received the program in object 146 | code or executable form with such an offer, in accord with Subsection b 147 | above.) 148 | 149 | The source code for a work means the preferred form of the work for making 150 | modifications to it. For an executable work, complete source code means all the 151 | source code for all modules it contains, plus any associated interface 152 | definition files, plus the scripts used to control compilation and installation 153 | of the executable. However, as a special exception, the source code distributed 154 | need not include anything that is normally distributed (in either source or 155 | binary form) with the major components (compiler, kernel, and so on) of the 156 | operating system on which the executable runs, unless that component itself 157 | accompanies the executable. 158 | 159 | If distribution of executable or object code is made by offering access to copy 160 | from a designated place, then offering equivalent access to copy the source code 161 | from the same place counts as distribution of the source code, even though third 162 | parties are not compelled to copy the source along with the object code. 163 | 164 | **4.** You may not copy, modify, sublicense, or distribute the Program except as 165 | expressly provided under this License. Any attempt otherwise to copy, modify, 166 | sublicense or distribute the Program is void, and will automatically terminate 167 | your rights under this License. However, parties who have received copies, or 168 | rights, from you under this License will not have their licenses terminated so 169 | long as such parties remain in full compliance. 170 | 171 | **5.** You are not required to accept this License, since you have not signed 172 | it. However, nothing else grants you permission to modify or distribute the 173 | Program or its derivative works. These actions are prohibited by law if you do 174 | not accept this License. Therefore, by modifying or distributing the Program (or 175 | any work based on the Program), you indicate your acceptance of this License to 176 | do so, and all its terms and conditions for copying, distributing or modifying 177 | the Program or works based on it. 178 | 179 | **6.** Each time you redistribute the Program (or any work based on the 180 | Program), the recipient automatically receives a license from the original 181 | licensor to copy, distribute or modify the Program subject to these terms and 182 | conditions. You may not impose any further restrictions on the recipients' 183 | exercise of the rights granted herein. You are not responsible for enforcing 184 | compliance by third parties to this License. 185 | 186 | **7.** If, as a consequence of a court judgment or allegation of patent 187 | infringement or for any other reason (not limited to patent issues), conditions 188 | are imposed on you (whether by court order, agreement or otherwise) that 189 | contradict the conditions of this License, they do not excuse you from the 190 | conditions of this License. If you cannot distribute so as to satisfy 191 | simultaneously your obligations under this License and any other pertinent 192 | obligations, then as a consequence you may not distribute the Program at all. 193 | For example, if a patent license would not permit royalty-free redistribution of 194 | the Program by all those who receive copies directly or indirectly through you, 195 | then the only way you could satisfy both it and this License would be to refrain 196 | entirely from distribution of the Program. 197 | 198 | If any portion of this section is held invalid or unenforceable under any 199 | particular circumstance, the balance of the section is intended to apply and the 200 | section as a whole is intended to apply in other circumstances. 201 | 202 | It is not the purpose of this section to induce you to infringe any patents or 203 | other property right claims or to contest validity of any such claims; this 204 | section has the sole purpose of protecting the integrity of the free software 205 | distribution system, which is implemented by public license practices. Many 206 | people have made generous contributions to the wide range of software 207 | distributed through that system in reliance on consistent application of that 208 | system; it is up to the author/donor to decide if he or she is willing to 209 | distribute software through any other system and a licensee cannot impose that 210 | choice. 211 | 212 | This section is intended to make thoroughly clear what is believed to be a 213 | consequence of the rest of this License. 214 | 215 | **8.** If the distribution and/or use of the Program is restricted in certain 216 | countries either by patents or by copyrighted interfaces, the original copyright 217 | holder who places the Program under this License may add an explicit 218 | geographical distribution limitation excluding those countries, so that 219 | distribution is permitted only in or among countries not thus excluded. In such 220 | case, this License incorporates the limitation as if written in the body of this 221 | License. 222 | 223 | **9.** The Free Software Foundation may publish revised and/or new versions of 224 | the General Public License from time to time. Such new versions will be similar 225 | in spirit to the present version, but may differ in detail to address new 226 | problems or concerns. 227 | 228 | Each version is given a distinguishing version number. If the Program specifies 229 | a version number of this License which applies to it and "any later version", 230 | you have the option of following the terms and conditions either of that version 231 | or of any later version published by the Free Software Foundation. If the 232 | Program does not specify a version number of this License, you may choose any 233 | version ever published by the Free Software Foundation. 234 | 235 | **10.** If you wish to incorporate parts of the Program into other free programs 236 | whose distribution conditions are different, write to the author to ask for 237 | permission. For software which is copyrighted by the Free Software Foundation, 238 | write to the Free Software Foundation; we sometimes make exceptions for this. 239 | Our decision will be guided by the two goals of preserving the free status of 240 | all derivatives of our free software and of promoting the sharing and reuse of 241 | software generally. 242 | 243 | 244 | No Warranty 245 | ----------- 246 | 247 | **11.** BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR 248 | THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE 249 | STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM 250 | "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, 251 | BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A 252 | PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE 253 | PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF 254 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 255 | 256 | **12.** IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 257 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE 258 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY 259 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR 260 | INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA 261 | BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A 262 | FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER 263 | OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. 264 | 265 | -------------------------------------------------------------------------------- /check_mk/checks/proxmox_lxc_backup: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | 3 | 4 | # Author: Matthias Maderer 5 | # E-Mail: edvler@edvler-blog.de 6 | # URL: https://github.com/edvler/check_mk_proxmox-lxc-backup 7 | # License: GPLv2 8 | 9 | 10 | # default parameters 11 | proxmox_lxc_backup_default_levels = {'check_backup': 'check', 'backup_age': (93600, 108000), 'running_time': 1800} 12 | 13 | # the inventory function (dummy) 14 | def inventory_lxc_backup(info): 15 | # loop over all output lines of the agent 16 | for line in info: 17 | if line[0].startswith('LXC-MACHINE;;;;;'): 18 | arr_lxc_vars = line[0].split(';;;;;') 19 | arr_lxc_id = arr_lxc_vars[1].split('/') 20 | lxc_id = arr_lxc_id[-1].replace('.conf','') 21 | yield arr_lxc_vars[2] + " Id: " + lxc_id + "", "proxmox_lxc_backup_default_levels" 22 | 23 | # the check function (dummy) 24 | def check_lxc_backup(item, params, info): 25 | #return 0 if check of backups should not be done 26 | if params['check_backup'] == 'ignore': 27 | # return 0, 'check disabled by rule' 28 | yield 0, 'check disabled by rule' 29 | return 30 | 31 | 32 | 33 | #get name of the logfile (the output of each logfile is 34 | #prefixed with its filename from the plugin) 35 | lxc_id=item.split(' ')[-1] 36 | logfile = '/var/log/vzdump/lxc-' + lxc_id + '.log' 37 | 38 | # ft=time.strftime("-%Y-%m-%d_%H%M%S") 39 | # f=open(os.getenv("OMD_ROOT") + '/tmp/' + lxc_id + ft + ".info_agent" , 'w') 40 | # for item in info: 41 | # f.write("%s\n" % item) 42 | # f.close() 43 | 44 | #counter 45 | line_count=0 46 | warn_count=0 47 | warn_msg="" 48 | error_count=0 49 | error_msg="" 50 | 51 | archive="nothing" 52 | finished="nothing" 53 | started="nothing" 54 | file_created="nothing" 55 | incremental=False 56 | 57 | vzdump_is_running = 0 58 | 59 | offset=0 60 | 61 | #check all lines 62 | for line in info: 63 | #Check for running tasks 64 | #task UPID:pve01:00000E8D:009D1950:5E344CAA:vzdump:101:root@pam: 65 | if line[0] == 'PSOUTPUT': 66 | #taskinfos = line[1].split(":") 67 | #if taskinfos[6] == lxc_id: 68 | # vzdump_is_running = 1 69 | for x in line: 70 | if x == lxc_id: 71 | vzdump_is_running = 1 72 | 73 | #is this line of the given item (lxc_id) 74 | if line[0] == logfile: 75 | line_count += 1 #count lines of log for this id 76 | 77 | #old or new dateformat in logfile? 78 | #old /var/log/vzdump/lxc-104.log Feb 07 12:10:54 INFO: creating archive '/vmfs/bkp-fs-stor-001/dump/vzdump-lxc-104-2018_02_07-12_10_54.vma.gz' 79 | #new /var/log/vzdump/lxc-105.log 2018-02-06 16:00:03 INFO: creating archive '/vmfs/bkp-urbackup01-001/dump/vzdump-lxc-105-2018_02_06-16_00_02.vma.gz' 80 | d = "" 81 | try: 82 | d = time.strptime(line[1] + ' ' + line[2],"%Y-%m-%d %H:%M:%S") 83 | offset=0 84 | except ValueError: 85 | try: 86 | d = time.strptime(time.strftime("%Y",time.localtime()) + ' ' + line[1] + ' ' + line[2] + ' ' + line[3],"%Y %b %d %H:%M:%S") 87 | offset=1 88 | except ValueError: 89 | pass 90 | 91 | try: 92 | #extract several infos 93 | #proxmox 6.2-9 introduced a new log-format 94 | if line[offset+5] == 'vzdump': 95 | if line[offset+3] + ' ' + line[offset+4] + ' ' + line[offset+5] + ' ' + line[offset+6] == 'INFO: creating vzdump archive': 96 | file_created = line 97 | startdate = getDateFromFileCreated(file_created[offset+7].split("/")[-1]) 98 | #Proxmox Backup Server 99 | if line[offset+5] + ' ' + line[offset+6] + ' ' + line[offset+7] == 'Proxmox Backup Server': 100 | if line[offset+3] + ' ' + line[offset+4] + ' ' + line[offset+5] + ' ' + line[offset+6] + ' ' + line[offset+7] + ' ' + line[offset+8] == 'INFO: creating Proxmox Backup Server archive': 101 | file_created = line 102 | startdate = getDateFromFileCreated(file_created[offset+9].split("/")[-1]) 103 | else: 104 | if line[offset+3] + ' ' + line[offset+4] + ' ' + line[offset+5] == 'INFO: creating archive': 105 | file_created = line 106 | startdate = getDateFromFileCreated(file_created[offset+6].split("/")[-1]) 107 | 108 | if line[offset+3] + ' ' + line[offset+4] + ' ' + line[offset+5] + ' ' + line[offset+6] == 'INFO: archive file size:': 109 | archive = line 110 | #we have no archive here, only reused and transfered 111 | #root.pxar:', u'had', u'to', u'upload', u'585.86', u'MiB', u'of', u'5.95', u'GiB', u'in', u'60.17s,', u'average', u'speed', u'9.74', u'MiB/s).'] 112 | if line[offset+3] + ' ' + line[offset+4] + ' ' + line[offset+5] + ' ' + line[offset+6] + ' ' + line[offset+7] == 'INFO: root.pxar: had to upload': 113 | archive = line 114 | if line[offset+3] + ' ' + line[offset+4] + ' ' + line[offset+5] + ' ' + line[offset+6] + ' ' + line[offset+7] == 'INFO: root.pxar: had to backup': 115 | archive = line 116 | if 'incrementally,' in line: 117 | incremental = True 118 | size, size_unit = '0', 'B' 119 | if line[offset+3] + ' ' + line[offset+4] + ' ' + line[offset+5] + ' ' + line[offset+6] + ' ' + line[offset+7] == 'INFO: Starting Backup of VM': 120 | started = line 121 | started_datetime = d 122 | 123 | if line[offset+3] + ' ' + line[offset+4] + ' ' + line[offset+5] + ' ' + line[offset+6] + ' ' + line[offset+7] == 'INFO: Finished Backup of VM': 124 | finished = line 125 | 126 | except IndexError: 127 | pass 128 | 129 | #search for keywords 130 | for content in line: 131 | if 'warn' in content.lower(): 132 | warn_count += 1 133 | warn_msg += " ".join(line[offset+3:]) + "; " 134 | elif 'error' in content.lower() or 'fail' in content.lower(): 135 | error_count += 1 136 | error_msg += " ".join(line[offset+3:]) + "; " 137 | 138 | #if line_count is 0, no backup file exists --> error! 139 | if line_count == 0: 140 | yield 2, "no backup exists for this VM guest" 141 | return 142 | 143 | #check counter 144 | if error_count > 0: 145 | yield 2, error_msg 146 | return 147 | if warn_count > 0: 148 | yield 1, warn_msg 149 | return 150 | #no warnings and erros!! check if lines indicating a successfull backup exists 151 | if (archive != "nothing" or incremental) and finished != "nothing" and started != "nothing" and file_created != "nothing": 152 | 153 | warn, error = params['backup_age'] 154 | 155 | # Age of Backup 156 | old = time.time() - time.mktime(startdate) 157 | duration_formatted = pretty_time_delta(old) 158 | infotext = 'last backup: ' + time.strftime("%Y-%m-%d %H:%M", startdate) + ' (Age: ' + duration_formatted + ' warn/crit at ' + pretty_time_delta(warn) + '/' + pretty_time_delta(error) + ')' 159 | 160 | # Example sizes 161 | #lxc-100.log:Aug 21 05:01:31 INFO: archive file size: 594MB 162 | #lxc-101.log:Jun 12 05:08:59 INFO: archive file size: 3.94GB 163 | #lxc-102.log:Jun 12 05:09:00 INFO: archive file size: 0KB 164 | #lxc-104.log:Jun 12 05:09:00 INFO: archive file size: 0KB 165 | #lxc-105.log:Jun 12 05:10:58 INFO: archive file size: 832MB 166 | #lxc-106.log:Jun 12 05:19:39 INFO: archive file size: 3.84GB 167 | warn_size = 0 168 | error_size = 0 169 | if 'backup_minsize' in params: 170 | warn_size, error_size = params['backup_minsize'] 171 | if archive[offset+4] == "archive": 172 | size = archive[offset+7] 173 | size_unit = size[-2:] 174 | if archive[offset+3] + ' ' + archive[offset+4] + ' ' + archive[offset+5] + ' ' + archive[offset+6] + ' ' + archive[offset+7] == 'INFO: root.pxar: had to upload': 175 | size = archive[offset+8] 176 | size_unit = archive[offset+9] 177 | if archive[offset+3] + ' ' + archive[offset+4] + ' ' + archive[offset+5] + ' ' + archive[offset+6] + ' ' + archive[offset+7] == 'INFO: root.pxar: had to backup': 178 | size = archive[offset+8] 179 | size_unit = archive[offset+9] 180 | size_numbers = float(size[:len(size)-2]) 181 | size_cal = -1 182 | 183 | # Norm to Byte 184 | # .../share/check_mk/web/plugins/metrics/check_mk.py 185 | if size_unit == "TB": 186 | size_cal = size_numbers*1024*1024*1024*1024 187 | if size_unit == "GB": 188 | size_cal = size_numbers*1024*1024*1024 189 | if size_unit == "MB": 190 | size_cal = size_numbers*1024*1024 191 | if size_unit == "KB": 192 | size_cal = size_numbers*1024 193 | if size_unit == "TiB": 194 | size_cal = size_numbers*1000*1000*1000*1000 195 | if size_unit == "GiB": 196 | size_cal = size_numbers*1000*1000*1000 197 | if size_unit == "MiB": 198 | size_cal = size_numbers*1000*1000 199 | if size_unit == "KiB": 200 | size_cal = size_numbers*1000 201 | # metrics from .../share/check_mk/web/plugins/metrics/check_mk.py 202 | perfdata = [ 203 | ( "backup_age", int(old), warn, error ), 204 | ( "file_size", int(size_cal), warn_size, error_size ), 205 | ] 206 | 207 | if old < warn: 208 | yield 0, infotext, perfdata 209 | if old >= warn and old < error: 210 | yield 1, infotext, perfdata 211 | if old >= error: 212 | yield 2, infotext, perfdata 213 | 214 | if archive[offset+4] == "archive": 215 | size_infotext = "Archive size: " + str(size_numbers) + ' ' + size_unit 216 | elif archive[offset+3] + ' ' + archive[offset+4] + ' ' + archive[offset+5] + ' ' + archive[offset+6] + ' ' + archive[offset+7] == 'INFO: root.pxar: had to upload': 217 | size_infotext = "upload size: " + str(size_numbers) + ' ' + size_unit 218 | elif archive[offset+3] + ' ' + archive[offset+4] + ' ' + archive[offset+5] + ' ' + archive[offset+6] + ' ' + archive[offset+7] == 'INFO: root.pxar: had to backup': 219 | size_infotext = "upload size: " + str(size_numbers) + ' ' + size_unit 220 | else: 221 | size_infotext = "empty incremental backup" 222 | 223 | if size_cal >= warn_size or incremental: 224 | yield 0, size_infotext, perfdata 225 | elif size_cal < warn_size and size_cal >= error_size: 226 | yield 1, size_infotext, perfdata 227 | elif size_cal < error_size: 228 | yield 2, size_infotext, perfdata 229 | 230 | return 231 | elif started != "nothing": 232 | vzdump_is_running = 1 233 | 234 | #is backup currently running? 235 | if vzdump_is_running == 1: 236 | old = time.time() - time.mktime(started_datetime) 237 | if old < params['running_time']: 238 | yield 0, 'backup is running since: ' + time.strftime("%Y-%m-%d %H:%M", started_datetime) 239 | return 240 | else: 241 | yield 1, 'backup is running since: ' + time.strftime("%Y-%m-%d %H:%M", started_datetime) 242 | return 243 | 244 | yield 3, "error occured in check plugin. Please post a issue on https://github.com/edvler/check_mk_proxmox-lxc-backup/issues inlcuding the output of the agent plugin /usr/lib/check_mk_agent/plugins/proxmox-lxc-backup" 245 | return 246 | 247 | # declare the check to Check_MK 248 | check_info["proxmox_lxc_backup"] = { 249 | 'check_function': check_lxc_backup, 250 | 'inventory_function': inventory_lxc_backup, 251 | 'service_description': 'Proxmox LXC VM backup %s', 252 | 'group': 'proxmox', 253 | 'has_perfdata': True, 254 | } 255 | 256 | def getDateFromFileCreated(vma_name): 257 | if "T" in vma_name: 258 | p = re.compile("([0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2})") 259 | m = p.search(vma_name) 260 | d = time.strptime(m.group(1),"%Y-%m-%dT%H:%M:%S") 261 | else: 262 | if "differential" in vma_name: 263 | p = re.compile("differential-(20[0-9][0-9]_[0-9][0-9]_[0-9][0-9]-[0-9][0-9]_[0-9][0-9]_[0-9][0-9])") 264 | else: 265 | p = re.compile("(20[0-9][0-9]_[0-9][0-9]_[0-9][0-9]-[0-9][0-9]_[0-9][0-9]_[0-9][0-9])") 266 | m = p.search(vma_name) 267 | d = time.strptime(m.group(1),"%Y_%m_%d-%H_%M_%S") 268 | return d 269 | # p = re.compile("(20[0-9][0-9]_[0-9][0-9]_[0-9][0-9]-[0-9][0-9]_[0-9][0-9]_[0-9][0-9])") 270 | # m = p.search(vma_name) 271 | # d = time.strptime(m.group(1),"%Y_%m_%d-%H_%M_%S") 272 | # return d 273 | 274 | #thanks to https://gist.github.com/thatalextaylor/7408395 275 | def pretty_time_delta(seconds): 276 | sign_string = '-' if seconds < 0 else '' 277 | seconds = abs(int(seconds)) 278 | days, seconds = divmod(seconds, 86400) 279 | hours, seconds = divmod(seconds, 3600) 280 | minutes, seconds = divmod(seconds, 60) 281 | if days > 0: 282 | return '%s%dd %dh %dm' % (sign_string, days, hours, minutes) 283 | elif hours > 0: 284 | return '%s%dh %dm' % (sign_string, hours, minutes) 285 | elif minutes > 0: 286 | return '%s%dm' % (sign_string, minutes) 287 | else: 288 | return '0m' 289 | 290 | #Example output of agent 291 | # 292 | #root@pve01:/usr/lib/check_mk_agent/plugins# ./proxmox_lxc_backup 293 | #<<>> 294 | #LXC-MACHINE;;;;;/etc/pve/lxc-server/103.conf;;;;;server01-hlds 295 | #LXC-MACHINE;;;;;/etc/pve/lxc-server/102.conf;;;;;firewall01 296 | #lXC-MACHINE;;;;;/etc/pve/lxc-server/108.conf;;;;;monitoring01 297 | #lXC-MACHINE;;;;;/etc/pve/lxc-server/101.conf;;;;;guacamole01 298 | #lXC-MACHINE;;;;;/etc/pve/lxc-server/100.conf;;;;;pfsense01 299 | #lXC-MACHINE;;;;;/etc/pve/lxc-server/106.conf;;;;;server02 300 | #lXC-MACHINE;;;;;/etc/pve/lxc-server/105.conf;;;;;urbackup01 301 | #lXC-MACHINE;;;;;/etc/pve/lxc-server/104.conf;;;;;zbox 302 | #task UPID:pve01:000031A4:009F1CF0:5E3451D2:vzdump:108:root@pam: 303 | #/var/log/vzdump/lxc-100.log 2017-09-05 11:45:02 INFO: Starting Backup of VM 100 (lxc) 304 | #/var/log/vzdump/lxc-100.log 2017-09-05 11:45:02 INFO: status = stopped 305 | #/var/log/vzdump/lxc-100.log 2017-09-05 11:45:02 INFO: update VM 100: -lock backup 306 | #/var/log/vzdump/lxc-100.log 2017-09-05 11:45:02 INFO: backup mode: stop 307 | #/var/log/vzdump/lxc-100.log 2017-09-05 11:45:02 INFO: ionice priority: 7 308 | #/var/log/vzdump/lxc-100.log 2017-09-05 11:45:02 INFO: VM Name: pfsense01 309 | #/var/log/vzdump/lxc-100.log 2017-09-05 11:45:02 INFO: include disk 'virtio0' 'WDC15EADS-tpool-001:vm-100-disk-1' 32G 310 | #/var/log/vzdump/lxc-100.log 2017-09-05 11:45:04 INFO: creating archive '/vmfs/bkp-vol-001/dump/vzdump-lxc-100-2017_09_05-11_45_02.vma.gz' 311 | #/var/log/vzdump/lxc-100.log 2017-09-05 11:45:04 INFO: starting kvm to execute backup task 312 | #/var/log/vzdump/lxc-100.log 2017-09-05 11:45:06 INFO: started backup task 'bb24a1d8-e70a-4cda-a10e-86adb9dab94d' 313 | #/var/log/vzdump/lxc-100.log 2017-09-05 11:46:35 INFO: transferred 34359 MB in 89 seconds (386 MB/s) 314 | #/var/log/vzdump/lxc-100.log 2017-09-05 11:46:35 INFO: stopping kvm after backup task 315 | #/var/log/vzdump/lxc-100.log 2017-09-05 11:46:36 INFO: archive file size: 686MB 316 | #/var/log/vzdump/lxc-100.log 2017-09-05 11:46:36 INFO: Finished Backup of VM 100 (00:01:34) 317 | #/var/log/vzdump/lxc-101.log Apr 06 11:46:34 INFO: Starting Backup of VM 101 (lxc) 318 | #/var/log/vzdump/lxc-101.log Apr 06 11:46:34 INFO: status = stopped 319 | #/var/log/vzdump/lxc-101.log Apr 06 11:46:34 INFO: update VM 101: -lock backup 320 | #/var/log/vzdump/lxc-101.log Apr 06 11:46:35 INFO: backup mode: stop 321 | #/var/log/vzdump/lxc-101.log Apr 06 11:46:35 INFO: ionice priority: 7 322 | #/var/log/vzdump/lxc-101.log Apr 06 11:46:35 INFO: VM Name: guacamole01 323 | #/var/log/vzdump/lxc-101.log Apr 06 11:46:35 INFO: include disk 'sata0' 'WDC15EADS-tpool-001:vm-101-disk-1' 324 | #/var/log/vzdump/lxc-101.log Apr 06 11:46:35 INFO: creating archive '/vmfs/usbbac001-fs-backup-001/dump/vzdump-lxc-101-2017_04_06-11_46_34.vma.gz' 325 | #/var/log/vzdump/lxc-101.log Apr 06 11:46:35 INFO: starting kvm to execute backup task 326 | #/var/log/vzdump/lxc-101.log Apr 06 11:46:38 INFO: started backup task '78127b22-7948-4555-8c48-10b8f3d01ce5' 327 | #/var/log/vzdump/lxc-101.log Apr 06 11:59:11 INFO: transferred 54760 MB in 753 seconds (72 MB/s) 328 | #/var/log/vzdump/lxc-101.log Apr 06 11:59:11 INFO: stopping kvm after backup task 329 | #/var/log/vzdump/lxc-101.log Apr 06 11:59:12 INFO: archive file size: 1.41GB 330 | #/var/log/vzdump/lxc-101.log Apr 06 11:59:12 INFO: delete old backup '/vmfs/usbbac001-fs-backup-001/dump/vzdump-lxc-101-2017_03_14-11_46_37.vma.gz' 331 | #/var/log/vzdump/lxc-101.log Apr 06 11:59:13 INFO: Finished Backup of VM 101 (00:12:39) 332 | #/var/log/vzdump/lxc-102.log 2017-09-05 11:46:36 INFO: Starting Backup of VM 102 (lxc) 333 | #/var/log/vzdump/lxc-102.log 2017-09-05 11:46:36 INFO: status = stopped 334 | #/var/log/vzdump/lxc-102.log 2017-09-05 11:46:36 INFO: update VM 102: -lock backup 335 | #/var/log/vzdump/lxc-102.log 2017-09-05 11:46:36 INFO: backup mode: stop 336 | #/var/log/vzdump/lxc-102.log 2017-09-05 11:46:36 INFO: ionice priority: 7 337 | #/var/log/vzdump/lxc-102.log 2017-09-05 11:46:36 INFO: VM Name: firewall01 338 | #/var/log/vzdump/lxc-102.log 2017-09-05 11:46:36 INFO: include disk 'sata0' 'ssd-850evo-tpool-001:vm-102-disk-2' 9G 339 | #/var/log/vzdump/lxc-102.log 2017-09-05 11:46:36 INFO: creating archive '/vmfs/bkp-vol-001/dump/vzdump-lxc-102-2017_09_05-11_46_36.vma.gz' 340 | #/var/log/vzdump/lxc-102.log 2017-09-05 11:46:36 INFO: starting kvm to execute backup task 341 | #/var/log/vzdump/lxc-102.log 2017-09-05 11:46:38 INFO: started backup task '0ca8bbd7-65cb-4443-8743-0f2074fa736d' 342 | #/var/log/vzdump/lxc-102.log 2017-09-05 11:50:29 INFO: transferred 9663 MB in 231 seconds (41 MB/s) 343 | #/var/log/vzdump/lxc-102.log 2017-09-05 11:50:29 INFO: stopping kvm after backup task 344 | #/var/log/vzdump/lxc-102.log 2017-09-05 11:50:30 INFO: archive file size: 1.95GB 345 | #/var/log/vzdump/lxc-102.log 2017-09-05 11:50:30 INFO: Finished Backup of VM 102 (00:03:54) 346 | #/var/log/vzdump/lxc-103.log 2017-09-05 11:50:30 INFO: Starting Backup of VM 103 (lxc) 347 | #/var/log/vzdump/lxc-103.log 2017-09-05 11:50:30 INFO: status = stopped 348 | #/var/log/vzdump/lxc-103.log 2017-09-05 11:50:31 INFO: update VM 103: -lock backup 349 | #/var/log/vzdump/lxc-103.log 2017-09-05 11:50:31 INFO: backup mode: stop 350 | #/var/log/vzdump/lxc-103.log 2017-09-05 11:50:31 INFO: ionice priority: 7 351 | #/var/log/vzdump/lxc-103.log 2017-09-05 11:50:31 INFO: VM Name: server01-hlds 352 | #/var/log/vzdump/lxc-103.log 2017-09-05 11:50:31 INFO: include disk 'sata0' 'WDC15EADS-tpool-001:vm-103-disk-2' 101G 353 | #/var/log/vzdump/lxc-103.log 2017-09-05 11:50:33 INFO: creating archive '/vmfs/bkp-vol-001/dump/vzdump-lxc-103-2017_09_05-11_50_30.vma.gz' 354 | #/var/log/vzdump/lxc-103.log 2017-09-05 11:50:33 INFO: starting kvm to execute backup task 355 | #/var/log/vzdump/lxc-103.log 2017-09-05 11:50:36 INFO: started backup task 'fe948ba6-3b3a-4737-b9c2-1419864e6fe4' 356 | #/var/log/vzdump/lxc-103.log 2017-09-05 13:02:25 INFO: transferred 108447 MB in 4309 seconds (25 MB/s) 357 | #/var/log/vzdump/lxc-103.log 2017-09-05 13:02:25 INFO: stopping kvm after backup task 358 | #/var/log/vzdump/lxc-103.log 2017-09-05 13:02:28 INFO: archive file size: 33.09GB 359 | #/var/log/vzdump/lxc-103.log 2017-09-05 13:02:28 INFO: Finished Backup of VM 103 (01:11:58) 360 | #/var/log/vzdump/lxc-104.log 2018-02-22 14:11:02 INFO: Starting Backup of VM 104 (lxc) 361 | #/var/log/vzdump/lxc-104.log 2018-02-22 14:11:02 INFO: status = running 362 | #/var/log/vzdump/lxc-104.log 2018-02-22 14:11:03 INFO: update VM 104: -lock backup 363 | #/var/log/vzdump/lxc-104.log 2018-02-22 14:11:03 INFO: VM Name: zbox 364 | #/var/log/vzdump/lxc-104.log 2018-02-22 14:11:03 INFO: exclude disk 'virtio0' 'ssd-850evo-tpool-001:vm-104-disk-1' (backup=no) 365 | #/var/log/vzdump/lxc-104.log 2018-02-22 14:11:03 INFO: exclude disk 'virtio1' 'ST2000DM-tpool-001:vm-104-disk-4' (backup=no) 366 | #/var/log/vzdump/lxc-104.log 2018-02-22 14:11:03 INFO: exclude disk 'virtio2' 'ST2000DM-tpool-001:vm-104-disk-1' (backup=no) 367 | #/var/log/vzdump/lxc-104.log 2018-02-22 14:11:03 INFO: exclude disk 'virtio3' 'ST2000DM-tpool-001:vm-104-disk-2' (backup=no) 368 | #/var/log/vzdump/lxc-104.log 2018-02-22 14:11:03 INFO: exclude disk 'virtio15' 'bkp-zbox-wss-001:104/vm-104-disk-1.raw' (backup=no) 369 | #/var/log/vzdump/lxc-104.log 2018-02-22 14:11:03 INFO: backup mode: snapshot 370 | #/var/log/vzdump/lxc-104.log 2018-02-22 14:11:03 INFO: ionice priority: 7 371 | #/var/log/vzdump/lxc-104.log 2018-02-22 14:11:03 INFO: pending configuration changes found (not included into backup) 372 | #/var/log/vzdump/lxc-104.log 2018-02-22 14:11:03 INFO: creating archive '/vmfs/bkp-vol-001/dump/vzdump-lxc-104-2018_02_22-14_11_02.vma.gz' 373 | #/var/log/vzdump/lxc-104.log 2018-02-22 14:11:03 INFO: backup contains no disks 374 | #/var/log/vzdump/lxc-104.log 2018-02-22 14:11:03 INFO: starting template backup 375 | #/var/log/vzdump/lxc-104.log 2018-02-22 14:11:03 INFO: /usr/bin/vma create -v -c /vmfs/bkp-vol-001/dump/vzdump-lxc-104-2018_02_22-14_11_02.tmp/lxc-server.conf exec:gzip > /vmfs/bkp-vol-001/dump/vzdump-lxc-104-2018_02_22-14_11_02.vma.dat 376 | #/var/log/vzdump/lxc-104.log 2018-02-22 14:11:04 INFO: archive file size: 0KB 377 | #/var/log/vzdump/lxc-104.log 2018-02-22 14:11:04 INFO: delete old backup '/vmfs/bkp-vol-001/dump/vzdump-lxc-104-2018_02_13-14_11_02.vma.gz' 378 | #/var/log/vzdump/lxc-104.log 2018-02-22 14:11:04 INFO: Finished Backup of VM 104 (00:00:02) 379 | #/var/log/vzdump/lxc-105.log 2018-02-22 16:00:02 INFO: Starting Backup of VM 105 (lxc) 380 | #/var/log/vzdump/lxc-105.log 2018-02-22 16:00:02 INFO: status = running 381 | #/var/log/vzdump/lxc-105.log 2018-02-22 16:00:02 INFO: update VM 105: -lock backup 382 | #/var/log/vzdump/lxc-105.log 2018-02-22 16:00:02 INFO: VM Name: urbackup01 383 | #/var/log/vzdump/lxc-105.log 2018-02-22 16:00:02 INFO: include disk 'virtio0' 'WDC15EADS-tpool-001:vm-105-disk-1' 32G 384 | #/var/log/vzdump/lxc-105.log 2018-02-22 16:00:02 INFO: exclude disk 'virtio1' 'bkp-urbackup01-001:105/vm-105-disk-1.qcow2' (backup=no) 385 | #/var/log/vzdump/lxc-105.log 2018-02-22 16:00:03 INFO: backup mode: snapshot 386 | #/var/log/vzdump/lxc-105.log 2018-02-22 16:00:03 INFO: ionice priority: 7 387 | #/var/log/vzdump/lxc-105.log 2018-02-22 16:00:03 INFO: creating archive '/vmfs/bkp-urbackup01-001/dump/vzdump-lxc-105-2018_02_22-16_00_02.vma.gz' 388 | #/var/log/vzdump/lxc-105.log 2018-02-22 16:00:03 INFO: started backup task '459b5abe-aa47-47f0-9bc1-144ab9cabe54' 389 | #/var/log/vzdump/lxc-105.log 2018-02-22 16:18:47 INFO: transferred 34359 MB in 1124 seconds (30 MB/s) 390 | #/var/log/vzdump/lxc-105.log 2018-02-22 16:18:47 INFO: archive file size: 7.03GB 391 | #/var/log/vzdump/lxc-105.log 2018-02-22 16:18:47 INFO: delete old backup '/vmfs/bkp-urbackup01-001/dump/vzdump-lxc-105-2018_02_15-16_00_02.vma.gz' 392 | #/var/log/vzdump/lxc-105.log 2018-02-22 16:18:47 INFO: Finished Backup of VM 105 (00:18:45) 393 | #/var/log/vzdump/lxc-106.log 2018-02-22 14:11:04 INFO: Starting Backup of VM 106 (lxc) 394 | #/var/log/vzdump/lxc-106.log 2018-02-22 14:11:04 INFO: status = running 395 | #/var/log/vzdump/lxc-106.log 2018-02-22 14:11:05 INFO: update VM 106: -lock backup 396 | #/var/log/vzdump/lxc-106.log 2018-02-22 14:11:05 INFO: VM Name: server02 397 | #/var/log/vzdump/lxc-106.log 2018-02-22 14:11:05 INFO: include disk 'virtio0' 'ST2000DM-tpool-001:vm-106-disk-1' 32G 398 | #/var/log/vzdump/lxc-106.log 2018-02-22 14:11:05 INFO: backup mode: snapshot 399 | #/var/log/vzdump/lxc-106.log 2018-02-22 14:11:05 INFO: ionice priority: 7 400 | #/var/log/vzdump/lxc-106.log 2018-02-22 14:11:05 INFO: creating archive '/vmfs/bkp-vol-001/dump/vzdump-lxc-106-2018_02_22-14_11_04.vma.gz' 401 | #/var/log/vzdump/lxc-106.log 2018-02-22 14:11:05 INFO: started backup task '45a19f0d-dfcb-43d8-bcb2-9ce11cdecfb4' 402 | #/var/log/vzdump/lxc-106.log 2018-02-22 14:30:31 INFO: transferred 34359 MB in 1166 seconds (29 MB/s) 403 | #/var/log/vzdump/lxc-106.log 2018-02-22 14:30:31 INFO: archive file size: 7.53GB 404 | #/var/log/vzdump/lxc-106.log 2018-02-22 14:30:31 INFO: delete old backup '/vmfs/bkp-vol-001/dump/vzdump-lxc-106-2018_02_13-14_11_04.vma.gz' 405 | #/var/log/vzdump/lxc-106.log 2018-02-22 14:30:32 INFO: Finished Backup of VM 106 (00:19:28) 406 | #/var/log/vzdump/lxc-108.log 2018-02-22 14:30:32 INFO: Starting Backup of VM 108 (lxc) 407 | #/var/log/vzdump/lxc-108.log 2018-02-22 14:30:32 INFO: status = running 408 | #/var/log/vzdump/lxc-108.log 2018-02-22 14:30:32 INFO: update VM 108: -lock backup 409 | #/var/log/vzdump/lxc-108.log 2018-02-22 14:30:32 INFO: VM Name: monitoring01 410 | #/var/log/vzdump/lxc-108.log 2018-02-22 14:30:32 INFO: include disk 'virtio0' 'ST2000DM-tpool-001:vm-108-disk-1' 32G 411 | #/var/log/vzdump/lxc-108.log 2018-02-22 14:30:33 INFO: backup mode: snapshot 412 | #/var/log/vzdump/lxc-108.log 2018-02-22 14:30:33 INFO: ionice priority: 7 413 | #/var/log/vzdump/lxc-108.log 2018-02-22 14:30:33 INFO: creating archive '/vmfs/bkp-vol-001/dump/vzdump-lxc-108-2018_02_22-14_30_32.vma.gz' 414 | #/var/log/vzdump/lxc-108.log 2018-02-22 14:30:34 INFO: started backup task '5d28af3d-8d8e-4bd8-ad38-3ec688f66f24' 415 | #/var/log/vzdump/lxc-108.log 2018-02-22 14:37:36 INFO: transferred 34359 MB in 422 seconds (81 MB/s) 416 | #/var/log/vzdump/lxc-108.log 2018-02-22 14:37:36 INFO: archive file size: 2.82GB 417 | #/var/log/vzdump/lxc-108.log 2018-02-22 14:37:36 INFO: delete old backup '/vmfs/bkp-vol-001/dump/vzdump-lxc-108-2018_02_13-14_29_14.vma.gz' 418 | #/var/log/vzdump/lxc-108.log 2018-02-22 14:37:37 INFO: Finished Backup of VM 108 (00:07:05) 419 | 420 | 421 | -------------------------------------------------------------------------------- /check_mk/checks/proxmox_qemu_backup: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | 3 | 4 | # Author: Matthias Maderer 5 | # E-Mail: edvler@edvler-blog.de 6 | # URL: https://github.com/edvler/check_mk_proxmox-qemu-backup 7 | # License: GPLv2 8 | 9 | 10 | # default parameters 11 | proxmox_qemu_backup_default_levels = {'check_backup': 'check', 'backup_age': (93600, 108000), 'running_time': 1800} 12 | 13 | # the inventory function (dummy) 14 | def inventory_qemu_backup(info): 15 | # loop over all output lines of the agent 16 | for line in info: 17 | if line[0].startswith('QEMU-MACHINE;;;;;'): 18 | arr_qemu_vars = line[0].split(';;;;;') 19 | arr_qemu_id = arr_qemu_vars[1].split('/') 20 | qemu_id = arr_qemu_id[-1].replace('.conf','') 21 | yield arr_qemu_vars[2] + " Id: " + qemu_id + "", "proxmox_qemu_backup_default_levels" 22 | 23 | # the check function (dummy) 24 | def check_qemu_backup(item, params, info): 25 | #return 0 if check of backups should not be done 26 | if params['check_backup'] == 'ignore': 27 | # return 0, 'check disabled by rule' 28 | yield 0, 'check disabled by rule' 29 | return 30 | 31 | 32 | 33 | #get name of the logfile (the output of each logfile is 34 | #prefixed with its filename from the plugin) 35 | qemu_id=item.split(' ')[-1] 36 | logfile = '/var/log/vzdump/qemu-' + qemu_id + '.log' 37 | 38 | # ft=time.strftime("-%Y-%m-%d_%H%M%S") 39 | # f=open(os.getenv("OMD_ROOT") + '/tmp/' + qemu_id + ft + ".info_agent" , 'w') 40 | # for item in info: 41 | # f.write("%s\n" % item) 42 | # f.close() 43 | 44 | #counter 45 | line_count=0 46 | warn_count=0 47 | warn_msg="" 48 | error_count=0 49 | error_msg="" 50 | 51 | archive="nothing" 52 | finished="nothing" 53 | started="nothing" 54 | file_created="nothing" 55 | incremental=False 56 | 57 | vzdump_is_running = 0 58 | 59 | offset=0 60 | 61 | #check all lines 62 | for line in info: 63 | #Check for running tasks 64 | #task UPID:pve01:00000E8D:009D1950:5E344CAA:vzdump:101:root@pam: 65 | if line[0] == 'PSOUTPUT': 66 | #taskinfos = line[1].split(":") 67 | #if taskinfos[6] == qemu_id: 68 | # vzdump_is_running = 1 69 | for x in line: 70 | if x == qemu_id: 71 | vzdump_is_running = 1 72 | 73 | #is this line of the given item (qemu_id) 74 | if line[0] == logfile: 75 | line_count += 1 #count lines of log for this id 76 | 77 | #old or new dateformat in logfile? 78 | #old /var/log/vzdump/qemu-104.log Feb 07 12:10:54 INFO: creating archive '/vmfs/bkp-fs-stor-001/dump/vzdump-qemu-104-2018_02_07-12_10_54.vma.gz' 79 | #new /var/log/vzdump/qemu-105.log 2018-02-06 16:00:03 INFO: creating archive '/vmfs/bkp-urbackup01-001/dump/vzdump-qemu-105-2018_02_06-16_00_02.vma.gz' 80 | d = "" 81 | try: 82 | d = time.strptime(line[1] + ' ' + line[2],"%Y-%m-%d %H:%M:%S") 83 | offset=0 84 | except ValueError: 85 | try: 86 | d = time.strptime(time.strftime("%Y",time.localtime()) + ' ' + line[1] + ' ' + line[2] + ' ' + line[3],"%Y %b %d %H:%M:%S") 87 | offset=1 88 | except ValueError: 89 | pass 90 | 91 | try: 92 | if line[offset+3] + ' ' + line[offset+4] == 'INFO: creating': 93 | #proxmox 6.2-9 introduced a new log-format 94 | if line[offset+5] == 'vzdump': 95 | file_created = line 96 | startdate = getDateFromFileCreated(file_created[offset+7].split("/")[-1]) 97 | #< proxmox 6.2 98 | if line[offset+5] == 'archive': 99 | file_created = line 100 | startdate = getDateFromFileCreated(file_created[offset+6].split("/")[-1]) 101 | #< proxmox 6 102 | if line[offset+5] == 'Proxmox': 103 | file_created = line 104 | startdate = getDateFromFileCreated(file_created[offset+9].split("/")[-1]) 105 | 106 | #extract several infos 107 | #proxmox 6.2-9 introduced a new log-format 108 | # if line[offset+5] == 'vzdump': 109 | # if line[offset+3] + ' ' + line[offset+4] + ' ' + line[offset+5] + ' ' + line[offset+6] == 'INFO: creating vzdump archive': 110 | # file_created = line 111 | # startdate = getDateFromFileCreated(file_created[offset+7].split("/")[-1]) 112 | # #Proxmox Backup Server 113 | # if line[offset+5] + ' ' + line[offset+6] + ' ' + line[offset+7] == 'Proxmox Backup Server': 114 | # if line[offset+3] + ' ' + line[offset+4] + ' ' + line[offset+5] + ' ' + line[offset+6] + ' ' + line[offset+7] + ' ' + line[offset+8] == 'INFO: creating Proxmox Backup Server archive': 115 | # file_created = line 116 | # startdate = getDateFromFileCreated(file_created[offset+9].split("/")[-1]) 117 | # else: 118 | # if line[offset+3] + ' ' + line[offset+4] + ' ' + line[offset+5] == 'INFO: creating archive': 119 | # file_created = line 120 | # startdate = getDateFromFileCreated(file_created[offset+6].split("/")[-1]) 121 | if line[offset+3] + ' ' + line[offset+4] + ' ' + line[offset+5] + ' ' + line[offset+6] == 'INFO: archive file size:': 122 | archive = line 123 | #we have no archive here, only reused and transfered 124 | if line[offset+3] + ' ' + line[offset+4] == 'INFO: transferred': 125 | archive = line 126 | if line[offset+3] + ' ' + line[offset+4] + ' ' + line[offset+5] + ' ' + line[offset+6] + ' ' + line[offset+7] == 'INFO: Starting Backup of VM': 127 | started = line 128 | started_datetime = d 129 | if 'incremental' in line or 'incrementally' in line: 130 | incremental = True 131 | size, size_unit = '0', 'B' 132 | if line[offset+3] + ' ' + line[offset+4] + ' ' + line[offset+5] + ' ' + line[offset+6] + ' ' + line[offset+7] == 'INFO: Finished Backup of VM': 133 | finished = line 134 | 135 | except IndexError: 136 | pass 137 | 138 | lineAdded=False 139 | #search for keywords 140 | for content in line: 141 | if 'warn' in content.lower() and lineAdded==False: 142 | warn_count += 1 143 | warn_msg += " ".join(line[offset+3:]) + "; " 144 | lineAdded=True 145 | elif ('error' in content.lower() or 'fail' in content.lower()) and lineAdded==False: 146 | error_count += 1 147 | error_msg += " ".join(line[offset+3:]) + "; " 148 | lineAdded=True 149 | 150 | #if line_count is 0, no backup file exists --> error! 151 | if line_count == 0: 152 | yield 2, "no backup exists for this VM guest" 153 | return 154 | 155 | #check counter 156 | if error_count > 0: 157 | yield 2, error_msg 158 | return 159 | if warn_count > 0: 160 | yield 1, warn_msg 161 | return 162 | 163 | #no warnings and erros!! check if lines indicating a successfull backup exists 164 | if (archive != "nothing" or incremental) and finished != "nothing" and started != "nothing" and file_created != "nothing": 165 | 166 | 167 | warn, error = params['backup_age'] 168 | 169 | # Age of Backup 170 | old = time.time() - time.mktime(startdate) 171 | duration_formatted = pretty_time_delta(old) 172 | infotext = 'last backup: ' + time.strftime("%Y-%m-%d %H:%M", startdate) + ' (Age: ' + duration_formatted + ' warn/crit at ' + pretty_time_delta(warn) + '/' + pretty_time_delta(error) + ')' 173 | 174 | # Example sizes 175 | #qemu-100.log:Aug 21 05:01:31 INFO: archive file size: 594MB 176 | #qemu-101.log:Jun 12 05:08:59 INFO: archive file size: 3.94GB 177 | #qemu-102.log:Jun 12 05:09:00 INFO: archive file size: 0KB 178 | #qemu-104.log:Jun 12 05:09:00 INFO: archive file size: 0KB 179 | #qemu-105.log:Jun 12 05:10:58 INFO: archive file size: 832MB 180 | #qemu-106.log:Jun 12 05:19:39 INFO: archive file size: 3.84GB 181 | warn_size = 0 182 | error_size = 0 183 | if 'backup_minsize' in params: 184 | warn_size, error_size = params['backup_minsize'] 185 | if archive[offset+4] == "archive": 186 | size = archive[offset+7] 187 | size_unit = size[-2:] 188 | if archive[offset+4] == "transferred": 189 | size = archive[offset+5] 190 | size_unit = archive[offset+6] 191 | size_numbers = float(size[:max(len(size)-2, 1)]) 192 | size_cal = -1 193 | 194 | # Norm to Byte 195 | # .../share/check_mk/web/plugins/metrics/check_mk.py 196 | if size_unit == "TB": 197 | size_cal = size_numbers*1024*1024*1024*1024 198 | if size_unit == "GB": 199 | size_cal = size_numbers*1024*1024*1024 200 | if size_unit == "MB": 201 | size_cal = size_numbers*1024*1024 202 | if size_unit == "KB": 203 | size_cal = size_numbers*1024 204 | if size_unit == "TiB": 205 | size_cal = size_numbers*1000*1000*1000*1000 206 | if size_unit == "GiB": 207 | size_cal = size_numbers*1000*1000*1000 208 | if size_unit == "MiB": 209 | size_cal = size_numbers*1000*1000 210 | if size_unit == "KiB": 211 | size_cal = size_numbers*1000 212 | 213 | # metrics from .../share/check_mk/web/plugins/metrics/check_mk.py 214 | perfdata = [ 215 | ( "backup_age", int(old), warn, error ), 216 | ( "file_size", int(size_cal), warn_size, error_size ), 217 | ] 218 | 219 | if old < warn: 220 | yield 0, infotext, perfdata 221 | if old >= warn and old < error: 222 | yield 1, infotext, perfdata 223 | if old >= error: 224 | yield 2, infotext, perfdata 225 | 226 | 227 | 228 | if archive[offset+4] == "archive": 229 | size_infotext = "Archive size: " + str(size_numbers) + ' ' + size_unit 230 | elif archive[offset+4] == "transferred": 231 | size_infotext = "transferred size: " + str(size_numbers) + ' ' + size_unit 232 | else: 233 | size_infotext = "empty incremental backup" 234 | 235 | if size_cal >= warn_size or incremental: 236 | yield 0, size_infotext, perfdata 237 | elif size_cal < warn_size and size_cal >= error_size: 238 | yield 1, size_infotext, perfdata 239 | elif size_cal < error_size: 240 | yield 2, size_infotext, perfdata 241 | 242 | return 243 | 244 | elif started != "nothing": 245 | vzdump_is_running = 1 246 | 247 | #is backup currently running? 248 | if vzdump_is_running == 1: 249 | old = time.time() - time.mktime(started_datetime) 250 | if old < params['running_time']: 251 | yield 0, 'backup is running since: ' + time.strftime("%Y-%m-%d %H:%M", started_datetime) 252 | return 253 | else: 254 | yield 1, 'backup is running since: ' + time.strftime("%Y-%m-%d %H:%M", started_datetime) 255 | return 256 | 257 | yield 3, "error occured in check plugin. Please post a issue on https://github.com/edvler/check_mk_proxmox-qemu-backup/issues inlcuding the output of the agent plugin /usr/lib/check_mk_agent/plugins/proxmox-qemu-backup" 258 | return 259 | 260 | # declare the check to Check_MK 261 | check_info["proxmox_qemu_backup"] = { 262 | 'check_function': check_qemu_backup, 263 | 'inventory_function': inventory_qemu_backup, 264 | 'service_description': 'Proxmox QEMU VM backup %s', 265 | 'group': 'proxmox', 266 | 'has_perfdata': True, 267 | } 268 | 269 | def getDateFromFileCreated(vma_name): 270 | if "T" in vma_name: 271 | p = re.compile("([0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2})") 272 | m = p.search(vma_name) 273 | d = time.strptime(m.group(1),"%Y-%m-%dT%H:%M:%S") 274 | else: 275 | if "differential" in vma_name: 276 | p = re.compile("differential-(20[0-9][0-9]_[0-9][0-9]_[0-9][0-9]-[0-9][0-9]_[0-9][0-9]_[0-9][0-9])") 277 | else: 278 | p = re.compile("(20[0-9][0-9]_[0-9][0-9]_[0-9][0-9]-[0-9][0-9]_[0-9][0-9]_[0-9][0-9])") 279 | m = p.search(vma_name) 280 | d = time.strptime(m.group(1),"%Y_%m_%d-%H_%M_%S") 281 | return d 282 | # p = re.compile("(20[0-9][0-9]_[0-9][0-9]_[0-9][0-9]-[0-9][0-9]_[0-9][0-9]_[0-9][0-9])") 283 | # m = p.search(vma_name) 284 | # d = time.strptime(m.group(1),"%Y_%m_%d-%H_%M_%S") 285 | # return d 286 | 287 | #thanks to https://gist.github.com/thatalextaylor/7408395 288 | def pretty_time_delta(seconds): 289 | sign_string = '-' if seconds < 0 else '' 290 | seconds = abs(int(seconds)) 291 | days, seconds = divmod(seconds, 86400) 292 | hours, seconds = divmod(seconds, 3600) 293 | minutes, seconds = divmod(seconds, 60) 294 | if days > 0: 295 | return '%s%dd %dh %dm' % (sign_string, days, hours, minutes) 296 | elif hours > 0: 297 | return '%s%dh %dm' % (sign_string, hours, minutes) 298 | elif minutes > 0: 299 | return '%s%dm' % (sign_string, minutes) 300 | else: 301 | return '0m' 302 | 303 | #Example output of agent 304 | # 305 | #root@pve01:/usr/lib/check_mk_agent/plugins# ./proxmox_qemu_backup 306 | #<<>> 307 | #QEMU-MACHINE;;;;;/etc/pve/qemu-server/103.conf;;;;;server01-hlds 308 | #QEMU-MACHINE;;;;;/etc/pve/qemu-server/102.conf;;;;;firewall01 309 | #QEMU-MACHINE;;;;;/etc/pve/qemu-server/108.conf;;;;;monitoring01 310 | #QEMU-MACHINE;;;;;/etc/pve/qemu-server/101.conf;;;;;guacamole01 311 | #QEMU-MACHINE;;;;;/etc/pve/qemu-server/100.conf;;;;;pfsense01 312 | #QEMU-MACHINE;;;;;/etc/pve/qemu-server/106.conf;;;;;server02 313 | #QEMU-MACHINE;;;;;/etc/pve/qemu-server/105.conf;;;;;urbackup01 314 | #QEMU-MACHINE;;;;;/etc/pve/qemu-server/104.conf;;;;;zbox 315 | #task UPID:pve01:000031A4:009F1CF0:5E3451D2:vzdump:108:root@pam: 316 | #/var/log/vzdump/qemu-100.log 2017-09-05 11:45:02 INFO: Starting Backup of VM 100 (qemu) 317 | #/var/log/vzdump/qemu-100.log 2017-09-05 11:45:02 INFO: status = stopped 318 | #/var/log/vzdump/qemu-100.log 2017-09-05 11:45:02 INFO: update VM 100: -lock backup 319 | #/var/log/vzdump/qemu-100.log 2017-09-05 11:45:02 INFO: backup mode: stop 320 | #/var/log/vzdump/qemu-100.log 2017-09-05 11:45:02 INFO: ionice priority: 7 321 | #/var/log/vzdump/qemu-100.log 2017-09-05 11:45:02 INFO: VM Name: pfsense01 322 | #/var/log/vzdump/qemu-100.log 2017-09-05 11:45:02 INFO: include disk 'virtio0' 'WDC15EADS-tpool-001:vm-100-disk-1' 32G 323 | #/var/log/vzdump/qemu-100.log 2017-09-05 11:45:04 INFO: creating archive '/vmfs/bkp-vol-001/dump/vzdump-qemu-100-2017_09_05-11_45_02.vma.gz' 324 | #/var/log/vzdump/qemu-100.log 2017-09-05 11:45:04 INFO: starting kvm to execute backup task 325 | #/var/log/vzdump/qemu-100.log 2017-09-05 11:45:06 INFO: started backup task 'bb24a1d8-e70a-4cda-a10e-86adb9dab94d' 326 | #/var/log/vzdump/qemu-100.log 2017-09-05 11:46:35 INFO: transferred 34359 MB in 89 seconds (386 MB/s) 327 | #/var/log/vzdump/qemu-100.log 2017-09-05 11:46:35 INFO: stopping kvm after backup task 328 | #/var/log/vzdump/qemu-100.log 2017-09-05 11:46:36 INFO: archive file size: 686MB 329 | #/var/log/vzdump/qemu-100.log 2017-09-05 11:46:36 INFO: Finished Backup of VM 100 (00:01:34) 330 | #/var/log/vzdump/qemu-101.log Apr 06 11:46:34 INFO: Starting Backup of VM 101 (qemu) 331 | #/var/log/vzdump/qemu-101.log Apr 06 11:46:34 INFO: status = stopped 332 | #/var/log/vzdump/qemu-101.log Apr 06 11:46:34 INFO: update VM 101: -lock backup 333 | #/var/log/vzdump/qemu-101.log Apr 06 11:46:35 INFO: backup mode: stop 334 | #/var/log/vzdump/qemu-101.log Apr 06 11:46:35 INFO: ionice priority: 7 335 | #/var/log/vzdump/qemu-101.log Apr 06 11:46:35 INFO: VM Name: guacamole01 336 | #/var/log/vzdump/qemu-101.log Apr 06 11:46:35 INFO: include disk 'sata0' 'WDC15EADS-tpool-001:vm-101-disk-1' 337 | #/var/log/vzdump/qemu-101.log Apr 06 11:46:35 INFO: creating archive '/vmfs/usbbac001-fs-backup-001/dump/vzdump-qemu-101-2017_04_06-11_46_34.vma.gz' 338 | #/var/log/vzdump/qemu-101.log Apr 06 11:46:35 INFO: starting kvm to execute backup task 339 | #/var/log/vzdump/qemu-101.log Apr 06 11:46:38 INFO: started backup task '78127b22-7948-4555-8c48-10b8f3d01ce5' 340 | #/var/log/vzdump/qemu-101.log Apr 06 11:59:11 INFO: transferred 54760 MB in 753 seconds (72 MB/s) 341 | #/var/log/vzdump/qemu-101.log Apr 06 11:59:11 INFO: stopping kvm after backup task 342 | #/var/log/vzdump/qemu-101.log Apr 06 11:59:12 INFO: archive file size: 1.41GB 343 | #/var/log/vzdump/qemu-101.log Apr 06 11:59:12 INFO: delete old backup '/vmfs/usbbac001-fs-backup-001/dump/vzdump-qemu-101-2017_03_14-11_46_37.vma.gz' 344 | #/var/log/vzdump/qemu-101.log Apr 06 11:59:13 INFO: Finished Backup of VM 101 (00:12:39) 345 | #/var/log/vzdump/qemu-102.log 2017-09-05 11:46:36 INFO: Starting Backup of VM 102 (qemu) 346 | #/var/log/vzdump/qemu-102.log 2017-09-05 11:46:36 INFO: status = stopped 347 | #/var/log/vzdump/qemu-102.log 2017-09-05 11:46:36 INFO: update VM 102: -lock backup 348 | #/var/log/vzdump/qemu-102.log 2017-09-05 11:46:36 INFO: backup mode: stop 349 | #/var/log/vzdump/qemu-102.log 2017-09-05 11:46:36 INFO: ionice priority: 7 350 | #/var/log/vzdump/qemu-102.log 2017-09-05 11:46:36 INFO: VM Name: firewall01 351 | #/var/log/vzdump/qemu-102.log 2017-09-05 11:46:36 INFO: include disk 'sata0' 'ssd-850evo-tpool-001:vm-102-disk-2' 9G 352 | #/var/log/vzdump/qemu-102.log 2017-09-05 11:46:36 INFO: creating archive '/vmfs/bkp-vol-001/dump/vzdump-qemu-102-2017_09_05-11_46_36.vma.gz' 353 | #/var/log/vzdump/qemu-102.log 2017-09-05 11:46:36 INFO: starting kvm to execute backup task 354 | #/var/log/vzdump/qemu-102.log 2017-09-05 11:46:38 INFO: started backup task '0ca8bbd7-65cb-4443-8743-0f2074fa736d' 355 | #/var/log/vzdump/qemu-102.log 2017-09-05 11:50:29 INFO: transferred 9663 MB in 231 seconds (41 MB/s) 356 | #/var/log/vzdump/qemu-102.log 2017-09-05 11:50:29 INFO: stopping kvm after backup task 357 | #/var/log/vzdump/qemu-102.log 2017-09-05 11:50:30 INFO: archive file size: 1.95GB 358 | #/var/log/vzdump/qemu-102.log 2017-09-05 11:50:30 INFO: Finished Backup of VM 102 (00:03:54) 359 | #/var/log/vzdump/qemu-103.log 2017-09-05 11:50:30 INFO: Starting Backup of VM 103 (qemu) 360 | #/var/log/vzdump/qemu-103.log 2017-09-05 11:50:30 INFO: status = stopped 361 | #/var/log/vzdump/qemu-103.log 2017-09-05 11:50:31 INFO: update VM 103: -lock backup 362 | #/var/log/vzdump/qemu-103.log 2017-09-05 11:50:31 INFO: backup mode: stop 363 | #/var/log/vzdump/qemu-103.log 2017-09-05 11:50:31 INFO: ionice priority: 7 364 | #/var/log/vzdump/qemu-103.log 2017-09-05 11:50:31 INFO: VM Name: server01-hlds 365 | #/var/log/vzdump/qemu-103.log 2017-09-05 11:50:31 INFO: include disk 'sata0' 'WDC15EADS-tpool-001:vm-103-disk-2' 101G 366 | #/var/log/vzdump/qemu-103.log 2017-09-05 11:50:33 INFO: creating archive '/vmfs/bkp-vol-001/dump/vzdump-qemu-103-2017_09_05-11_50_30.vma.gz' 367 | #/var/log/vzdump/qemu-103.log 2017-09-05 11:50:33 INFO: starting kvm to execute backup task 368 | #/var/log/vzdump/qemu-103.log 2017-09-05 11:50:36 INFO: started backup task 'fe948ba6-3b3a-4737-b9c2-1419864e6fe4' 369 | #/var/log/vzdump/qemu-103.log 2017-09-05 13:02:25 INFO: transferred 108447 MB in 4309 seconds (25 MB/s) 370 | #/var/log/vzdump/qemu-103.log 2017-09-05 13:02:25 INFO: stopping kvm after backup task 371 | #/var/log/vzdump/qemu-103.log 2017-09-05 13:02:28 INFO: archive file size: 33.09GB 372 | #/var/log/vzdump/qemu-103.log 2017-09-05 13:02:28 INFO: Finished Backup of VM 103 (01:11:58) 373 | #/var/log/vzdump/qemu-104.log 2018-02-22 14:11:02 INFO: Starting Backup of VM 104 (qemu) 374 | #/var/log/vzdump/qemu-104.log 2018-02-22 14:11:02 INFO: status = running 375 | #/var/log/vzdump/qemu-104.log 2018-02-22 14:11:03 INFO: update VM 104: -lock backup 376 | #/var/log/vzdump/qemu-104.log 2018-02-22 14:11:03 INFO: VM Name: zbox 377 | #/var/log/vzdump/qemu-104.log 2018-02-22 14:11:03 INFO: exclude disk 'virtio0' 'ssd-850evo-tpool-001:vm-104-disk-1' (backup=no) 378 | #/var/log/vzdump/qemu-104.log 2018-02-22 14:11:03 INFO: exclude disk 'virtio1' 'ST2000DM-tpool-001:vm-104-disk-4' (backup=no) 379 | #/var/log/vzdump/qemu-104.log 2018-02-22 14:11:03 INFO: exclude disk 'virtio2' 'ST2000DM-tpool-001:vm-104-disk-1' (backup=no) 380 | #/var/log/vzdump/qemu-104.log 2018-02-22 14:11:03 INFO: exclude disk 'virtio3' 'ST2000DM-tpool-001:vm-104-disk-2' (backup=no) 381 | #/var/log/vzdump/qemu-104.log 2018-02-22 14:11:03 INFO: exclude disk 'virtio15' 'bkp-zbox-wss-001:104/vm-104-disk-1.raw' (backup=no) 382 | #/var/log/vzdump/qemu-104.log 2018-02-22 14:11:03 INFO: backup mode: snapshot 383 | #/var/log/vzdump/qemu-104.log 2018-02-22 14:11:03 INFO: ionice priority: 7 384 | #/var/log/vzdump/qemu-104.log 2018-02-22 14:11:03 INFO: pending configuration changes found (not included into backup) 385 | #/var/log/vzdump/qemu-104.log 2018-02-22 14:11:03 INFO: creating archive '/vmfs/bkp-vol-001/dump/vzdump-qemu-104-2018_02_22-14_11_02.vma.gz' 386 | #/var/log/vzdump/qemu-104.log 2018-02-22 14:11:03 INFO: backup contains no disks 387 | #/var/log/vzdump/qemu-104.log 2018-02-22 14:11:03 INFO: starting template backup 388 | #/var/log/vzdump/qemu-104.log 2018-02-22 14:11:03 INFO: /usr/bin/vma create -v -c /vmfs/bkp-vol-001/dump/vzdump-qemu-104-2018_02_22-14_11_02.tmp/qemu-server.conf exec:gzip > /vmfs/bkp-vol-001/dump/vzdump-qemu-104-2018_02_22-14_11_02.vma.dat 389 | #/var/log/vzdump/qemu-104.log 2018-02-22 14:11:04 INFO: archive file size: 0KB 390 | #/var/log/vzdump/qemu-104.log 2018-02-22 14:11:04 INFO: delete old backup '/vmfs/bkp-vol-001/dump/vzdump-qemu-104-2018_02_13-14_11_02.vma.gz' 391 | #/var/log/vzdump/qemu-104.log 2018-02-22 14:11:04 INFO: Finished Backup of VM 104 (00:00:02) 392 | #/var/log/vzdump/qemu-105.log 2018-02-22 16:00:02 INFO: Starting Backup of VM 105 (qemu) 393 | #/var/log/vzdump/qemu-105.log 2018-02-22 16:00:02 INFO: status = running 394 | #/var/log/vzdump/qemu-105.log 2018-02-22 16:00:02 INFO: update VM 105: -lock backup 395 | #/var/log/vzdump/qemu-105.log 2018-02-22 16:00:02 INFO: VM Name: urbackup01 396 | #/var/log/vzdump/qemu-105.log 2018-02-22 16:00:02 INFO: include disk 'virtio0' 'WDC15EADS-tpool-001:vm-105-disk-1' 32G 397 | #/var/log/vzdump/qemu-105.log 2018-02-22 16:00:02 INFO: exclude disk 'virtio1' 'bkp-urbackup01-001:105/vm-105-disk-1.qcow2' (backup=no) 398 | #/var/log/vzdump/qemu-105.log 2018-02-22 16:00:03 INFO: backup mode: snapshot 399 | #/var/log/vzdump/qemu-105.log 2018-02-22 16:00:03 INFO: ionice priority: 7 400 | #/var/log/vzdump/qemu-105.log 2018-02-22 16:00:03 INFO: creating archive '/vmfs/bkp-urbackup01-001/dump/vzdump-qemu-105-2018_02_22-16_00_02.vma.gz' 401 | #/var/log/vzdump/qemu-105.log 2018-02-22 16:00:03 INFO: started backup task '459b5abe-aa47-47f0-9bc1-144ab9cabe54' 402 | #/var/log/vzdump/qemu-105.log 2018-02-22 16:18:47 INFO: transferred 34359 MB in 1124 seconds (30 MB/s) 403 | #/var/log/vzdump/qemu-105.log 2018-02-22 16:18:47 INFO: archive file size: 7.03GB 404 | #/var/log/vzdump/qemu-105.log 2018-02-22 16:18:47 INFO: delete old backup '/vmfs/bkp-urbackup01-001/dump/vzdump-qemu-105-2018_02_15-16_00_02.vma.gz' 405 | #/var/log/vzdump/qemu-105.log 2018-02-22 16:18:47 INFO: Finished Backup of VM 105 (00:18:45) 406 | #/var/log/vzdump/qemu-106.log 2018-02-22 14:11:04 INFO: Starting Backup of VM 106 (qemu) 407 | #/var/log/vzdump/qemu-106.log 2018-02-22 14:11:04 INFO: status = running 408 | #/var/log/vzdump/qemu-106.log 2018-02-22 14:11:05 INFO: update VM 106: -lock backup 409 | #/var/log/vzdump/qemu-106.log 2018-02-22 14:11:05 INFO: VM Name: server02 410 | #/var/log/vzdump/qemu-106.log 2018-02-22 14:11:05 INFO: include disk 'virtio0' 'ST2000DM-tpool-001:vm-106-disk-1' 32G 411 | #/var/log/vzdump/qemu-106.log 2018-02-22 14:11:05 INFO: backup mode: snapshot 412 | #/var/log/vzdump/qemu-106.log 2018-02-22 14:11:05 INFO: ionice priority: 7 413 | #/var/log/vzdump/qemu-106.log 2018-02-22 14:11:05 INFO: creating archive '/vmfs/bkp-vol-001/dump/vzdump-qemu-106-2018_02_22-14_11_04.vma.gz' 414 | #/var/log/vzdump/qemu-106.log 2018-02-22 14:11:05 INFO: started backup task '45a19f0d-dfcb-43d8-bcb2-9ce11cdecfb4' 415 | #/var/log/vzdump/qemu-106.log 2018-02-22 14:30:31 INFO: transferred 34359 MB in 1166 seconds (29 MB/s) 416 | #/var/log/vzdump/qemu-106.log 2018-02-22 14:30:31 INFO: archive file size: 7.53GB 417 | #/var/log/vzdump/qemu-106.log 2018-02-22 14:30:31 INFO: delete old backup '/vmfs/bkp-vol-001/dump/vzdump-qemu-106-2018_02_13-14_11_04.vma.gz' 418 | #/var/log/vzdump/qemu-106.log 2018-02-22 14:30:32 INFO: Finished Backup of VM 106 (00:19:28) 419 | #/var/log/vzdump/qemu-108.log 2018-02-22 14:30:32 INFO: Starting Backup of VM 108 (qemu) 420 | #/var/log/vzdump/qemu-108.log 2018-02-22 14:30:32 INFO: status = running 421 | #/var/log/vzdump/qemu-108.log 2018-02-22 14:30:32 INFO: update VM 108: -lock backup 422 | #/var/log/vzdump/qemu-108.log 2018-02-22 14:30:32 INFO: VM Name: monitoring01 423 | #/var/log/vzdump/qemu-108.log 2018-02-22 14:30:32 INFO: include disk 'virtio0' 'ST2000DM-tpool-001:vm-108-disk-1' 32G 424 | #/var/log/vzdump/qemu-108.log 2018-02-22 14:30:33 INFO: backup mode: snapshot 425 | #/var/log/vzdump/qemu-108.log 2018-02-22 14:30:33 INFO: ionice priority: 7 426 | #/var/log/vzdump/qemu-108.log 2018-02-22 14:30:33 INFO: creating archive '/vmfs/bkp-vol-001/dump/vzdump-qemu-108-2018_02_22-14_30_32.vma.gz' 427 | #/var/log/vzdump/qemu-108.log 2018-02-22 14:30:34 INFO: started backup task '5d28af3d-8d8e-4bd8-ad38-3ec688f66f24' 428 | #/var/log/vzdump/qemu-108.log 2018-02-22 14:37:36 INFO: transferred 34359 MB in 422 seconds (81 MB/s) 429 | #/var/log/vzdump/qemu-108.log 2018-02-22 14:37:36 INFO: archive file size: 2.82GB 430 | #/var/log/vzdump/qemu-108.log 2018-02-22 14:37:36 INFO: delete old backup '/vmfs/bkp-vol-001/dump/vzdump-qemu-108-2018_02_13-14_29_14.vma.gz' 431 | #/var/log/vzdump/qemu-108.log 2018-02-22 14:37:37 INFO: Finished Backup of VM 108 (00:07:05) 432 | -------------------------------------------------------------------------------- /src/local/lib/python3/cmk_addons/plugins/proxmox_qemu_backup/agent_based/proxmox_qemu_backup.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | 3 | 4 | # Author: Matthias Maderer 5 | # E-Mail: matthias.maderer@web.de 6 | # URL: https://github.com/edvler/check_mk_proxmox-qemu-backup 7 | # License: GPLv2 8 | 9 | from cmk.agent_based.v2 import ( 10 | CheckPlugin, 11 | Result, 12 | Service, 13 | State, 14 | Metric, 15 | render, 16 | ) 17 | import time 18 | 19 | def params_parser(params): 20 | params_new = {} 21 | 22 | for p in params: 23 | if params[p] is not None and isinstance(params[p], tuple): 24 | if params[p][0] in ("fixed", "no_levels", "predictive"): 25 | params_new[p] = params[p] 26 | elif isinstance(params[p][0], (int, float)) and isinstance(params[p][1], (int, float)): 27 | params_new[p] = ('fixed', (params[p][0], params[p][1])) 28 | else: 29 | params_new[p] = params[p] 30 | else: 31 | if isinstance(params[p], int) and p == 'running_time': 32 | params_new[p] = ('fixed',(float(params[p]),float(params[p] + 60*60))) # The old check only has a single int value for running_time 33 | params_new[p] = params[p] 34 | 35 | return params_new 36 | 37 | 38 | 39 | def inventory_qemu_backup(section): 40 | # loop over all output lines of the agent 41 | for line in section: 42 | if line[0].startswith('QEMU-MACHINE;;;;;'): 43 | arr_vars = line[0].split(';;;;;') 44 | arr_id = arr_vars[1].split('/') 45 | id = arr_id[-1].replace('.conf','') 46 | yield Service(item=arr_vars[2] + " Id: " + id) 47 | 48 | def inventory_lxc_backup(section): 49 | # loop over all output lines of the agent 50 | for line in section: 51 | if line[0].startswith('LXC-MACHINE;;;;;'): 52 | arr_vars = line[0].split(';;;;;') 53 | arr_id = arr_vars[1].split('/') 54 | id = arr_id[-1].replace('.conf','') 55 | yield Service(item=arr_vars[2] + " Id: " + id) 56 | 57 | 58 | 59 | def _check_backup(item, params, section): 60 | params_cmk_24 = params_parser(params) 61 | 62 | #prase id 63 | id=item.split(' ')[-1] 64 | 65 | #initialize counter 66 | warn_msg="" 67 | crit_msg="" 68 | 69 | finished=None 70 | started_datetime=None 71 | 72 | offset=0 73 | 74 | #check all lines 75 | for line in section: 76 | if not line[0].startswith('/var/log/vzdump/'): 77 | continue 78 | 79 | #extract id from line. e.g. /var/log/vzdump/qemu-104.log 80 | id_in_log = line[0].replace('/var/log/vzdump/qemu-', '').replace('/var/log/vzdump/lxc-', '').replace('.log', '') 81 | 82 | #is this line of the given item (id)? 83 | if id_in_log == id: 84 | #Only proceed with usable lines (min. 4 array entries) 85 | if len(line) <= 3: 86 | continue 87 | 88 | #old or new dateformat in logfile? 89 | #old /var/log/vzdump/qemu-104.log Feb 07 12:10:54 INFO: creating archive '/vmfs/bkp-fs-stor-001/dump/vzdump-qemu-104-2018_02_07-12_10_54.vma.gz' 90 | #new /var/log/vzdump/qemu-105.log 2018-02-06 16:00:03 INFO: creating archive '/vmfs/bkp-urbackup01-001/dump/vzdump-qemu-105-2018_02_06-16_00_02.vma.gz' 91 | date_logentry = None 92 | try: 93 | date_logentry = time.strptime(line[1] + ' ' + line[2],"%Y-%m-%d %H:%M:%S") 94 | offset=0 95 | except ValueError: 96 | pass 97 | 98 | try: 99 | date_logentry = time.strptime(time.strftime("%Y",time.localtime()) + ' ' + line[1] + ' ' + line[2] + ' ' + line[3],"%Y %b %d %H:%M:%S") 100 | offset=1 101 | except ValueError: 102 | pass 103 | 104 | linetext = " ".join(line[offset+3:]) 105 | 106 | #parse logtext 107 | try: 108 | if linetext.startswith('INFO: Starting Backup of VM'): 109 | started_datetime = date_logentry 110 | 111 | if linetext.startswith('INFO: Finished Backup of VM'): 112 | finished = date_logentry 113 | except IndexError: 114 | pass 115 | 116 | #generate warn and crit messages 117 | if linetext.startswith('WARN:'): 118 | warn_msg += linetext + "; " 119 | if linetext.startswith('ERROR:'): 120 | crit_msg += linetext + "; " 121 | #For each line END 122 | 123 | #check for warn or crit messages 124 | if crit_msg != "": 125 | yield Result(state=State.CRIT, summary=crit_msg) 126 | return 127 | if warn_msg != "": 128 | yield Result(state=State.CRIT, summary=warn_msg) 129 | return 130 | 131 | #no warnings and erros!! check if lines indicating a successfull backup exists 132 | if finished != None and started_datetime != None: 133 | levels = params_cmk_24['backup_age'] if 'backup_age' in params_cmk_24 else None 134 | 135 | if levels == None or levels ==("no_levels", None): 136 | yield (Result(state=State.OK, summary="No check levels defined!")) 137 | return 138 | 139 | warn, crit = params_cmk_24['backup_age'][1] 140 | 141 | # Age of Backup 142 | old = time.time() - time.mktime(started_datetime) 143 | infotext = 'last backup: ' + time.strftime("%Y-%m-%d %H:%M", started_datetime) + ' (Age: ' + render.timespan(old) + ' warn/crit at ' + render.timespan(warn) + '/' + render.timespan(crit) + ')' 144 | 145 | yield Metric('backup_age', int(old), levels=(warn,crit), boundaries=(0, None)) 146 | 147 | if old < warn: 148 | yield Result(state=State.OK, summary=infotext) 149 | elif old >= warn and old < crit: 150 | yield Result(state=State.WARN, summary=infotext) 151 | else: #old >= crit: 152 | yield Result(state=State.CRIT, summary=infotext) 153 | 154 | elif started_datetime != None: 155 | old = time.time() - time.mktime(started_datetime) 156 | 157 | levels = params_cmk_24['running_time'] if 'running_time' in params_cmk_24 else None 158 | if levels == None or levels ==("no_levels", None): 159 | yield (Result(state=State.UNKNOWN, summary="Backup is running. Please define check levels to avoid situations where a backup hangs and fails to complete!")) 160 | return 161 | 162 | warn,crit = params_cmk_24['running_time'][1] 163 | 164 | infotext = 'backup is running since: ' + time.strftime("%Y-%m-%d %H:%M", started_datetime) + ' (since: ' + render.timespan(old) + ' warn/crit at ' + render.timespan(warn) + '/' + render.timespan(crit) + ')' 165 | 166 | if old < warn: 167 | yield Result(state=State.OK, summary=infotext) 168 | elif old >= warn and old < crit: 169 | yield Result(state=State.WARN, summary=infotext) 170 | else: #old >= crit: 171 | yield Result(state=State.CRIT, summary=infotext) 172 | 173 | else: 174 | yield Result(state=State.CRIT, summary='No startime found in logfile. Check the logfile of ' + id + ' in /var/log/vzdump/ for errors! Maybe IO-erros, incomplete logfile ...') 175 | 176 | 177 | check_plugin_proxmox_qemu_backup = CheckPlugin( 178 | name = "proxmox_qemu_backup", 179 | service_name = "Proxmox QEMU VM backup %s", 180 | discovery_function = inventory_qemu_backup, 181 | check_function = _check_backup, 182 | check_default_parameters = { 183 | 'backup_age': ('fixed', (1.5 * 86400.0, 2 * 86400.0)), 184 | 'running_time': ('fixed', (0.8 * 86400.0, 1 * 86400.0)) 185 | }, 186 | check_ruleset_name = "proxmox" 187 | ) 188 | 189 | 190 | 191 | check_plugin_proxmox_lxc_backup = CheckPlugin( 192 | name = "proxmox_lxc_backup", 193 | service_name = "Proxmox LXC VM backup %s", 194 | discovery_function = inventory_lxc_backup, 195 | check_function = _check_backup, 196 | check_default_parameters = { 197 | 'backup_age': (1.5 * 86400.0, 2 * 86400.0) 198 | }, 199 | check_ruleset_name = "proxmox" 200 | ) 201 | 202 | 203 | 204 | 205 | #Example output of agent 206 | # 207 | #root@pve01:/usr/lib/check_mk_agent/plugins# ./proxmox_qemu_backup 208 | #<<>> 209 | #QEMU-MACHINE;;;;;/etc/pve/qemu-server/103.conf;;;;;server01-hlds 210 | #QEMU-MACHINE;;;;;/etc/pve/qemu-server/102.conf;;;;;firewall01 211 | #QEMU-MACHINE;;;;;/etc/pve/qemu-server/108.conf;;;;;monitoring01 212 | #QEMU-MACHINE;;;;;/etc/pve/qemu-server/101.conf;;;;;guacamole01 213 | #QEMU-MACHINE;;;;;/etc/pve/qemu-server/100.conf;;;;;pfsense01 214 | #QEMU-MACHINE;;;;;/etc/pve/qemu-server/106.conf;;;;;server02 215 | #QEMU-MACHINE;;;;;/etc/pve/qemu-server/105.conf;;;;;urbackup01 216 | #QEMU-MACHINE;;;;;/etc/pve/qemu-server/104.conf;;;;;zbox 217 | #task UPID:pve01:000031A4:009F1CF0:5E3451D2:vzdump:108:root@pam: 218 | #/var/log/vzdump/qemu-100.log 2017-09-05 11:45:02 INFO: Starting Backup of VM 100 (qemu) 219 | #/var/log/vzdump/qemu-100.log 2017-09-05 11:45:02 INFO: status = stopped 220 | #/var/log/vzdump/qemu-100.log 2017-09-05 11:45:02 INFO: update VM 100: -lock backup 221 | #/var/log/vzdump/qemu-100.log 2017-09-05 11:45:02 INFO: backup mode: stop 222 | #/var/log/vzdump/qemu-100.log 2017-09-05 11:45:02 INFO: ionice priority: 7 223 | #/var/log/vzdump/qemu-100.log 2017-09-05 11:45:02 INFO: VM Name: pfsense01 224 | #/var/log/vzdump/qemu-100.log 2017-09-05 11:45:02 INFO: include disk 'virtio0' 'WDC15EADS-tpool-001:vm-100-disk-1' 32G 225 | #/var/log/vzdump/qemu-100.log 2017-09-05 11:45:04 INFO: creating archive '/vmfs/bkp-vol-001/dump/vzdump-qemu-100-2017_09_05-11_45_02.vma.gz' 226 | #/var/log/vzdump/qemu-100.log 2017-09-05 11:45:04 INFO: starting kvm to execute backup task 227 | #/var/log/vzdump/qemu-100.log 2017-09-05 11:45:06 INFO: started backup task 'bb24a1d8-e70a-4cda-a10e-86adb9dab94d' 228 | #/var/log/vzdump/qemu-100.log 2017-09-05 11:46:35 INFO: transferred 34359 MB in 89 seconds (386 MB/s) 229 | #/var/log/vzdump/qemu-100.log 2017-09-05 11:46:35 INFO: stopping kvm after backup task 230 | #/var/log/vzdump/qemu-100.log 2017-09-05 11:46:36 INFO: archive file size: 686MB 231 | #/var/log/vzdump/qemu-100.log 2017-09-05 11:46:36 INFO: Finished Backup of VM 100 (00:01:34) 232 | #/var/log/vzdump/qemu-101.log Apr 06 11:46:34 INFO: Starting Backup of VM 101 (qemu) 233 | #/var/log/vzdump/qemu-101.log Apr 06 11:46:34 INFO: status = stopped 234 | #/var/log/vzdump/qemu-101.log Apr 06 11:46:34 INFO: update VM 101: -lock backup 235 | #/var/log/vzdump/qemu-101.log Apr 06 11:46:35 INFO: backup mode: stop 236 | #/var/log/vzdump/qemu-101.log Apr 06 11:46:35 INFO: ionice priority: 7 237 | #/var/log/vzdump/qemu-101.log Apr 06 11:46:35 INFO: VM Name: guacamole01 238 | #/var/log/vzdump/qemu-101.log Apr 06 11:46:35 INFO: include disk 'sata0' 'WDC15EADS-tpool-001:vm-101-disk-1' 239 | #/var/log/vzdump/qemu-101.log Apr 06 11:46:35 INFO: creating archive '/vmfs/usbbac001-fs-backup-001/dump/vzdump-qemu-101-2017_04_06-11_46_34.vma.gz' 240 | #/var/log/vzdump/qemu-101.log Apr 06 11:46:35 INFO: starting kvm to execute backup task 241 | #/var/log/vzdump/qemu-101.log Apr 06 11:46:38 INFO: started backup task '78127b22-7948-4555-8c48-10b8f3d01ce5' 242 | #/var/log/vzdump/qemu-101.log Apr 06 11:59:11 INFO: transferred 54760 MB in 753 seconds (72 MB/s) 243 | #/var/log/vzdump/qemu-101.log Apr 06 11:59:11 INFO: stopping kvm after backup task 244 | #/var/log/vzdump/qemu-101.log Apr 06 11:59:12 INFO: archive file size: 1.41GB 245 | #/var/log/vzdump/qemu-101.log Apr 06 11:59:12 INFO: delete old backup '/vmfs/usbbac001-fs-backup-001/dump/vzdump-qemu-101-2017_03_14-11_46_37.vma.gz' 246 | #/var/log/vzdump/qemu-101.log Apr 06 11:59:13 INFO: Finished Backup of VM 101 (00:12:39) 247 | #/var/log/vzdump/qemu-102.log 2017-09-05 11:46:36 INFO: Starting Backup of VM 102 (qemu) 248 | #/var/log/vzdump/qemu-102.log 2017-09-05 11:46:36 INFO: status = stopped 249 | #/var/log/vzdump/qemu-102.log 2017-09-05 11:46:36 INFO: update VM 102: -lock backup 250 | #/var/log/vzdump/qemu-102.log 2017-09-05 11:46:36 INFO: backup mode: stop 251 | #/var/log/vzdump/qemu-102.log 2017-09-05 11:46:36 INFO: ionice priority: 7 252 | #/var/log/vzdump/qemu-102.log 2017-09-05 11:46:36 INFO: VM Name: firewall01 253 | #/var/log/vzdump/qemu-102.log 2017-09-05 11:46:36 INFO: include disk 'sata0' 'ssd-850evo-tpool-001:vm-102-disk-2' 9G 254 | #/var/log/vzdump/qemu-102.log 2017-09-05 11:46:36 INFO: creating archive '/vmfs/bkp-vol-001/dump/vzdump-qemu-102-2017_09_05-11_46_36.vma.gz' 255 | #/var/log/vzdump/qemu-102.log 2017-09-05 11:46:36 INFO: starting kvm to execute backup task 256 | #/var/log/vzdump/qemu-102.log 2017-09-05 11:46:38 INFO: started backup task '0ca8bbd7-65cb-4443-8743-0f2074fa736d' 257 | #/var/log/vzdump/qemu-102.log 2017-09-05 11:50:29 INFO: transferred 9663 MB in 231 seconds (41 MB/s) 258 | #/var/log/vzdump/qemu-102.log 2017-09-05 11:50:29 INFO: stopping kvm after backup task 259 | #/var/log/vzdump/qemu-102.log 2017-09-05 11:50:30 INFO: archive file size: 1.95GB 260 | #/var/log/vzdump/qemu-102.log 2017-09-05 11:50:30 INFO: Finished Backup of VM 102 (00:03:54) 261 | #/var/log/vzdump/qemu-103.log 2017-09-05 11:50:30 INFO: Starting Backup of VM 103 (qemu) 262 | #/var/log/vzdump/qemu-103.log 2017-09-05 11:50:30 INFO: status = stopped 263 | #/var/log/vzdump/qemu-103.log 2017-09-05 11:50:31 INFO: update VM 103: -lock backup 264 | #/var/log/vzdump/qemu-103.log 2017-09-05 11:50:31 INFO: backup mode: stop 265 | #/var/log/vzdump/qemu-103.log 2017-09-05 11:50:31 INFO: ionice priority: 7 266 | #/var/log/vzdump/qemu-103.log 2017-09-05 11:50:31 INFO: VM Name: server01-hlds 267 | #/var/log/vzdump/qemu-103.log 2017-09-05 11:50:31 INFO: include disk 'sata0' 'WDC15EADS-tpool-001:vm-103-disk-2' 101G 268 | #/var/log/vzdump/qemu-103.log 2017-09-05 11:50:33 INFO: creating archive '/vmfs/bkp-vol-001/dump/vzdump-qemu-103-2017_09_05-11_50_30.vma.gz' 269 | #/var/log/vzdump/qemu-103.log 2017-09-05 11:50:33 INFO: starting kvm to execute backup task 270 | #/var/log/vzdump/qemu-103.log 2017-09-05 11:50:36 INFO: started backup task 'fe948ba6-3b3a-4737-b9c2-1419864e6fe4' 271 | #/var/log/vzdump/qemu-103.log 2017-09-05 13:02:25 INFO: transferred 108447 MB in 4309 seconds (25 MB/s) 272 | #/var/log/vzdump/qemu-103.log 2017-09-05 13:02:25 INFO: stopping kvm after backup task 273 | #/var/log/vzdump/qemu-103.log 2017-09-05 13:02:28 INFO: archive file size: 33.09GB 274 | #/var/log/vzdump/qemu-103.log 2017-09-05 13:02:28 INFO: Finished Backup of VM 103 (01:11:58) 275 | 276 | 277 | 278 | 279 | 280 | # QEMU-MACHINE;;;;;/etc/pve/qemu-server/107.conf;;;;;server02.mm.lan 281 | # /var/log/vzdump/qemu-107.log 2025-08-20 02:47:34 INFO: Starting Backup of VM 107 (qemu) 282 | # /var/log/vzdump/qemu-107.log 2025-08-20 02:47:34 INFO: status = running 283 | # /var/log/vzdump/qemu-107.log 2025-08-20 02:47:34 INFO: VM Name: server02.mm.lan 284 | # /var/log/vzdump/qemu-107.log 2025-08-20 02:47:34 INFO: include disk 'scsi0' 'local-lvm:vm-107-disk-0' 170G 285 | # /var/log/vzdump/qemu-107.log 2025-08-20 02:47:34 INFO: include disk 'scsi1' 'backup02-offsite:vm-107-disk-0' 50G 286 | # /var/log/vzdump/qemu-107.log 2025-08-20 02:47:34 INFO: include disk 'scsi2' 'tpool-nvme:vm-107-disk-0' 100G 287 | # /var/log/vzdump/qemu-107.log 2025-08-20 02:47:34 INFO: backup mode: snapshot 288 | # /var/log/vzdump/qemu-107.log 2025-08-20 02:47:34 INFO: ionice priority: 7 289 | # /var/log/vzdump/qemu-107.log 2025-08-20 02:47:34 INFO: ----- vzdump scirpt HOOK: backup-start snapshot 107 290 | # /var/log/vzdump/qemu-107.log 2025-08-20 02:47:34 INFO: HOOK-ENV: vmid=107;vmtype=qemu;dumpdir=;storeid=pbs01-fs01;hostname=server02.mm.lan;tarfile=;logfile= 291 | # /var/log/vzdump/qemu-107.log 2025-08-20 02:47:34 INFO: ----- vzdump scirpt HOOK: pre-stop snapshot 107 292 | # /var/log/vzdump/qemu-107.log 2025-08-20 02:47:34 INFO: HOOK-ENV: vmid=107;vmtype=qemu;dumpdir=;storeid=pbs01-fs01;hostname=server02.mm.lan;tarfile=;logfile= 293 | # /var/log/vzdump/qemu-107.log 2025-08-20 02:47:34 INFO: ----- vzdump scirpt HOOK: pre-restart snapshot 107 294 | # /var/log/vzdump/qemu-107.log 2025-08-20 02:47:34 INFO: HOOK-ENV: vmid=107;vmtype=qemu;dumpdir=;storeid=pbs01-fs01;hostname=server02.mm.lan;tarfile=;logfile= 295 | # /var/log/vzdump/qemu-107.log 2025-08-20 02:47:34 INFO: ----- vzdump scirpt HOOK: post-restart snapshot 107 296 | # /var/log/vzdump/qemu-107.log 2025-08-20 02:47:34 INFO: HOOK-ENV: vmid=107;vmtype=qemu;dumpdir=;storeid=pbs01-fs01;hostname=server02.mm.lan;tarfile=;logfile= 297 | # /var/log/vzdump/qemu-107.log 2025-08-20 02:47:34 INFO: pending configuration changes found (not included into backup) 298 | # /var/log/vzdump/qemu-107.log 2025-08-20 02:47:34 INFO: creating Proxmox Backup Server archive 'vm/107/2025-08-20T00:47:34Z' 299 | # /var/log/vzdump/qemu-107.log 2025-08-20 02:47:34 INFO: issuing guest-agent 'fs-freeze' command 300 | # /var/log/vzdump/qemu-107.log 2025-08-20 02:47:35 INFO: issuing guest-agent 'fs-thaw' command 301 | # /var/log/vzdump/qemu-107.log 2025-08-20 02:47:36 INFO: started backup task 'c815016d-2db0-4ecb-8185-8653179ff2c9' 302 | # /var/log/vzdump/qemu-107.log 2025-08-20 02:47:36 INFO: resuming VM again 303 | # /var/log/vzdump/qemu-107.log 2025-08-20 02:47:36 INFO: scsi0: dirty-bitmap status: OK (9.7 GiB of 170.0 GiB dirty) 304 | # /var/log/vzdump/qemu-107.log 2025-08-20 02:47:36 INFO: scsi1: dirty-bitmap status: OK (2.8 GiB of 50.0 GiB dirty) 305 | # /var/log/vzdump/qemu-107.log 2025-08-20 02:47:36 INFO: scsi2: dirty-bitmap status: OK (7.4 GiB of 100.0 GiB dirty) 306 | # /var/log/vzdump/qemu-107.log 2025-08-20 02:47:36 INFO: using fast incremental mode (dirty-bitmap), 19.8 GiB dirty of 320.0 GiB total 307 | # /var/log/vzdump/qemu-107.log 2025-08-20 02:47:39 INFO: 4% (972.0 MiB of 19.8 GiB) in 3s, read: 324.0 MiB/s, write: 324.0 MiB/s 308 | # /var/log/vzdump/qemu-107.log 2025-08-20 02:47:42 INFO: 8% (1.7 GiB of 19.8 GiB) in 6s, read: 270.7 MiB/s, write: 270.7 MiB/s 309 | # /var/log/vzdump/qemu-107.log 2025-08-20 02:47:45 INFO: 13% (2.6 GiB of 19.8 GiB) in 9s, read: 290.7 MiB/s, write: 280.0 MiB/s 310 | # /var/log/vzdump/qemu-107.log 2025-08-20 02:47:48 INFO: 16% (3.3 GiB of 19.8 GiB) in 12s, read: 241.3 MiB/s, write: 241.3 MiB/s 311 | # /var/log/vzdump/qemu-107.log 2025-08-20 02:47:51 INFO: 20% (4.0 GiB of 19.8 GiB) in 15s, read: 240.0 MiB/s, write: 240.0 MiB/s 312 | # /var/log/vzdump/qemu-107.log 2025-08-20 02:47:54 INFO: 23% (4.7 GiB of 19.8 GiB) in 18s, read: 244.0 MiB/s, write: 244.0 MiB/s 313 | # /var/log/vzdump/qemu-107.log 2025-08-20 02:47:57 INFO: 27% (5.4 GiB of 19.8 GiB) in 21s, read: 248.0 MiB/s, write: 248.0 MiB/s 314 | # /var/log/vzdump/qemu-107.log 2025-08-20 02:48:00 INFO: 31% (6.2 GiB of 19.8 GiB) in 24s, read: 252.0 MiB/s, write: 252.0 MiB/s 315 | # /var/log/vzdump/qemu-107.log 2025-08-20 02:48:03 INFO: 34% (6.9 GiB of 19.8 GiB) in 27s, read: 230.7 MiB/s, write: 230.7 MiB/s 316 | # /var/log/vzdump/qemu-107.log 2025-08-20 02:48:06 INFO: 38% (7.6 GiB of 19.8 GiB) in 30s, read: 260.0 MiB/s, write: 253.3 MiB/s 317 | # /var/log/vzdump/qemu-107.log 2025-08-20 02:48:10 INFO: 40% (8.0 GiB of 19.8 GiB) in 34s, read: 96.0 MiB/s, write: 96.0 MiB/s 318 | # /var/log/vzdump/qemu-107.log 2025-08-20 02:48:13 INFO: 42% (8.3 GiB of 19.8 GiB) in 37s, read: 113.3 MiB/s, write: 113.3 MiB/s 319 | # /var/log/vzdump/qemu-107.log 2025-08-20 02:48:16 INFO: 43% (8.5 GiB of 19.8 GiB) in 40s, read: 72.0 MiB/s, write: 72.0 MiB/s 320 | # /var/log/vzdump/qemu-107.log 2025-08-20 02:48:28 INFO: 44% (8.7 GiB of 19.8 GiB) in 52s, read: 15.7 MiB/s, write: 15.7 MiB/s 321 | # /var/log/vzdump/qemu-107.log 2025-08-20 02:48:36 INFO: 45% (8.9 GiB of 19.8 GiB) in 1m, read: 24.0 MiB/s, write: 24.0 MiB/s 322 | # /var/log/vzdump/qemu-107.log 2025-08-20 02:48:44 INFO: 46% (9.1 GiB of 19.8 GiB) in 1m 8s, read: 26.0 MiB/s, write: 26.0 MiB/s 323 | # /var/log/vzdump/qemu-107.log 2025-08-20 02:48:55 INFO: 47% (9.3 GiB of 19.8 GiB) in 1m 19s, read: 17.5 MiB/s, write: 17.5 MiB/s 324 | # /var/log/vzdump/qemu-107.log 2025-08-20 02:49:05 INFO: 48% (9.5 GiB of 19.8 GiB) in 1m 29s, read: 21.6 MiB/s, write: 21.6 MiB/s 325 | # /var/log/vzdump/qemu-107.log 2025-08-20 02:49:10 INFO: 49% (9.7 GiB of 19.8 GiB) in 1m 34s, read: 44.0 MiB/s, write: 44.0 MiB/s 326 | # /var/log/vzdump/qemu-107.log 2025-08-20 02:49:13 INFO: 50% (9.9 GiB of 19.8 GiB) in 1m 37s, read: 74.7 MiB/s, write: 74.7 MiB/s 327 | # /var/log/vzdump/qemu-107.log 2025-08-20 02:49:16 INFO: 51% (10.1 GiB of 19.8 GiB) in 1m 40s, read: 56.0 MiB/s, write: 56.0 MiB/s 328 | # /var/log/vzdump/qemu-107.log 2025-08-20 02:49:19 INFO: 52% (10.3 GiB of 19.8 GiB) in 1m 43s, read: 61.3 MiB/s, write: 61.3 MiB/s 329 | # /var/log/vzdump/qemu-107.log 2025-08-20 02:49:22 INFO: 53% (10.7 GiB of 19.8 GiB) in 1m 46s, read: 132.0 MiB/s, write: 130.7 MiB/s 330 | # /var/log/vzdump/qemu-107.log 2025-08-20 02:49:25 INFO: 54% (10.8 GiB of 19.8 GiB) in 1m 49s, read: 30.7 MiB/s, write: 30.7 MiB/s 331 | # /var/log/vzdump/qemu-107.log 2025-08-20 02:49:33 INFO: 55% (10.9 GiB of 19.8 GiB) in 1m 57s, read: 17.5 MiB/s, write: 17.5 MiB/s 332 | # /var/log/vzdump/qemu-107.log 2025-08-20 02:49:39 INFO: 56% (11.1 GiB of 19.8 GiB) in 2m 3s, read: 36.0 MiB/s, write: 36.0 MiB/s 333 | # /var/log/vzdump/qemu-107.log 2025-08-20 02:49:42 INFO: 59% (11.7 GiB of 19.8 GiB) in 2m 6s, read: 192.0 MiB/s, write: 192.0 MiB/s 334 | # /var/log/vzdump/qemu-107.log 2025-08-20 02:49:45 INFO: 62% (12.3 GiB of 19.8 GiB) in 2m 9s, read: 218.7 MiB/s, write: 217.3 MiB/s 335 | # /var/log/vzdump/qemu-107.log 2025-08-20 02:49:48 INFO: 64% (12.9 GiB of 19.8 GiB) in 2m 12s, read: 182.7 MiB/s, write: 182.7 MiB/s 336 | # /var/log/vzdump/qemu-107.log 2025-08-20 02:49:51 INFO: 67% (13.4 GiB of 19.8 GiB) in 2m 15s, read: 186.7 MiB/s, write: 186.7 MiB/s 337 | # /var/log/vzdump/qemu-107.log 2025-08-20 02:49:54 INFO: 69% (13.8 GiB of 19.8 GiB) in 2m 18s, read: 132.0 MiB/s, write: 129.3 MiB/s 338 | # /var/log/vzdump/qemu-107.log 2025-08-20 02:49:57 INFO: 72% (14.3 GiB of 19.8 GiB) in 2m 21s, read: 174.7 MiB/s, write: 174.7 MiB/s 339 | # /var/log/vzdump/qemu-107.log 2025-08-20 02:50:01 INFO: 73% (14.5 GiB of 19.8 GiB) in 2m 25s, read: 59.0 MiB/s, write: 59.0 MiB/s 340 | # /var/log/vzdump/qemu-107.log 2025-08-20 02:50:04 INFO: 75% (15.0 GiB of 19.8 GiB) in 2m 28s, read: 173.3 MiB/s, write: 172.0 MiB/s 341 | # /var/log/vzdump/qemu-107.log 2025-08-20 02:50:07 INFO: 76% (15.1 GiB of 19.8 GiB) in 2m 31s, read: 38.7 MiB/s, write: 38.7 MiB/s 342 | # /var/log/vzdump/qemu-107.log 2025-08-20 02:50:10 INFO: 77% (15.2 GiB of 19.8 GiB) in 2m 34s, read: 34.7 MiB/s, write: 33.3 MiB/s 343 | # /var/log/vzdump/qemu-107.log 2025-08-20 02:50:14 INFO: 78% (15.4 GiB of 19.8 GiB) in 2m 38s, read: 47.0 MiB/s, write: 47.0 MiB/s 344 | # /var/log/vzdump/qemu-107.log 2025-08-20 02:50:18 INFO: 79% (15.7 GiB of 19.8 GiB) in 2m 42s, read: 63.0 MiB/s, write: 62.0 MiB/s 345 | # /var/log/vzdump/qemu-107.log 2025-08-20 02:50:21 INFO: 80% (15.9 GiB of 19.8 GiB) in 2m 45s, read: 62.7 MiB/s, write: 62.7 MiB/s 346 | # /var/log/vzdump/qemu-107.log 2025-08-20 02:50:25 INFO: 81% (16.1 GiB of 19.8 GiB) in 2m 49s, read: 52.0 MiB/s, write: 49.0 MiB/s 347 | # /var/log/vzdump/qemu-107.log 2025-08-20 02:50:29 INFO: 82% (16.3 GiB of 19.8 GiB) in 2m 53s, read: 60.0 MiB/s, write: 58.0 MiB/s 348 | # /var/log/vzdump/qemu-107.log 2025-08-20 02:50:32 INFO: 83% (16.5 GiB of 19.8 GiB) in 2m 56s, read: 69.3 MiB/s, write: 69.3 MiB/s 349 | # /var/log/vzdump/qemu-107.log 2025-08-20 02:50:35 INFO: 84% (16.7 GiB of 19.8 GiB) in 2m 59s, read: 65.3 MiB/s, write: 64.0 MiB/s 350 | # /var/log/vzdump/qemu-107.log 2025-08-20 02:50:38 INFO: 85% (16.9 GiB of 19.8 GiB) in 3m 2s, read: 57.3 MiB/s, write: 57.3 MiB/s 351 | # /var/log/vzdump/qemu-107.log 2025-08-20 02:50:41 INFO: 86% (17.1 GiB of 19.8 GiB) in 3m 5s, read: 74.7 MiB/s, write: 72.0 MiB/s 352 | # /var/log/vzdump/qemu-107.log 2025-08-20 02:50:44 INFO: 87% (17.3 GiB of 19.8 GiB) in 3m 8s, read: 82.7 MiB/s, write: 81.3 MiB/s 353 | # /var/log/vzdump/qemu-107.log 2025-08-20 02:50:47 INFO: 88% (17.6 GiB of 19.8 GiB) in 3m 11s, read: 78.7 MiB/s, write: 76.0 MiB/s 354 | # /var/log/vzdump/qemu-107.log 2025-08-20 02:50:50 INFO: 89% (17.8 GiB of 19.8 GiB) in 3m 14s, read: 85.3 MiB/s, write: 84.0 MiB/s 355 | # /var/log/vzdump/qemu-107.log 2025-08-20 02:50:53 INFO: 90% (18.0 GiB of 19.8 GiB) in 3m 17s, read: 52.0 MiB/s, write: 45.3 MiB/s 356 | # /var/log/vzdump/qemu-107.log 2025-08-20 02:50:56 INFO: 92% (18.2 GiB of 19.8 GiB) in 3m 20s, read: 93.3 MiB/s, write: 86.7 MiB/s 357 | # /var/log/vzdump/qemu-107.log 2025-08-20 02:50:59 INFO: 93% (18.5 GiB of 19.8 GiB) in 3m 23s, read: 88.0 MiB/s, write: 76.0 MiB/s 358 | # /var/log/vzdump/qemu-107.log 2025-08-20 02:51:02 INFO: 94% (18.7 GiB of 19.8 GiB) in 3m 26s, read: 78.7 MiB/s, write: 70.7 MiB/s 359 | # /var/log/vzdump/qemu-107.log 2025-08-20 02:51:07 INFO: 95% (18.8 GiB of 19.8 GiB) in 3m 31s, read: 17.6 MiB/s, write: 16.0 MiB/s 360 | # /var/log/vzdump/qemu-107.log 2025-08-20 02:51:13 INFO: 96% (19.0 GiB of 19.8 GiB) in 3m 37s, read: 38.0 MiB/s, write: 36.0 MiB/s 361 | # /var/log/vzdump/qemu-107.log 2025-08-20 02:51:16 INFO: 97% (19.2 GiB of 19.8 GiB) in 3m 40s, read: 69.3 MiB/s, write: 66.7 MiB/s 362 | # /var/log/vzdump/qemu-107.log 2025-08-20 02:51:19 INFO: 98% (19.4 GiB of 19.8 GiB) in 3m 43s, read: 68.0 MiB/s, write: 64.0 MiB/s 363 | # /var/log/vzdump/qemu-107.log 2025-08-20 02:51:22 INFO: 99% (19.7 GiB of 19.8 GiB) in 3m 46s, read: 101.3 MiB/s, write: 100.0 MiB/s 364 | # /var/log/vzdump/qemu-107.log 2025-08-20 02:51:25 INFO: 100% (19.8 GiB of 19.8 GiB) in 3m 49s, read: 20.0 MiB/s, write: 17.3 MiB/s 365 | # /var/log/vzdump/qemu-107.log 2025-08-20 02:52:23 INFO: backup is sparse: 48.00 MiB (0%) total zero data 366 | # /var/log/vzdump/qemu-107.log 2025-08-20 02:52:23 INFO: backup was done incrementally, reused 300.49 GiB (93%) 367 | # /var/log/vzdump/qemu-107.log 2025-08-20 02:52:23 INFO: transferred 19.79 GiB in 287 seconds (70.6 MiB/s) 368 | # /var/log/vzdump/qemu-107.log 2025-08-20 02:52:23 INFO: adding notes to backup 369 | # /var/log/vzdump/qemu-107.log 2025-08-20 02:52:23 INFO: ----- vzdump scirpt HOOK: backup-end snapshot 107 370 | # /var/log/vzdump/qemu-107.log 2025-08-20 02:52:23 INFO: HOOK-ENV: vmid=107;vmtype=qemu;dumpdir=;storeid=pbs01-fs01;hostname=server02.mm.lan;tarfile=;logfile= 371 | # /var/log/vzdump/qemu-107.log 2025-08-20 02:52:23 INFO: Finished Backup of VM 107 (00:04:49) 372 | 373 | 374 | 375 | 376 | # LXC-MACHINE;;;;;/etc/pve/lxc/102.conf;;;;;monitoring01.mm.lan 377 | # /var/log/vzdump/lxc-102.log 2025-08-20 02:01:32 INFO: Starting Backup of VM 102 (lxc) 378 | # /var/log/vzdump/lxc-102.log 2025-08-20 02:01:32 INFO: status = running 379 | # /var/log/vzdump/lxc-102.log 2025-08-20 02:01:32 INFO: CT Name: monitoring01.mm.lan 380 | # /var/log/vzdump/lxc-102.log 2025-08-20 02:01:32 INFO: including mount point rootfs ('/') in backup 381 | # /var/log/vzdump/lxc-102.log 2025-08-20 02:01:32 INFO: backup mode: snapshot 382 | # /var/log/vzdump/lxc-102.log 2025-08-20 02:01:32 INFO: ionice priority: 7 383 | # /var/log/vzdump/lxc-102.log 2025-08-20 02:01:32 INFO: ----- vzdump scirpt HOOK: backup-start snapshot 102 384 | # /var/log/vzdump/lxc-102.log 2025-08-20 02:01:32 INFO: HOOK-ENV: vmid=102;vmtype=lxc;dumpdir=;storeid=pbs01-fs01;hostname=monitoring01.mm.lan;tarfile=;logfile= 385 | # /var/log/vzdump/lxc-102.log 2025-08-20 02:01:32 INFO: ----- vzdump scirpt HOOK: pre-stop snapshot 102 386 | # /var/log/vzdump/lxc-102.log 2025-08-20 02:01:32 INFO: HOOK-ENV: vmid=102;vmtype=lxc;dumpdir=;storeid=pbs01-fs01;hostname=monitoring01.mm.lan;tarfile=;logfile= 387 | # /var/log/vzdump/lxc-102.log 2025-08-20 02:01:32 INFO: create storage snapshot 'vzdump' 388 | # /var/log/vzdump/lxc-102.log 2025-08-20 02:01:33 INFO: ----- vzdump scirpt HOOK: pre-restart snapshot 102 389 | # /var/log/vzdump/lxc-102.log 2025-08-20 02:01:33 INFO: HOOK-ENV: vmid=102;vmtype=lxc;dumpdir=;storeid=pbs01-fs01;hostname=monitoring01.mm.lan;tarfile=;logfile= 390 | # /var/log/vzdump/lxc-102.log 2025-08-20 02:01:33 INFO: ----- vzdump scirpt HOOK: post-restart snapshot 102 391 | # /var/log/vzdump/lxc-102.log 2025-08-20 02:01:33 INFO: HOOK-ENV: vmid=102;vmtype=lxc;dumpdir=;storeid=pbs01-fs01;hostname=monitoring01.mm.lan;tarfile=;logfile= 392 | # /var/log/vzdump/lxc-102.log 2025-08-20 02:01:33 INFO: creating Proxmox Backup Server archive 'ct/102/2025-08-20T00:01:32Z' 393 | # /var/log/vzdump/lxc-102.log 2025-08-20 02:01:33 INFO: set max number of entries in memory for file-based backups to 1048576 394 | # /var/log/vzdump/lxc-102.log 2025-08-20 02:01:33 INFO: run: lxc-usernsexec -m u:0:100000:65536 -m g:0:100000:65536 -- /usr/bin/proxmox-backup-client backup --cryp208542_102/etc/vzdump/pct.conf root.pxar:/mnt/vzsnap0 --include-dev /mnt/vzsnap0/./ --skip-lost-and-found --exclude=/tmp/?* --exclude=/var/tmp/?* --exclude=/var/102 --backup-time 1755648092 --entries-max 1048576 --repository user_mmlan@pbs@172.31.0.248:fs01 --ns mmlan 395 | # /var/log/vzdump/lxc-102.log 2025-08-20 02:01:33 INFO: Starting backup: [mmlan]:ct/102/2025-08-20T00:01:32Z 396 | # /var/log/vzdump/lxc-102.log 2025-08-20 02:01:33 INFO: Client name: pve01 397 | # /var/log/vzdump/lxc-102.log 2025-08-20 02:01:33 INFO: Starting backup protocol: Wed Aug 20 02:01:33 2025 398 | # /var/log/vzdump/lxc-102.log 2025-08-20 02:01:33 INFO: Downloading previous manifest (Tue Aug 19 02:02:10 2025) 399 | # /var/log/vzdump/lxc-102.log 2025-08-20 02:01:33 INFO: Upload config file '/var/tmp/vzdumptmp1208542_102/etc/vzdump/pct.conf' to 'user_mmlan@pbs@172.31.0.248:8007 400 | # /var/log/vzdump/lxc-102.log 2025-08-20 02:01:33 INFO: Upload directory '/mnt/vzsnap0' to 'user_mmlan@pbs@172.31.0.248:8007:fs01' as root.pxar.didx 401 | # /var/log/vzdump/lxc-102.log 2025-08-20 02:02:33 INFO: processed 7.805 GiB in 1m, uploaded 1.393 GiB 402 | # /var/log/vzdump/lxc-102.log 2025-08-20 02:03:33 INFO: processed 12.65 GiB in 2m, uploaded 1.446 GiB 403 | # /var/log/vzdump/lxc-102.log 2025-08-20 02:03:46 INFO: root.pxar: had to backup 1.58 GiB of 16.308 GiB (compressed 286.611 MiB) in 133.26 s (average 12.141 MiB/s) 404 | # /var/log/vzdump/lxc-102.log 2025-08-20 02:03:46 INFO: root.pxar: backup was done incrementally, reused 14.728 GiB (90.3%) 405 | # /var/log/vzdump/lxc-102.log 2025-08-20 02:03:46 INFO: Uploaded backup catalog (9.827 MiB) 406 | # /var/log/vzdump/lxc-102.log 2025-08-20 02:03:49 INFO: Duration: 135.90s 407 | # /var/log/vzdump/lxc-102.log 2025-08-20 02:03:49 INFO: End Time: Wed Aug 20 02:03:49 2025 408 | # /var/log/vzdump/lxc-102.log 2025-08-20 02:03:49 INFO: adding notes to backup 409 | # /var/log/vzdump/lxc-102.log 2025-08-20 02:03:49 INFO: ----- vzdump scirpt HOOK: backup-end snapshot 102 410 | # /var/log/vzdump/lxc-102.log 2025-08-20 02:03:49 INFO: HOOK-ENV: vmid=102;vmtype=lxc;dumpdir=;storeid=pbs01-fs01;hostname=monitoring01.mm.lan;tarfile=;logfile= 411 | # /var/log/vzdump/lxc-102.log 2025-08-20 02:03:51 INFO: cleanup temporary 'vzdump' snapshot 412 | # /var/log/vzdump/lxc-102.log 2025-08-20 02:03:52 INFO: Finished Backup of VM 102 (00:02:20) 413 | --------------------------------------------------------------------------------