diff --git a/README.md b/README.md index 3808e1e..3d2e001 100644 --- a/README.md +++ b/README.md @@ -74,13 +74,13 @@ options: Check if a job is runing longar than 7 days (default value): ```bash -check_bareos.py -u bareos -d p job -rt -t 4 -st R -w 1 -c 4 +check_bareos.py job -rt -t 4 -st R -w 1 -c 4 ``` Check how much jobs are in the wating status: ```bash -check_bareos.py -u bareos -d p job -js -w 50 -c 100 +check_bareos.py job -js -w 50 -c 100 ``` ## Tape @@ -113,19 +113,19 @@ options: Check how much tapes are empty in the storage: ```bash -check_bareos.py -u bareos -d p tape -e -w 15 -c 10 +check_bareos.py tape -e -w 15 -c 10 ``` Check how much tapes are expired: ``` -check_bareos.py -u bareos -d p tape -ex +check_bareos.py tape -ex ``` Check how much tapes will expire in the next 14 days; ```bash -check_bareos.py -u bareos -d p tape -wex -t 14 -w 10 -c 5 +check_bareos.py tape -wex -t 14 -w 10 -c 5 ``` ## Status @@ -164,35 +164,35 @@ options: Check total size of all backups: ```bash -check_bareos.py -u bareos -d p status -b -w 400 -c 500 +check_bareos.py status -b -w 400 -c 500 ``` Check total size of all full backups: ```bash -check_bareos.py -u bareos -d p status -b -f -w 400 -c 500 +check_bareos.py status -b -f -w 400 -c 500 ``` Check total size of all diff backups: ```bash -check_bareos.py -u bareos -d p status -b -d -w 400 -c 500 +check_bareos.py status -b -d -w 400 -c 500 ``` Check total size of all inc backups: ```bash -check_bareos.py -u bareos -d p status -b -i -w 400 -c 500 +check_bareos.py status -b -i -w 400 -c 500 ``` Check if a full backup has 0 Bytes(is Empty) and trigger warning it is at least 1 and trigger ciritcal if more than 5 are empty: ```bash -check_bareos.py -u bareos -d p status -e -f -w 1 -c 5 +check_bareos.py status -e -f -w 1 -c 5 ``` Check if a diff/inc backup is larger than 2 TB (default value) and trigger warning it is at least 1 and trigger ciritcal if more than 5 are empty: ```bash -check_bareos.py -u bareos -d p status -o -d -i -w 1 -c 5 +check_bareos.py status -o -d -i -w 1 -c 5 ``` diff --git a/check_bareos.py b/check_bareos.py index 49c2bd4..9bbb2a4 100755 --- a/check_bareos.py +++ b/check_bareos.py @@ -560,8 +560,8 @@ def commandline(args): jobParser.add_argument('-n', '--name', dest='name', action='store', help='Name of the job') jobParser.add_argument('-t', '--time', dest='time', action='store', help='Time in days (default=7 days)') jobParser.add_argument('-u', '--unit', dest='unit', choices=['GB', 'TB', 'PB'], default='TB', help='display unit') - jobParser.add_argument('-w', '--warning', dest='warning', action='store', help='Warning value', default=5) - jobParser.add_argument('-c', '--critical', dest='critical', action='store', help='Critical value', default=10) + jobParser.add_argument('-w', '--warning', dest='warning', action='store', help='Warning threshold', default=5) + jobParser.add_argument('-c', '--critical', dest='critical', action='store', help='Critical threshold', default=10) jobParser.add_argument('-st', '--state', dest='state', choices=JOBSTATES.keys(), default='C', help='Bareos Job State [default=C]') jobParser.add_argument('-f', '--full', dest='full', action='store_true', help='Backup kind full') jobParser.add_argument('-i', '--inc', dest='inc', action='store_true', help='Backup kind inc') @@ -575,8 +575,8 @@ def commandline(args): tapeGroup.add_argument('-ex', '--expiredTapes', dest='expiredTapes', action='store_true', help='Count how much tapes are expired') tapeGroup.add_argument('-wex', '--willExpire', dest='willExpire', action='store_true', help='Count how much tapes are will expire in n day') tapeGroup.add_argument('-r', '--replaceTapes', dest='replaceTapes', action='store_true', help='Count how much tapes should by replaced') - tapeParser.add_argument('-w', '--warning', dest='warning', action='store', help='Warning value', default=5) - tapeParser.add_argument('-c', '--critical', dest='critical', action='store', help='Critical value', default=10) + tapeParser.add_argument('-w', '--warning', dest='warning', action='store', help='Warning threshold', default=5) + tapeParser.add_argument('-c', '--critical', dest='critical', action='store', help='Critical threshold', default=10) tapeParser.add_argument('-m', '--mounts', dest='mounts', action='store', help='Amout of allowed mounts for a tape [used for replace tapes]', default=200) tapeParser.add_argument('-t', '--time', dest='time', action='store', help='Time in days (default=7 days)', default=7) @@ -591,8 +591,8 @@ def commandline(args): statusParser.add_argument('-i', '--inc', dest='inc', action='store_true', help='Backup kind inc') statusParser.add_argument('-d', '--diff', dest='diff', action='store_true', help='Backup kind diff') statusParser.add_argument('-t', '--time', dest='time', action='store', help='Time in days') - statusParser.add_argument('-w', '--warning', dest='warning', action='store', help='Warning value [default=5]', default=5) - statusParser.add_argument('-c', '--critical', dest='critical', action='store', help='Critical value [default=10]', default=10) + statusParser.add_argument('-w', '--warning', dest='warning', action='store', help='Warning threshold [default=5]', default="5") + statusParser.add_argument('-c', '--critical', dest='critical', action='store', help='Critical threshold [default=10]', default="10") statusParser.add_argument('-s', '--size', dest='size', action='store', help='Border value for oversized backups [default=2]', default=2) statusParser.add_argument('-u', '--unit', dest='unit', choices=['MB', 'GB', 'TB', 'PB', 'EB'], default='TB', help='display unit [default=TB]')