diff --git a/CHANGELOG.md b/CHANGELOG.md index 21930ade..1175aa68 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -64,6 +64,7 @@ Monitoring Plugins: * sap-open-concur: Add new parameters `--insecure` * statuspal: Add new parameters `--insecure` `--no-proxy` `--timeout` * swap-usage: Report the top 3 processes causing the usage (Linux only) +* veeam-status: Add new parameters `--insecure` `--no-proxy` * xml: Add new parameter `--insecure` diff --git a/check-plugins/veeam-status/README.rst b/check-plugins/veeam-status/README.rst index 7c974647..d07760ed 100644 --- a/check-plugins/veeam-status/README.rst +++ b/check-plugins/veeam-status/README.rst @@ -40,10 +40,11 @@ Help usage: veeam-status [-h] [-V] [--always-ok] [-c CRIT] [--failed-job-runs FAILED_JOB_RUNS] [--failed-vm-lastest-states FAILED_VM_LASTEST_STATES] + [--insecure] [--max-backup-job-duration MAX_BACKUP_JOB_DURATION] - [--max-replica-job-duration MAX_REPLICA_JOB_DURATION] -p - PASSWORD [--test TEST] [--timeout TIMEOUT] [--url URL] - --username USERNAME [-w WARN] + [--max-replica-job-duration MAX_REPLICA_JOB_DURATION] + [--no-proxy] -p PASSWORD [--test TEST] [--timeout TIMEOUT] + [--url URL] --username USERNAME [-w WARN] [--warnings-job-runs WARNINGS_JOB_RUNS] [--warning-vm-lastest-states WARNING_VM_LASTEST_STATES] @@ -67,12 +68,15 @@ Help --failed-vm-lastest-states FAILED_VM_LASTEST_STATES Veeam threshold for `FailedVmLastestStates`. Default: > 0 + --insecure This option explicitly allows to perform "insecure" + SSL connections. Default: True --max-backup-job-duration MAX_BACKUP_JOB_DURATION Veeam threshold for `MaxBackupJobDuration`. Default: > 86400 --max-replica-job-duration MAX_REPLICA_JOB_DURATION Veeam threshold for `MaxDurationReplicaJobName`. Default: > 86400 + --no-proxy Do not use a proxy. Default: False -p PASSWORD, --password PASSWORD Veeam API password. --test TEST For unit tests. Needs "path-to-stdout-file,path-to- diff --git a/check-plugins/veeam-status/icingaweb2-module-director/veeam-status.json b/check-plugins/veeam-status/icingaweb2-module-director/veeam-status.json index 565084f0..283f5cce 100644 --- a/check-plugins/veeam-status/icingaweb2-module-director/veeam-status.json +++ b/check-plugins/veeam-status/icingaweb2-module-director/veeam-status.json @@ -14,12 +14,18 @@ "--failed-vm-lastest-states": { "value": "$veeam_status_failed_vm_lastest_states$" }, + "--insecure": { + "set_if": "$veeam_status_insecure$" + }, "--max-backup-job-duration": { "value": "$veeam_status_max_backup_job_duration$" }, "--max-replica-job-duration": { "value": "$veeam_status_max_replica_job_duration$" }, + "--no-proxy": { + "set_if": "$veeam_status_no_proxy$" + }, "--password": { "value": "$veeam_status_password$" }, @@ -46,67 +52,77 @@ "disabled": false, "fields": [ { - "datafield_id": 400, + "datafield_id": 1, + "is_required": "n", + "var_filter": null + }, + { + "datafield_id": 2, + "is_required": "n", + "var_filter": null + }, + { + "datafield_id": 3, "is_required": "n", "var_filter": null }, { - "datafield_id": 401, + "datafield_id": 4, "is_required": "n", "var_filter": null }, { - "datafield_id": 402, + "datafield_id": 5, "is_required": "n", "var_filter": null }, { - "datafield_id": 403, + "datafield_id": 6, "is_required": "n", "var_filter": null }, { - "datafield_id": 404, + "datafield_id": 7, "is_required": "n", "var_filter": null }, { - "datafield_id": 405, + "datafield_id": 8, "is_required": "n", "var_filter": null }, { - "datafield_id": 406, + "datafield_id": 9, "is_required": "y", "var_filter": null }, { - "datafield_id": 407, + "datafield_id": 10, "is_required": "n", "var_filter": null }, { - "datafield_id": 408, + "datafield_id": 11, "is_required": "n", "var_filter": null }, { - "datafield_id": 409, + "datafield_id": 12, "is_required": "y", "var_filter": null }, { - "datafield_id": 410, + "datafield_id": 13, "is_required": "n", "var_filter": null }, { - "datafield_id": 411, + "datafield_id": 14, "is_required": "n", "var_filter": null }, { - "datafield_id": 412, + "datafield_id": 15, "is_required": "n", "var_filter": null } @@ -135,12 +151,18 @@ "--failed-vm-lastest-states": { "value": "$veeam_status_windows_failed_vm_lastest_states$" }, + "--insecure": { + "set_if": "$veeam_status_windows_insecure$" + }, "--max-backup-job-duration": { "value": "$veeam_status_windows_max_backup_job_duration$" }, "--max-replica-job-duration": { "value": "$veeam_status_windows_max_replica_job_duration$" }, + "--no-proxy": { + "set_if": "$veeam_status_windows_no_proxy$" + }, "--password": { "value": "$veeam_status_windows_password$" }, @@ -167,67 +189,77 @@ "disabled": false, "fields": [ { - "datafield_id": 413, + "datafield_id": 16, + "is_required": "n", + "var_filter": null + }, + { + "datafield_id": 17, + "is_required": "n", + "var_filter": null + }, + { + "datafield_id": 18, "is_required": "n", "var_filter": null }, { - "datafield_id": 414, + "datafield_id": 19, "is_required": "n", "var_filter": null }, { - "datafield_id": 415, + "datafield_id": 20, "is_required": "n", "var_filter": null }, { - "datafield_id": 416, + "datafield_id": 21, "is_required": "n", "var_filter": null }, { - "datafield_id": 417, + "datafield_id": 22, "is_required": "n", "var_filter": null }, { - "datafield_id": 418, + "datafield_id": 23, "is_required": "n", "var_filter": null }, { - "datafield_id": 419, + "datafield_id": 24, "is_required": "y", "var_filter": null }, { - "datafield_id": 420, + "datafield_id": 25, "is_required": "n", "var_filter": null }, { - "datafield_id": 421, + "datafield_id": 26, "is_required": "n", "var_filter": null }, { - "datafield_id": 422, + "datafield_id": 27, "is_required": "y", "var_filter": null }, { - "datafield_id": 423, + "datafield_id": 28, "is_required": "n", "var_filter": null }, { - "datafield_id": 424, + "datafield_id": 29, "is_required": "n", "var_filter": null }, { - "datafield_id": 425, + "datafield_id": 30, "is_required": "n", "var_filter": null } @@ -305,8 +337,10 @@ "veeam_status_critical": 90, "veeam_status_failed_job_runs": 0, "veeam_status_failed_vm_lastest_states": 0, + "veeam_status_insecure": true, "veeam_status_max_backup_job_duration": 86400, "veeam_status_max_replica_job_duration": 86400, + "veeam_status_no_proxy": false, "veeam_status_timeout": 3, "veeam_status_url": "https://localhost:9398", "veeam_status_username": "Administrator", @@ -362,8 +396,10 @@ "veeam_status_windows_critical": 90, "veeam_status_windows_failed_job_runs": 0, "veeam_status_windows_failed_vm_lastest_states": 0, + "veeam_status_windows_insecure": true, "veeam_status_windows_max_backup_job_duration": 86400, "veeam_status_windows_max_replica_job_duration": 86400, + "veeam_status_windows_no_proxy": false, "veeam_status_windows_timeout": 3, "veeam_status_windows_url": "https://localhost:9398", "veeam_status_windows_username": "Administrator", @@ -377,7 +413,7 @@ } }, "Datafield": { - "400": { + "1": { "varname": "veeam_status_always_ok", "caption": "Veeam Status: Always OK?", "description": "Always returns OK.", @@ -386,7 +422,7 @@ "settings": {}, "uuid": "8424ac5b-e0ee-4398-afb1-046298a29706" }, - "401": { + "2": { "varname": "veeam_status_critical", "caption": "Veeam Status: Critical", "description": "Set the CRIT threshold for Backup Size as a percentage.", @@ -397,7 +433,7 @@ }, "uuid": "e09d3854-91e9-4343-946f-67704cca5e45" }, - "402": { + "3": { "varname": "veeam_status_failed_job_runs", "caption": "Veeam Status: Failed Job Runs", "description": "Veeam threshold for `FailedJobRuns`.", @@ -408,7 +444,7 @@ }, "uuid": "4bb25d51-9b8e-40ce-9dca-026caefa3438" }, - "403": { + "4": { "varname": "veeam_status_failed_vm_lastest_states", "caption": "Veeam Status: Failed VM Lastest States", "description": "Veeam threshold for `FailedVmLastestStates`.", @@ -419,7 +455,16 @@ }, "uuid": "6b2097c1-da7e-46f8-93c7-d5ea7708cf3b" }, - "404": { + "5": { + "varname": "veeam_status_insecure", + "caption": "Veeam Status: Insecure?", + "description": "This option explicitly allows to perform \"insecure\" SSL connections.", + "datatype": "Icinga\\Module\\Director\\DataType\\DataTypeBoolean", + "format": null, + "settings": {}, + "uuid": "398c2388-945a-4f9d-a05c-75782f9d2c3a" + }, + "6": { "varname": "veeam_status_max_backup_job_duration", "caption": "Veeam Status: Max Backup Job Duration", "description": "Veeam threshold for `MaxBackupJobDuration`.", @@ -430,7 +475,7 @@ }, "uuid": "6b868377-e059-4238-995f-fd3490eebc07" }, - "405": { + "7": { "varname": "veeam_status_max_replica_job_duration", "caption": "Veeam Status: Max Replica Job Duration", "description": "Veeam threshold for `MaxDurationReplicaJobName`.", @@ -441,7 +486,16 @@ }, "uuid": "ba2d3b23-1ff4-42e2-8586-359c12bb2d18" }, - "406": { + "8": { + "varname": "veeam_status_no_proxy", + "caption": "Veeam Status: No Proxy?", + "description": "Do not use a proxy.", + "datatype": "Icinga\\Module\\Director\\DataType\\DataTypeBoolean", + "format": null, + "settings": {}, + "uuid": "7c5e32a1-ca4c-43bf-98c9-5390386f0747" + }, + "9": { "varname": "veeam_status_password", "caption": "Veeam Status: Password", "description": "Veeam API password.", @@ -452,7 +506,7 @@ }, "uuid": "0878e0fc-6eb0-4b88-9c9e-e2f3b2d460ec" }, - "407": { + "10": { "varname": "veeam_status_timeout", "caption": "Veeam Status: Timeout", "description": "Network timeout in seconds.", @@ -463,7 +517,7 @@ }, "uuid": "87bcb255-ae66-4fb3-acfd-f554534e41e3" }, - "408": { + "11": { "varname": "veeam_status_url", "caption": "Veeam Status: URL", "description": "Veeam API URL.", @@ -474,7 +528,7 @@ }, "uuid": "8c34a0a4-f71e-42f3-86ba-20cb60ebd564" }, - "409": { + "12": { "varname": "veeam_status_username", "caption": "Veeam Status: Username", "description": "Veeam API username.", @@ -485,7 +539,7 @@ }, "uuid": "ca0a643b-b290-4c2a-9b1b-e434152fa737" }, - "410": { + "13": { "varname": "veeam_status_warning", "caption": "Veeam Status: Warning", "description": "Set the WARN threshold for Backup Size as a percentage.", @@ -496,7 +550,7 @@ }, "uuid": "a144730c-9cad-4a91-8145-7c1caee6b58d" }, - "411": { + "14": { "varname": "veeam_status_warnings_job_runs", "caption": "Veeam Status: Warnings Job Runs", "description": "Veeam threshold for `WarningsJobRuns`.", @@ -507,7 +561,7 @@ }, "uuid": "bc63a9a9-01fa-44b6-8ed2-02fa09f349fc" }, - "412": { + "15": { "varname": "veeam_status_warning_vm_lastest_states", "caption": "Veeam Status: Warning VM Lastest States", "description": "Veeam threshold for `WarningVmLastestStates`.", @@ -518,7 +572,7 @@ }, "uuid": "0bfd1ab3-97c2-424d-b347-3f1241125eda" }, - "413": { + "16": { "varname": "veeam_status_windows_always_ok", "caption": "Veeam Status: Always OK?", "description": "Always returns OK.", @@ -527,7 +581,7 @@ "settings": {}, "uuid": "82937ca5-a6a6-4f78-9536-586b2c6411f6" }, - "414": { + "17": { "varname": "veeam_status_windows_critical", "caption": "Veeam Status: Critical", "description": "Set the CRIT threshold for Backup Size as a percentage.", @@ -538,7 +592,7 @@ }, "uuid": "af34fa66-4969-4e20-8adf-bc072f7a2262" }, - "415": { + "18": { "varname": "veeam_status_windows_failed_job_runs", "caption": "Veeam Status: Failed Job Runs", "description": "Veeam threshold for `FailedJobRuns`.", @@ -549,7 +603,7 @@ }, "uuid": "31eb7fc3-6e1b-456a-866d-82519d17ec68" }, - "416": { + "19": { "varname": "veeam_status_windows_failed_vm_lastest_states", "caption": "Veeam Status: Failed VM Lastest States", "description": "Veeam threshold for `FailedVmLastestStates`.", @@ -560,7 +614,16 @@ }, "uuid": "75677530-cc16-4bf8-bec7-d6dc7abe090b" }, - "417": { + "20": { + "varname": "veeam_status_windows_insecure", + "caption": "Veeam Status: Insecure?", + "description": "This option explicitly allows to perform \"insecure\" SSL connections.", + "datatype": "Icinga\\Module\\Director\\DataType\\DataTypeBoolean", + "format": null, + "settings": {}, + "uuid": "6f46bd70-fb83-48bf-9799-73156c23e315" + }, + "21": { "varname": "veeam_status_windows_max_backup_job_duration", "caption": "Veeam Status: Max Backup Job Duration", "description": "Veeam threshold for `MaxBackupJobDuration`.", @@ -571,7 +634,7 @@ }, "uuid": "34132f3f-e133-4448-9676-aaf77377c701" }, - "418": { + "22": { "varname": "veeam_status_windows_max_replica_job_duration", "caption": "Veeam Status: Max Replica Job Duration", "description": "Veeam threshold for `MaxDurationReplicaJobName`.", @@ -582,7 +645,16 @@ }, "uuid": "4834e144-5431-4c63-84f4-072c88772926" }, - "419": { + "23": { + "varname": "veeam_status_windows_no_proxy", + "caption": "Veeam Status: No Proxy?", + "description": "Do not use a proxy.", + "datatype": "Icinga\\Module\\Director\\DataType\\DataTypeBoolean", + "format": null, + "settings": {}, + "uuid": "591ddcc8-8316-453e-905a-7424e95cdd9b" + }, + "24": { "varname": "veeam_status_windows_password", "caption": "Veeam Status: Password", "description": "Veeam API password.", @@ -593,7 +665,7 @@ }, "uuid": "ec27d695-95e5-4e98-b20d-617fa0709843" }, - "420": { + "25": { "varname": "veeam_status_windows_timeout", "caption": "Veeam Status: Timeout", "description": "Network timeout in seconds.", @@ -604,7 +676,7 @@ }, "uuid": "8fba3ef0-a1f9-41d3-95a2-3cdf52c7b89f" }, - "421": { + "26": { "varname": "veeam_status_windows_url", "caption": "Veeam Status: URL", "description": "Veeam API URL.", @@ -615,7 +687,7 @@ }, "uuid": "4aad865e-97fa-48ff-8bfb-bccbc76c127f" }, - "422": { + "27": { "varname": "veeam_status_windows_username", "caption": "Veeam Status: Username", "description": "Veeam API username.", @@ -626,7 +698,7 @@ }, "uuid": "d7d174cc-e843-4ecf-b8e6-0114f5880eb3" }, - "423": { + "28": { "varname": "veeam_status_windows_warning", "caption": "Veeam Status: Warning", "description": "Set the WARN threshold for Backup Size as a percentage.", @@ -637,7 +709,7 @@ }, "uuid": "39cba3d3-61f4-4113-a347-e287c3fcb988" }, - "424": { + "29": { "varname": "veeam_status_windows_warnings_job_runs", "caption": "Veeam Status: Warnings Job Runs", "description": "Veeam threshold for `WarningsJobRuns`.", @@ -648,7 +720,7 @@ }, "uuid": "050bb474-525a-44a2-9fd0-7116d69e248c" }, - "425": { + "30": { "varname": "veeam_status_windows_warning_vm_lastest_states", "caption": "Veeam Status: Warning VM Lastest States", "description": "Veeam threshold for `WarningVmLastestStates`.", diff --git a/check-plugins/veeam-status/veeam-status b/check-plugins/veeam-status/veeam-status index a1c38673..a1a90a5d 100755 --- a/check-plugins/veeam-status/veeam-status +++ b/check-plugins/veeam-status/veeam-status @@ -39,8 +39,10 @@ DESCRIPTION = """Checks Veeam for failed VM or jobs, jobs that are running too l DEFAULT_CRIT = 90 DEFAULT_FAILED_JOB_RUNS = 0 DEFAULT_FAILED_VM_LASTEST_STATES = 0 +DEFAULT_INSECURE = True DEFAULT_MAX_BACKUP_JOB_DURATION= 86400 DEFAULT_MAX_REPLICA_JOB_DURATION = 86400 +DEFAULT_NO_PROXY = False DEFAULT_TIMEOUT = 3 DEFAULT_URL = 'https://localhost:9398' DEFAULT_USERNAME = 'Administrator' @@ -70,7 +72,8 @@ def parse_args(): parser.add_argument( '-c', '--critical', - help='Set the CRIT threshold for Backup Size as a percentage. Default: >= %(default)s', + help='Set the CRIT threshold for Backup Size as a percentage. ' + 'Default: >= %(default)s', dest='CRIT', type=int, default=DEFAULT_CRIT, @@ -78,7 +81,8 @@ def parse_args(): parser.add_argument( '--failed-job-runs', - help='Veeam threshold for `FailedJobRuns`. Default: > %(default)s', + help='Veeam threshold for `FailedJobRuns`. ' + 'Default: > %(default)s', dest='FAILED_JOB_RUNS', type=int, default=DEFAULT_FAILED_JOB_RUNS, @@ -86,15 +90,26 @@ def parse_args(): parser.add_argument( '--failed-vm-lastest-states', - help='Veeam threshold for `FailedVmLastestStates`. Default: > %(default)s', + help='Veeam threshold for `FailedVmLastestStates`. ' + 'Default: > %(default)s', dest='FAILED_VM_LASTEST_STATES', type=int, default=DEFAULT_FAILED_VM_LASTEST_STATES, ) + parser.add_argument( + '--insecure', + help='This option explicitly allows to perform "insecure" SSL connections. ' + 'Default: %(default)s', + dest='INSECURE', + action='store_true', + default=DEFAULT_INSECURE, + ) + parser.add_argument( '--max-backup-job-duration', - help='Veeam threshold for `MaxBackupJobDuration`. Default: > %(default)s', + help='Veeam threshold for `MaxBackupJobDuration`. ' + 'Default: > %(default)s', dest='MAX_BACKUP_JOB_DURATION', type=int, default=DEFAULT_MAX_BACKUP_JOB_DURATION, @@ -102,12 +117,22 @@ def parse_args(): parser.add_argument( '--max-replica-job-duration', - help='Veeam threshold for `MaxDurationReplicaJobName`. Default: > %(default)s', + help='Veeam threshold for `MaxDurationReplicaJobName`. ' + 'Default: > %(default)s', dest='MAX_REPLICA_JOB_DURATION', type=int, default=DEFAULT_MAX_REPLICA_JOB_DURATION, ) + parser.add_argument( + '--no-proxy', + help='Do not use a proxy. ' + 'Default: %(default)s', + dest='NO_PROXY', + action='store_true', + default=DEFAULT_NO_PROXY, + ) + parser.add_argument( '-p', '--password', help='Veeam API password.', @@ -124,7 +149,8 @@ def parse_args(): parser.add_argument( '--timeout', - help='Network timeout in seconds. Default: %(default)s (seconds)', + help='Network timeout in seconds. ' + 'Default: %(default)s (seconds)', dest='TIMEOUT', type=int, default=DEFAULT_TIMEOUT, @@ -132,14 +158,16 @@ def parse_args(): parser.add_argument( '--url', - help='Veeam API URL. Default: %(default)s', + help='Veeam API URL. ' + 'Default: %(default)s', dest='URL', default=DEFAULT_URL, ) parser.add_argument( '--username', - help='Veeam API username. Default: %(default)s', + help='Veeam API username. ' + 'Default: %(default)s', dest='USERNAME', default=DEFAULT_USERNAME, required=True, @@ -147,7 +175,8 @@ def parse_args(): parser.add_argument( '-w', '--warning', - help='Set the WARN threshold for Backup Size as a percentage. Default: >= %(default)s', + help='Set the WARN threshold for Backup Size as a percentage. ' + 'Default: >= %(default)s', dest='WARN', type=int, default=DEFAULT_WARN, @@ -155,7 +184,8 @@ def parse_args(): parser.add_argument( '--warnings-job-runs', - help='Veeam threshold for `WarningsJobRuns`. Default: > %(default)s', + help='Veeam threshold for `WarningsJobRuns`. ' + 'Default: > %(default)s', dest='WARNINGS_JOB_RUNS', type=int, default=DEFAULT_WARNINGS_JOB_RUNS, @@ -163,7 +193,8 @@ def parse_args(): parser.add_argument( '--warning-vm-lastest-states', - help='Veeam threshold for `WarningVmLastestStates`. Default: > %(default)s', + help='Veeam threshold for `WarningVmLastestStates`. ' + 'Default: > %(default)s', dest='WARNING_VM_LASTEST_STATES', type=int, default=DEFAULT_WARNING_VM_LASTEST_STATES, @@ -197,25 +228,49 @@ def main(): # https://helpcenter.veeam.com/docs/backup/em_rest/reports_summary_overview.html?ver=110 url = args.URL + '/api/reports/summary/overview' result['overview'] = lib.base.coe( - lib.url.fetch_json(url, header=header, timeout=args.TIMEOUT, insecure=True), + lib.url.fetch_json( + url, + header=header, + insecure=args.INSECURE, + no_proxy=args.NO_PROXY, + timeout=args.TIMEOUT, + ), ) # https://helpcenter.veeam.com/docs/backup/em_rest/reports_summary_statistics.html?ver=110 url = args.URL + '/api/reports/summary/job_statistics' result['job_statistics'] = lib.base.coe( - lib.url.fetch_json(url, header=header, timeout=args.TIMEOUT, insecure=True), + lib.url.fetch_json( + url, + header=header, + insecure=args.INSECURE, + no_proxy=args.NO_PROXY, + timeout=args.TIMEOUT, + ), ) # https://helpcenter.veeam.com/docs/backup/em_rest/reports_summary_vms_overview.html?ver=110 url = args.URL + '/api/reports/summary/vms_overview' result['vms_overview'] = lib.base.coe( - lib.url.fetch_json(url, header=header, timeout=args.TIMEOUT, insecure=True), + lib.url.fetch_json( + url, + header=header, + insecure=args.INSECURE, + no_proxy=args.NO_PROXY, + timeout=args.TIMEOUT, + ), ) # https://helpcenter.veeam.com/docs/backup/em_rest/reports_summary_repository.html?ver=110 url = args.URL + '/api/reports/summary/repository' result['repository'] = lib.base.coe( - lib.url.fetch_json(url, header=header, timeout=args.TIMEOUT, insecure=True), + lib.url.fetch_json( + url, + header=header, + insecure=args.INSECURE, + no_proxy=args.NO_PROXY, + timeout=args.TIMEOUT, + ), ) else: # do not call the command, put in test data