1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
|
OK = 0
WARN = 1
CRIT = 2
UNKNOWN = 3
def inventory_timezone_status(info):
try:
inventory = []
inventory.append(('timezone',info[0]))
return inventory
except Exception, e:
return []
def check_timezone_status(item, params, info):
try:
if params[0] == info[0][0]:
return (OK, 'system timezone is <%s> as expected' % (info[0][0]))
else:
return (CRIT, 'system timezone is not correct(!!), should be %s but is %s' % (params[0], info[0][0]))
except Exception, e:
return (UNKNOWN, "timezone check failed: %", e.message)
check_info["timezone"] = {
'check_function': check_timezone_status,
'inventory_function': inventory_timezone_status,
'service_description': 'system-wide timezone setting',
}
|