Module: check_mk
Branch: master
Commit: 3f9a233dd0c9e59a23d94fe17181e0c97d03a514
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=3f9a233dd0c9e5…
Author: Bernd Stroessenreuther <bs(a)mathias-kettner.de>
Date: Fri Jul 26 13:56:56 2013 +0200
initial version of check manpage for plesk_backups
---
checkman/plesk_backups | 46 +++++++++++++++++++++++++++++++++++++++++-----
1 file changed, 41 insertions(+), 5 deletions(-)
diff --git a/checkman/plesk_backups b/checkman/plesk_backups
index f29238e..b7f4b8d 100644
--- a/checkman/plesk_backups
+++ b/checkman/plesk_backups
@@ -1,4 +1,4 @@
-title: FTP backup spaces of Plesk domains
+title: FTP backups of Plesk domains
agents: linux
catalog: app/Plesk
license: GPL
@@ -8,11 +8,47 @@ description:
manage multiple independent webspace instances including domains and
so on.
- Plugin: plesk_backup (war das bei plesk_domains auch erwähnt)?
+ This check checks the FTP backups and backup space of Plesk domains.
- BERND SCHREIBT DEN REST.
+ To make this check work you need to install the agent plugin
+ {plesk_backups} on the host wich runs Plesk in the
+ directory {/usr/lib/check_mk_agent/plugins}.
+
+item:
+ The domain name of the domain backuped.
+
+examples:
+ # set up a check for a plesk backup
+ # warn if backup is elder than 1 day (86400 sec)
+ # and crit if elder than 2 days
+ # warn if Maximum size of all files on backup space is > 70 MB
+ # (73400320 Bytes) and crit if > 80 MB
+ # warn also if no backup is configured or no backup can be found
+ static_checks['plesk_backups'] = [
+ ( ('plesk_backups',
+ 'Backup example.com',
+ { 'backup_age': (86400, 172800),
+ 'total_size': (73400320, 83886080),
+ 'no_backup_configured_state': 1,
+ 'no_backup_found_state': 1
+ }),
+ [], ['localhost1']
+ ),
+ ]
+
+perfdata:
+ Three values:
+ last backup size in bytes,
+ last backup age in seconds and
+ total size of all backups in bytes
inventory:
- One check per system is created if the {plesk_domains} agent plugin
- is installed and working (it outputs the {<<<plesk_domains>>>} section).
+ One check per plesk domain is created if the {plesk_backups} agent plugin
+ is installed and working (it outputs the {<<<plesk_backups>>>} section).
+
+[parameters]
+backup_age(int, int): if the age of the backup (in seconds) is elder than the first value, return {WARN} state, if elder than the second one, return {CRIT} state
+total_size(int, int): if the total size of all backups on the backup space (in bytes) is larger than than the first value, return {WARN} state, if larger than the second one, return {CRIT} state
+no_backup_configured_state(int): the numeric state that should be returned if no backup is configured ( 0 = {OK}, 1 = {WARN}, 2 = {CRIT} )
+no_backup_found_state(int): the numeric state that should be returned if no backup can be found ( 0 = {OK}, 1 = {WARN}, 2 = {CRIT} )
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",
)