GUI CSS: Removed snapin styles from py modules and added a _snapins.scss for the...
[check_mk.git] / checks / veeam_jobs
blob03a2dafea74a616305b5a5d0668b2b6f38d49919
1 #!/usr/bin/python
2 # -*- encoding: utf-8; py-indent-offset: 4 -*-
3 # +------------------------------------------------------------------+
4 # | ____ _ _ __ __ _ __ |
5 # | / ___| |__ ___ ___| | __ | \/ | |/ / |
6 # | | | | '_ \ / _ \/ __| |/ / | |\/| | ' / |
7 # | | |___| | | | __/ (__| < | | | | . \ |
8 # | \____|_| |_|\___|\___|_|\_\___|_| |_|_|\_\ |
9 # | |
10 # | Copyright Mathias Kettner 2014 mk@mathias-kettner.de |
11 # +------------------------------------------------------------------+
13 # This file is part of Check_MK.
14 # The official homepage is at http://mathias-kettner.de/check_mk.
16 # check_mk is free software; you can redistribute it and/or modify it
17 # under the terms of the GNU General Public License as published by
18 # the Free Software Foundation in version 2. check_mk is distributed
19 # in the hope that it will be useful, but WITHOUT ANY WARRANTY; with-
20 # out even the implied warranty of MERCHANTABILITY or FITNESS FOR A
21 # PARTICULAR PURPOSE. See the GNU General Public License for more de-
22 # tails. You should have received a copy of the GNU General Public
23 # License along with GNU Make; see the file COPYING. If not, write
24 # to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
25 # Boston, MA 02110-1301 USA.
27 # <<<veeam_jobs:sep(9) >>>
28 # BACKUP_RIS Backup Stopped Success 27.10.2013 22:00:17 27.10.2013 22:06:12
29 # BACKUP_R43-local_HXWH44 Backup Stopped Success 26.10.2013 18:00:20 26.10.2013 18:46:03
30 # BACKUP_R43-Pool4_HXWH44 Backup Stopped Failed 26.10.2013 23:13:13 27.10.2013 00:51:17
31 # BACKUP_R43-Pool3_HXWH44 Backup Stopped Failed 27.10.2013 02:59:29 27.10.2013 08:59:51
32 # REPL_KNESXIDMZ Replica Stopped Success 27.10.2013 44:00:01 27.10.2013 44:44:26
33 # BACKUP_KNESXI Backup Stopped Success 28.10.2013 05:00:04 28.10.2013 05:32:15
34 # BACKUP_KNESXit Backup Stopped Success 26.10.2013 22:30:02 27.10.2013 02:37:30
35 # BACKUP_R43-Pool5_HXWH44 Backup Stopped Success 27.10.2013 23:00:00 27.10.2013 23:04:53
36 # BACKUP_R43-Pool2_HXWH44 Backup Stopped Failed 27.10.2013 02:37:45 27.10.2013 02:45:35
39 def inventory_veeam_jobs(info):
40 return [(x[0], None) for x in info]
43 def check_veeam_jobs(item, _no_params, info):
44 for line in info:
45 if line[0] == item:
46 backup_type = line[1]
47 backup_status = line[3]
48 backup_current = line[2]
50 if backup_status == "Success":
51 state = 0
52 elif backup_current == 'Idle' and backup_type == "BackupSync":
53 # A sync job is always idle
54 state = 0
55 elif backup_current in ["Working", "Postprocessing"]:
56 state = 0
57 line = line[:6]
58 elif backup_status == "Failed":
59 state = 2
60 elif backup_current == "Stopped" and backup_status == "Warning":
61 state = 1
62 else:
63 state = 3
64 infotxt = "Result: %s, " % line[3]
65 infotxt += ", ".join(line[1:3] + line[4:])
66 return (state, infotxt)
68 return 3, "No such job found"
71 check_info["veeam_jobs"] = {
72 'check_function': check_veeam_jobs,
73 'inventory_function': inventory_veeam_jobs,
74 'service_description': 'VEEAM Job %s',