Module: check_mk
Branch: master
Commit: 8247fd0b8eea59cc73eb5b0584580236b038f301
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=8247fd0b8eea59…
Author: Bernd Stroessenreuther <bs(a)mathias-kettner.de>
Date: Fri Jul 26 13:03:21 2013 +0200
initial version of check manpage for more statgrab_*
---
checkman/statgrab_disk | 4 ++--
checkman/statgrab_net.link | 16 ++++++++++++----
checkman/statgrab_net.params | 32 +++++++++++++++++++++++---------
3 files changed, 37 insertions(+), 15 deletions(-)
diff --git a/checkman/statgrab_disk b/checkman/statgrab_disk
index c4e0c33..4fba301 100644
--- a/checkman/statgrab_disk
+++ b/checkman/statgrab_disk
@@ -19,8 +19,8 @@ item:
examples:
# adding one service for Disk IO read and one for Disk IO write
checks += [
- ('statgrab', 'statgrab_disk', 'read', None),
- ('statgrab', 'statgrab_disk', 'write', None),
+ ('host1', 'statgrab_disk', 'read', None),
+ ('host1', 'statgrab_disk', 'write', None),
]
perfdata:
diff --git a/checkman/statgrab_net.link b/checkman/statgrab_net.link
index 3e7d618..5c73f69 100644
--- a/checkman/statgrab_net.link
+++ b/checkman/statgrab_net.link
@@ -4,22 +4,30 @@ catalog: os/network
license: GPL
distribution: check_mk
description:
- BERND, FIXME: where does it get target state from?
-
Checks the link state for an interface and compares it to it's target state.
Returns {OK} if link state is equal to the target state.
- Returns {WARN} if the link is UP and the target state is UNUSED.
+ Returns {WARN} if the link is UP and the target state is NO LINK.
- Returns {CRIT} if the state is NO LINK and the target state is UP.
+ Returns {CRIT} if the current state is NO LINK and the target state is UP.
Make sure you have the statgrab binary available on the monitored
machine. Under HP-UX you also need to activate the hpux_statgrab agent plugin.
+examples:
+ # target state for interface bge0 on host1 is NO LINK
+ checks += [
+ ('host1', 'statgrab_net.link', 'bge0', False)
+ ]
+
item:
The interface name as defined in the operating system.
inventory:
Creates one check for each network interface.
+ When running inventory on a machine, the current state of an interface is
+ assumed to be the target state.
+[parameters]
+targetstate(bool): {true} for target state UP, {false} for target state NO LINK.
diff --git a/checkman/statgrab_net.params b/checkman/statgrab_net.params
index eaad10f..2bb60dc 100644
--- a/checkman/statgrab_net.params
+++ b/checkman/statgrab_net.params
@@ -4,16 +4,30 @@ catalog: os/network
license: GPL
distribution: check_mk
description:
- This check measures the CPU utilization during the last check
- cycle. A level can be set only on {wait} (disk wait).
+ Checks the settings for speed and duplex of a network interface and compares
+ them to their target state.
- BERND: Hinweis auf statgrab-Plugin (HP) bzw. statgrab-Befehl (beide).
+ Returns {OK} if they are equal and {CRIT} if not.
-perfdata:
- Three variables: The percentage of time spent in {user}, {system} and {wait}
- (disk wait). The idle time can be computed by substracting those three values
- from 100%. The user value contains also {nice}.
+ Make sure you have the statgrab binary available on the monitored
+ machine. Under HP-UX you also need to activate the hpux_statgrab agent plugin.
+
+examples:
+ # target settings for interface bge0 on host1 are a speed of 1000Mb/s
+ # and Unknown for the duplex state
+ checks += [
+ ('host1', 'statgrab_net.params', 'bge0', ('1000Mb/s', 'Unknown'))
+ ]
+
+item:
+ The interface name as defined in the operating system.
inventory:
- One check per host is created if the agent contains a {statgrab_cpu}
- section containing cpu information.
+ Creates one check for each network interface.
+ When running inventory on a machine, the current settings for speed and duplex
+ of an interface are assumed to be the target states.
+
+[parameters]
+targetstate(string, string): the target state for interface speed and the
+ target duplex state
+
Module: check_mk
Branch: master
Commit: 51dbd05f5472478a02e26f155e48481c178de416
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=51dbd05f547247…
Author: Bernd Stroessenreuther <bs(a)mathias-kettner.de>
Date: Fri Jul 26 12:00:39 2013 +0200
initial version of check manpage for statgrab_*, added section agentless in check catalog
---
checkman/statgrab_disk | 28 ++++++++++++++++-------
checkman/statgrab_mem | 52 ++++++++++++++++++++++++++++++++++--------
checkman/statgrab_net.ctr | 26 ++++++++++++---------
checkman/statgrab_net.link | 26 +++++++++++++--------
checkman/statgrab_net.params | 2 +-
doc/drafts/LIESMICH.Katalog | 2 ++
6 files changed, 97 insertions(+), 39 deletions(-)
diff --git a/checkman/statgrab_disk b/checkman/statgrab_disk
index 968e27f..c4e0c33 100644
--- a/checkman/statgrab_disk
+++ b/checkman/statgrab_disk
@@ -4,16 +4,28 @@ catalog: os/kernel
license: GPL
distribution: check_mk
description:
- This check measures the CPU utilization during the last check
- cycle. A level can be set only on {wait} (disk wait).
+ Reports Disk IO for read and Disk IO for write in Bytes/s during the last check
+ cycle.
- BERND: Hinweis auf statgrab-Plugin (HP) bzw. statgrab-Befehl (beide).
+ The check always returns {OK} state.
+
+ Make sure you have the statgrab binary available on the monitored
+ machine. Under HP-UX you also need to activate the hpux_statgrab agent plugin.
+
+item:
+ {read} for Disk IO read and
+ {write} for Disk IO write
+
+examples:
+ # adding one service for Disk IO read and one for Disk IO write
+ checks += [
+ ('statgrab', 'statgrab_disk', 'read', None),
+ ('statgrab', 'statgrab_disk', 'write', None),
+ ]
perfdata:
- Three variables: The percentage of time spent in {user}, {system} and {wait}
- (disk wait). The idle time can be computed by substracting those three values
- from 100%. The user value contains also {nice}.
+ One value per Check: Disk IO in Bytes/s
inventory:
- One check per host is created if the agent contains a {statgrab_cpu}
- section containing cpu information.
+ Finds two checks on every machine with statgrab: Disk IO read and
+ Disk IO write
diff --git a/checkman/statgrab_mem b/checkman/statgrab_mem
index 4224e7d..cd486ff 100644
--- a/checkman/statgrab_mem
+++ b/checkman/statgrab_mem
@@ -1,19 +1,53 @@
-title: Memory (RAM) and Swap usage
+title: Usage of physical and virtual RAM
agents: hpux, solaris
catalog: os/kernel
license: GPL
distribution: check_mk
description:
- This check measures the CPU utilization during the last check
- cycle. A level can be set only on {wait} (disk wait).
+ This check measures the current usage of physical RAM and
+ virtual memory used by processes. You can define a warning
+ and critical level for the usage of virtual memory,
+ {not} for the usage of RAM.
- BERND: Hinweis auf statgrab-Plugin (HP) bzw. statgrab-Befehl (beide).
+ Check_mk lets you define levels in percentage of
+ the physically installed RAM or as absolute
+ values in MB. The default levels
+ are at 150% and 200%. That means that this check
+ gets critical if the memory used by processes
+ is twice the size of your RAM.
+
+ See check manpage for {mem.used} too.
+
+ Make sure you have the statgrab binary available on the monitored
+ machine. Under HP-UX you also need to activate the hpux_statgrab agent plugin.
+
+examples:
+ # Change default levels from 150%/200% to 100%/150%:
+ memused_default_levels = (100.0, 150.0)
+ checks += [
+ # make explicit check for hosts with tag "solaris"
+ ( ["solaris"], ALL_HOSTS, "statgrab_mem", None, (80.0, 100.0) ),
+ # use absolute levels at 8GB / 12GB for some other hosts
+ ( ["host12","host34"], "statgrab_mem", None, (8192, 12288) )
+ ]
perfdata:
- Three variables: The percentage of time spent in {user}, {system} and {wait}
- (disk wait). The idle time can be computed by substracting those three values
- from 100%. The user value contains also {nice}.
+ Two values: The RAM used in MB (without Caches) and the swap space used
+ in MB.
inventory:
- One check per host is created if the agent contains a {statgrab_cpu}
- section containing cpu information.
+ Finds one service on every machine with statgrab: The memory used.
+
+[parameters]
+warning (int or float): the percentage of virtual memory used
+ by processes at which {WARN} state is triggered. If the
+ level is defined as an integer value then it is interpreted
+ as an absolute value in megabytes.
+critical (int or float): the percentage or absolute value
+ at which {CRIT} state is triggered
+
+[configuration]
+memused_default_levels (float, float): Levels used by
+ all checks that are created by inventory. If not set they
+ have defaults of (150.0, 200.0)
+
diff --git a/checkman/statgrab_net.ctr b/checkman/statgrab_net.ctr
index c2158d7..3b938f7 100644
--- a/checkman/statgrab_net.ctr
+++ b/checkman/statgrab_net.ctr
@@ -1,20 +1,24 @@
-title: Network Interfaces: Counters
+title: Network Interfaces: Traffic
agents: hpux, solaris
-catalog: os/kernel
+catalog: os/network
license: GPL
distribution: check_mk
description:
- This check measures the CPU utilization during the last check
- cycle. A level can be set only on {wait} (disk wait).
+ Reports the network traffic for an interface during the last check
+ cycle for direction IN and OUT.
- BERND: Hinweis auf statgrab-Plugin (HP) bzw. statgrab-Befehl (beide).
- Title to be improved
+ Make sure you have the statgrab binary available on the monitored
+ machine. Under HP-UX you also need to activate the hpux_statgrab agent plugin.
+
+item:
+ The interface name as defined in the operating system.
perfdata:
- Three variables: The percentage of time spent in {user}, {system} and {wait}
- (disk wait). The idle time can be computed by substracting those three values
- from 100%. The user value contains also {nice}.
+ Seven values are delivered, the differences of the counters during the last check
+ cycle for {rx_bytes}, {tx_bytes}, {rx_packets}, {tx_packets}, {rx_errors},
+ {tx_errors}, {tx_collisions}
inventory:
- One check per host is created if the agent contains a {statgrab_cpu}
- section containing cpu information.
+ Creates one check for each network interface.
+
+
diff --git a/checkman/statgrab_net.link b/checkman/statgrab_net.link
index 84bf0a5..3e7d618 100644
--- a/checkman/statgrab_net.link
+++ b/checkman/statgrab_net.link
@@ -1,19 +1,25 @@
title: Network Interfaces: Link status
agents: hpux, solaris
-catalog: os/kernel
+catalog: os/network
license: GPL
distribution: check_mk
description:
- This check measures the CPU utilization during the last check
- cycle. A level can be set only on {wait} (disk wait).
+ BERND, FIXME: where does it get target state from?
- BERND: Hinweis auf statgrab-Plugin (HP) bzw. statgrab-Befehl (beide).
+ Checks the link state for an interface and compares it to it's target state.
-perfdata:
- Three variables: The percentage of time spent in {user}, {system} and {wait}
- (disk wait). The idle time can be computed by substracting those three values
- from 100%. The user value contains also {nice}.
+ Returns {OK} if link state is equal to the target state.
+
+ Returns {WARN} if the link is UP and the target state is UNUSED.
+
+ Returns {CRIT} if the state is NO LINK and the target state is UP.
+
+ Make sure you have the statgrab binary available on the monitored
+ machine. Under HP-UX you also need to activate the hpux_statgrab agent plugin.
+
+item:
+ The interface name as defined in the operating system.
inventory:
- One check per host is created if the agent contains a {statgrab_cpu}
- section containing cpu information.
+ Creates one check for each network interface.
+
diff --git a/checkman/statgrab_net.params b/checkman/statgrab_net.params
index 799335d..eaad10f 100644
--- a/checkman/statgrab_net.params
+++ b/checkman/statgrab_net.params
@@ -1,6 +1,6 @@
title: Network Interfaces: Speed and Duplex
agents: hpux, solaris
-catalog: os/kernel
+catalog: os/network
license: GPL
distribution: check_mk
description:
diff --git a/doc/drafts/LIESMICH.Katalog b/doc/drafts/LIESMICH.Katalog
index 86a6816..bf39c34 100644
--- a/doc/drafts/LIESMICH.Katalog
+++ b/doc/drafts/LIESMICH.Katalog
@@ -52,3 +52,5 @@ hw
SNMP-Agent auf Betriebssystem für HW
generic (mrpe, local, ...)
+
+agentless "Networking checks without agent"
Module: check_mk
Branch: master
Commit: 19df067d0c38cc06cd733a2192c5e1f2bc0abacd
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=19df067d0c38cc…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Thu Jul 25 09:24:33 2013 +0200
LDAP: Configuring multiple servers is now possible
---
ChangeLog | 2 ++
web/plugins/userdb/ldap.py | 49 +++++++++++++++-------------
web/plugins/wato/check_mk_configuration.py | 11 ++++++-
3 files changed, 39 insertions(+), 23 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index b92bf12..797f3bd 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -84,6 +84,8 @@
Display current date in dashboard
* LDAP: Using asynchronous searches / added optional support for paginated
searches (Can be enabled in connection settings)
+ * LDAP: It is now possible to provide multiple failover servers, which are
+ tried when the primary ldap server fails
* Added option to enable browser scrollbar to the multisite sidebar (only
via "sidebar_show_scrollbar = True" in multisite.mk
* Added option to disable automatic userdb synchronizations in multisite
diff --git a/web/plugins/userdb/ldap.py b/web/plugins/userdb/ldap.py
index 60f6aae..37b707a 100644
--- a/web/plugins/userdb/ldap.py
+++ b/web/plugins/userdb/ldap.py
@@ -100,13 +100,13 @@ class MKLDAPException(MKGeneralException):
ldap_connection = None
-def ldap_uri():
+def ldap_uri(server):
if 'use_ssl' in config.ldap_connection:
uri = 'ldaps://'
else:
uri = 'ldap://'
- return uri + '%s:%d' % (config.ldap_connection['server'], config.ldap_connection['port'])
+ return uri + '%s:%d' % (server, config.ldap_connection['port'])
def ldap_connect():
global ldap_connection, ldap_connection_options
@@ -135,30 +135,35 @@ def ldap_connect():
'LDAP User Settings</a>.'))
try:
- ldap_connection = ldap.ldapobject.ReconnectLDAPObject(ldap_uri())
- ldap_connection.protocol_version = config.ldap_connection['version']
- ldap_connection.network_timeout = config.ldap_connection.get('connect_timeout', 2.0)
-
- # When using the domain top level as base-dn, the subtree search stumbles with referral objects.
- # whatever. We simply disable them here when using active directory. Hope this fixes all problems.
- if config.ldap_connection['type'] == 'ad':
- ldap_connection.set_option(ldap.OPT_REFERRALS, 0)
-
- ldap_default_bind()
+ servers = [ config.ldap_connection['server'] ]
+ if config.ldap_connection.get('failover_servers'):
+ servers += config.ldap_connection.get('failover_servers')
+
+ errors = []
+ for server in servers:
+ try:
+ uri = ldap_uri(server)
+ ldap_connection = ldap.ldapobject.ReconnectLDAPObject(uri)
+ ldap_connection.protocol_version = config.ldap_connection['version']
+ ldap_connection.network_timeout = config.ldap_connection.get('connect_timeout', 2.0)
+
+ # When using the domain top level as base-dn, the subtree search stumbles with referral objects.
+ # whatever. We simply disable them here when using active directory. Hope this fixes all problems.
+ if config.ldap_connection['type'] == 'ad':
+ ldap_connection.set_option(ldap.OPT_REFERRALS, 0)
+
+ ldap_default_bind()
+ except (ldap.SERVER_DOWN, ldap.TIMEOUT, ldap.LOCAL_ERROR, ldap.LDAPError), e:
+ ldap_connection = None
+ errors.append('%s: %s' % (uri, e[0].get('info', e[0].get('desc', ''))))
+
+ if ldap_connection is None:
+ raise MKLDAPException(_('The LDAP connector is unable to connect to the LDAP server.\n%s') %
+ ('<br />\n'.join(errors)))
# on success, store the connection options the connection has been made with
ldap_connection_options = config.ldap_connection
- except ldap.SERVER_DOWN, e:
- msg = e[0].get('info', e[0].get('desc', ''))
- ldap_connection = None # Invalidate connection on failure
- raise MKLDAPException(_('The LDAP connector is unable to connect to the LDAP server (%s).') % msg)
-
- except ldap.LDAPError, e:
- html.write(repr(e))
- ldap_connection = None # Invalidate connection on failure
- raise MKLDAPException(e)
-
except Exception:
ldap_connection = None # Invalidate connection on failure
raise
diff --git a/web/plugins/wato/check_mk_configuration.py b/web/plugins/wato/check_mk_configuration.py
index 6f8a5c6..550dd0a 100644
--- a/web/plugins/wato/check_mk_configuration.py
+++ b/web/plugins/wato/check_mk_configuration.py
@@ -445,6 +445,15 @@ register_configvar(group,
"resolvable hostname."),
allow_empty = False,
)),
+ ('failover_servers', ListOfStrings(
+ title = _('Failover Servers'),
+ help = _('When the connection to the first server fails with connect specific errors '
+ 'like timeouts or some other network related problems, the connect mechanism '
+ 'will try to use this server instead of the server configured above. If you '
+ 'use persistent connections (default), the connection is being used until the '
+ 'LDAP is not reachable or the local webserver is restarted.'),
+ allow_empty = False,
+ )),
("port", Integer(
title = _("TCP Port"),
help = _("This variable allows to specify the TCP port to "
@@ -525,7 +534,7 @@ register_configvar(group,
default_value = 5,
)),
],
- optional_keys = ['no_persistent', 'use_ssl', 'bind', 'page_size', 'response_timeout'],
+ optional_keys = ['no_persistent', 'use_ssl', 'bind', 'page_size', 'response_timeout', 'failover_servers'],
),
domain = "multisite",
)
Module: check_mk
Branch: master
Commit: 253c075d8917e03901b1a821ee4b2141fc993e4b
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=253c075d8917e0…
Author: Andreas Boesl <ab(a)mathias-kettner.de>
Date: Wed Jul 24 16:16:24 2013 +0200
* Add: Require unique alias names in between the following elements:
Host/Service/Contact Groups, Timeperiods and Roles
---
ChangeLog | 2 ++
web/htdocs/wato.py | 39 ++++++++++++++++++++++++++++++++++++---
2 files changed, 38 insertions(+), 3 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index d19de41..b92bf12 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -106,6 +106,8 @@
* Custom user attributes can now be managed using WATO
* FIX: do validation of check items in rule editor
* FIX: More consistent handling of folderpath select in rule editor
+ * Add: Require unique alias names in between the following elements:
+ Host/Service/Contact Groups, Timeperiods and Roles
Notifications:
* Flexible Notification can now filter service levels
diff --git a/web/htdocs/wato.py b/web/htdocs/wato.py
index 9b610f4..c5cf0e6 100644
--- a/web/htdocs/wato.py
+++ b/web/htdocs/wato.py
@@ -5860,9 +5860,11 @@ def mode_edit_group(phase, what):
alias = html.var_utf8("alias").strip()
if not alias:
raise MKUserError("alias", _("Please specify an alias name."))
- for key, value in groups.items():
- if alias == value and name != key:
- raise MKUserError("alias", _("This alias is already used in the group %s .") % key)
+
+ unique, info = is_alias_used(what, name, alias)
+ if not unique:
+ raise MKUserError("alias", info)
+
if new:
name = html.var("name").strip()
if len(name) == 0:
@@ -6204,6 +6206,10 @@ def mode_edit_timeperiod(phase):
if not alias:
raise MKUserError("alias", _("Please specify an alias name for your timeperiod."))
+ unique, info = is_alias_used("timeperiods", name, alias)
+ if not unique:
+ raise MKUserError("alias", info)
+
timeperiod.clear()
# extract time ranges of weekdays
@@ -8642,6 +8648,11 @@ def mode_edit_role(phase):
if phase == "action":
alias = html.var_utf8("alias")
+
+ unique, info = is_alias_used("roles", id, alias)
+ if not unique:
+ raise MKUserError("alias", info)
+
new_id = html.var("id")
if len(new_id) == 0:
raise MKUserError("id", _("Please specify an ID for the new role."))
@@ -13556,6 +13567,28 @@ def may_see_hosts():
return config.may("wato.use") and \
(config.may("wato.seeall") or config.may("wato.hosts"))
+def is_alias_used(my_group, my_name, aliasname):
+ # Host / Service / Contact groups
+ all_groups = userdb.load_group_information()
+ for groupname, group in all_groups.items():
+ for key, value in group.items():
+ if value == aliasname and (my_group != groupname or my_name != key):
+ return False, _("This alias is already used in the %s group %s .") % (groupname, key)
+
+ # Timeperiods
+ timeperiods = load_timeperiods()
+ for key, value in timeperiods.items():
+ if value.get("alias") == aliasname and (my_group != "timeperiod" or my_name != key):
+ return False, _("This alias is already used in timeperiod %s.") % key
+
+ # Roles
+ roles = userdb.load_roles()
+ for key, value in roles.items():
+ if value.get("alias") == aliasname and (my_group != "roles" or my_name != key):
+ return False, _("This alias is already used in the role %s.") % key
+
+ return True, None
+
#.
# .-Plugins--------------------------------------------------------------.
# | ____ _ _ |
Module: check_mk
Branch: master
Commit: c6e0110652125e79aca6e66d715c1d5882545bd6
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=c6e0110652125e…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Wed Jul 24 14:30:51 2013 +0200
ldap: Always using lower case ldap attributes
---
web/plugins/userdb/ldap.py | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/web/plugins/userdb/ldap.py b/web/plugins/userdb/ldap.py
index 85c4069..60f6aae 100644
--- a/web/plugins/userdb/ldap.py
+++ b/web/plugins/userdb/ldap.py
@@ -311,8 +311,9 @@ def ldap_filter(key, handle_config = True):
# Returns the ldap attribute name depending on the configured ldap directory type
# If a key is not present in the map, the assumption is, that the key matches 1:1
+# Always use lower case here, just to prevent confusions.
def ldap_attr(key):
- return ldap_attr_map[config.ldap_connection['type']].get(key, key)
+ return ldap_attr_map[config.ldap_connection['type']].get(key, key).lower()
# Returns the given distinguished name template with replaced vars
def ldap_replace_macros(tmpl):
@@ -718,6 +719,8 @@ def ldap_sync(add_to_changelog, only_username):
ldap_connect()
+ ldap_log(' SYNC PLUGINS: %s' % ', '.join(config.ldap_active_plugins.keys()))
+
# Unused at the moment, always sync all users
#filt = None
#if only_username:
Module: check_mk
Branch: master
Commit: f30bc9a6d619d742d54b07e67e8e62187fecc1bd
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=f30bc9a6d619d7…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Wed Jul 24 12:02:26 2013 +0200
Fix DST error in AbsoluteDate Valuespec wit new time feature
---
web/htdocs/valuespec.py | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/web/htdocs/valuespec.py b/web/htdocs/valuespec.py
index 2803593..4cad688 100644
--- a/web/htdocs/valuespec.py
+++ b/web/htdocs/valuespec.py
@@ -1522,7 +1522,16 @@ class AbsoluteDate(ValueSpec):
if part < mmin or part > mmax:
raise MKUserError(varname, _("The value for %s must be between %d and %d" % (_(what), mmin, mmax)))
parts.append(part)
+
+ # Construct broken time from input fields. Assume no-dst
parts += [0] * (self._include_time and 3 or 6)
+ # Convert to epoch
+ epoch = time.mktime(tuple(parts))
+ # Convert back to localtime in order to know DST setting
+ localtime = time.localtime(epoch)
+ # Enter DST setting of that time
+ parts[-1] = localtime.tm_isdst
+ # Convert to epoch again
return time.mktime(tuple(parts))
def validate_datatype(self, value, varprefix):