Module: check_mk
Branch: master
Commit: 51828eddb9d36cd3a9dace91a2de41d7d7ad121d
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=51828eddb9d36c…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Thu Aug 2 14:08:49 2012 +0200
Improved mssql agent plugin
* FIX: mssql agent: Fixed connection to default instances ("MSSQLSERVER")
* FIX: mssql agent: Fixed check of databases with names starting with numbers
---
ChangeLog | 2 ++
agents/windows/plugins/mssql.vbs | 11 +++++++++--
2 files changed, 11 insertions(+), 2 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 60b5039..dad3486 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -22,6 +22,8 @@
* vms_system.procs: new check for number of processes on OpenVMS
* vms_queuejobs: new check for monitoring current VMS queue jobs
* FIX: mssql agent: Added compatibility code for MSSQL 9
+ * FIX: mssql agent: Fixed connection to default instances ("MSSQLSERVER")
+ * FIX: mssql agent: Fixed check of databases with names starting with numbers
* f5_bigip_temp: add performance data
* added perf-o-meters for a lot of temperature checks
* cmctc_lcp.*: added new checks for Rittal CMC-TC LCP
diff --git a/agents/windows/plugins/mssql.vbs b/agents/windows/plugins/mssql.vbs
index 7e12135..318b7b2 100644
--- a/agents/windows/plugins/mssql.vbs
+++ b/agents/windows/plugins/mssql.vbs
@@ -82,7 +82,14 @@ For Each instId In instIds.Keys
Else
instName = instId
End If
- CONN.Properties("Data Source").Value = hostname & "\" & instName
+
+ ' In case of instance name "MSSQLSERVER" always use (local) as connect string
+ If instName = "MSSQLSERVER" Then
+ CONN.Properties("Data Source").Value = "(local)"
+ Else
+ CONN.Properties("Data Source").Value = hostname & "\" & instName
+ End If
+
CONN.Open
' Get counter data for the whole instance
@@ -120,7 +127,7 @@ For Each instId In instIds.Keys
Dim i, dbSize, unallocated, reserved, data, indexSize, unused
For Each dbName in dbNames.Keys
' Switch to other database and then ask for stats
- RS.Open "USE " & dbName, CONN
+ RS.Open "USE [" & dbName & "]", CONN
' sp_spaceused is a stored procedure which returns two selects
' which need to be looped
RS.Open "EXEC sp_spaceused", CONN
Module: check_mk
Branch: master
Commit: c39ed6bf998b39359b4372d8161a19c68ccc4f3b
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=c39ed6bf998b39…
Author: Bastian Kuhn <bk(a)mathias-kettner.de>
Date: Tue Jul 31 11:57:11 2012 +0200
New check f5_bigip_interfaces
---
ChangeLog | 1 +
pnp-templates/check_mk-f5_bigip_interfaces.php | 42 ++++++++++++++++++++++++
2 files changed, 43 insertions(+), 0 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index d980fb7..d7bea5c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -22,6 +22,7 @@
* FIX: mssql agent: Added compatibility code for MSSQL 9
* FIX: diskstat (linux): Don't inventorize check when data empty
* Cisco: Added Check for mem an cpu util
+ * New check for f5 bigip network interfaces
WATO:
* Added permission to control the "clone host" feature in WATO
diff --git a/pnp-templates/check_mk-f5_bigip_interfaces.php b/pnp-templates/check_mk-f5_bigip_interfaces.php
new file mode 100644
index 0000000..2b15f01
--- /dev/null
+++ b/pnp-templates/check_mk-f5_bigip_interfaces.php
@@ -0,0 +1,42 @@
+<?php
+# +------------------------------------------------------------------+
+# | ____ _ _ __ __ _ __ |
+# | / ___| |__ ___ ___| | __ | \/ | |/ / |
+# | | | | '_ \ / _ \/ __| |/ / | |\/| | ' / |
+# | | |___| | | | __/ (__| < | | | | . \ |
+# | \____|_| |_|\___|\___|_|\_\___|_| |_|_|\_\ |
+# | |
+# | Copyright Mathias Kettner 2012 mk(a)mathias-kettner.de |
+# +------------------------------------------------------------------+
+#
+# This file is part of Check_MK.
+# The official homepage is at http://mathias-kettner.de/check_mk.
+#
+# check_mk is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation in version 2. check_mk is distributed
+# in the hope that it will be useful, but WITHOUT ANY WARRANTY; with-
+# out even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE. See the GNU General Public License for more de-
+# ails. You should have received a copy of the GNU General Public
+# License along with GNU Make; see the file COPYING. If not, write
+# to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
+# Boston, MA 02110-1301 USA.
+
+$opt[1] = "--vertical-label \"bytes per secound\" -l0 -u 1 --title \"Traffic Utilization $hostname / $servicedesc\" ";
+
+
+$def[1] = "DEF:in=$RRDFILE[1]:$DS[1]:MAX " ;
+$def[1] .= "DEF:out=$RRDFILE[2]:$DS[2]:MAX " ;
+$def[1] .= "CDEF:kb_out=out,1024,/ " ;
+$def[1] .= "CDEF:kb_in=in,1024,/ " ;
+$def[1] .= "AREA:in#18DF18:\"Inbound \" " ;
+$def[1] .= "GPRINT:kb_in:LAST:\"%6.2lfk last\" " ;
+$def[1] .= "GPRINT:kb_in:AVERAGE:\"%6.2lfk avg\" " ;
+$def[1] .= "GPRINT:kb_in:MAX:\"%6.2lfk max\\n\" ";
+$def[1] .= "LINE:out#004080:\"Outbound \" " ;
+$def[1] .= "GPRINT:kb_out:LAST:\"%6.2lfk last\" " ;
+$def[1] .= "GPRINT:kb_out:AVERAGE:\"%6.2lfk avg\" " ;
+$def[1] .= "GPRINT:kb_out:MAX:\"%6.2lfk max\\n\" " ;
+?>
+
Module: check_mk
Branch: master
Commit: be314f3601a70491e01dc195b8015343f63678c4
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=be314f3601a704…
Author: Bastian Kuhn <bk(a)mathias-kettner.de>
Date: Wed Aug 1 03:58:59 2012 +0200
Added missing documentaion
---
checkman/cisco_mem | 10 ++++++
checkman/f5_bigip_interfaces | 10 ++++++
checkman/fortigate_cpu | 19 ++++++++++++
checkman/fortigate_memory | 19 ++++++++++++
checkman/fortigate_sessions | 19 ++++++++++++
checks/f5_bigip_interfaces | 65 ++++++++++++++++++++++++++++++++++++++++++
6 files changed, 142 insertions(+), 0 deletions(-)
diff --git a/checkman/cisco_mem b/checkman/cisco_mem
new file mode 100644
index 0000000..b37bb11
--- /dev/null
+++ b/checkman/cisco_mem
@@ -0,0 +1,10 @@
+title: Cisco Memory Check
+agents: snmp
+author: Bastian Kuhn <bk(a)mathias-kettner.de>
+license: GPL
+distribution: check_mk
+description:
+ This check monitors the memory usage of cisco devices. The check separates between
+ cpu and i/o pool.
+inventory:
+ A check for i/o pool and one for cpu pool will be created.
diff --git a/checkman/f5_bigip_interfaces b/checkman/f5_bigip_interfaces
new file mode 100644
index 0000000..6dbcc7e
--- /dev/null
+++ b/checkman/f5_bigip_interfaces
@@ -0,0 +1,10 @@
+title: F5 Bigip Interface check
+agents: snmp
+author: Bastian Kuhn <bk(a)mathias-kettner.de>
+license: GPL
+distribution: check_mk
+description:
+ This check will monitor the special network interfaces on a F5 Bigip Device.
+ He shows the current bandwhidth of the connection an detects changes of portstate
+inventory:
+ Eeach interface which is up will be added as a new check.
diff --git a/checkman/fortigate_cpu b/checkman/fortigate_cpu
new file mode 100644
index 0000000..b442b66
--- /dev/null
+++ b/checkman/fortigate_cpu
@@ -0,0 +1,19 @@
+title: Fortigate CPU Check
+agents: snmp
+author: Bastian Kuhn <bk(a)mathias-kettner.de>
+license: GPL
+distribution: check_mk
+description:
+ This check monitors the cpu levels for fortigate firewalls
+inventory:
+ One service will be created
+
+[parameters]
+warning (float): Minimum cpu load for warning level
+crit (float): Minimum cpu load for critical level
+
+[configuration]
+fortigate_cpu_default_levels = (float, float): The default levels for all checks of this kind.
+
+perfdata:
+ current utilization
diff --git a/checkman/fortigate_memory b/checkman/fortigate_memory
new file mode 100644
index 0000000..f0fdebf
--- /dev/null
+++ b/checkman/fortigate_memory
@@ -0,0 +1,19 @@
+title: Fortigate memory levels
+agents: snmp
+author: Bastian Kuhn <bk(a)mathias-kettner.de>
+license: GPL
+distribution: check_mk
+description:
+ This check monitors the used memory on fortigate firewalls
+inventory:
+ One service will be created
+
+[parameters]
+warning (int): Minimum memory usage for warning level
+crit (int): Minimum memory usage for critical level
+
+[configuration]
+fortigate_memory_default_levels = (int, int): The default levels for all checks of this kind.
+
+perfdata:
+ current memory usage
diff --git a/checkman/fortigate_sessions b/checkman/fortigate_sessions
new file mode 100644
index 0000000..4eaaa32
--- /dev/null
+++ b/checkman/fortigate_sessions
@@ -0,0 +1,19 @@
+title: Fortigate sessions Checks
+agents: snmp
+author: Bastian Kuhn <bk(a)mathias-kettner.de>
+license: GPL
+distribution: check_mk
+description:
+ This check monitors the current amount of sessions on an Fortigate Firewall device
+inventory:
+ One service will be created
+
+[parameters]
+warning (int): Minimum seesion count for warning level
+crit (int): Minimum session count for critical level
+
+[configuration]
+fortigate_sessions_default_levels = (int, int): The default levels for all checks of this kind.
+
+perfdata:
+ current amount of sessions on the device
diff --git a/checks/f5_bigip_interfaces b/checks/f5_bigip_interfaces
new file mode 100644
index 0000000..54dde44
--- /dev/null
+++ b/checks/f5_bigip_interfaces
@@ -0,0 +1,65 @@
+#!/usr/bin/python
+# -*- encoding: utf-8; py-indent-offset: 4 -*-
+# +------------------------------------------------------------------+
+# | ____ _ _ __ __ _ __ |
+# | / ___| |__ ___ ___| | __ | \/ | |/ / |
+# | | | | '_ \ / _ \/ __| |/ / | |\/| | ' / |
+# | | |___| | | | __/ (__| < | | | | . \ |
+# | \____|_| |_|\___|\___|_|\_\___|_| |_|_|\_\ |
+# | |
+# | Copyright Mathias Kettner 2012 mk(a)mathias-kettner.de |
+# +------------------------------------------------------------------+
+#
+# This file is part of Check_MK.
+# The official homepage is at http://mathias-kettner.de/check_mk.
+#
+# check_mk is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation in version 2. check_mk is distributed
+# in the hope that it will be useful, but WITHOUT ANY WARRANTY; with-
+# out even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE. See the GNU General Public License for more de-
+# ails. You should have received a copy of the GNU General Public
+# License along with GNU Make; see the file COPYING. If not, write
+# to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
+# Boston, MA 02110-1301 USA.
+
+# .1.3.6.1.4.1.3375.2.1.2.4.4.3.1.1. index for ifname
+# .1.3.6.1.4.1.3375.2.1.2.4.4.3.1.13. index for ifstate
+# .1.3.6.1.4.1.3375.2.1.2.4.4.3.1.3. index for OUT bytes
+# .1.3.6.1.4.1.3375.2.1.2.4.4.3.1.5. index for IN bytes
+
+def check_f5_bigip_interfaces(item, params, info):
+ for port, ifstate, inbytes, outbytes in info:
+ if item == port:
+ if int(ifstate) != 0:
+ states = {
+ 2 : "down (has no link and is initialized)",
+ 3 : "disabled has been forced down)",
+ 4 : "uninitialized (has not been initialized)",
+ 5 : "loopback (in loopback mode)",
+ 6 : "unpopulated (interface not physically populated)",
+ }
+ return(2, "CRIT - State of %s is %s" % (states[ifstate], port))
+ this_time = int(time.time())
+ in_timedif, in_per_sec = get_counter("f5.interface.in.%s" % item, this_time, int(inbytes))
+ out_timedif, out_per_sec = get_counter("f5_interface.out.%s" % item, this_time, int(outbytes))
+
+
+ inbytes_h = get_bytes_human_readable(in_per_sec)
+ outbytes_h = get_bytes_human_readable(out_per_sec)
+ perf = [
+ ("bytes_in", in_per_sec),
+ ("bytes_out", out_per_sec),
+ ]
+ return (0, "OK - in bytes: %s/s, out bytes: %s/s" % (inbytes_h, outbytes_h), perf)
+
+
+check_info["f5_bigip_interfaces"] = {
+ "check_function" : check_f5_bigip_interfaces,
+ "inventory_function" : lambda info: [ (x[0], {'state': 0 } ) for x in info if int(x[1]) == 0],
+ "service_description" : "f5 Interface %s",
+ "has_perfdata" : True,
+ "snmp_scan_function" : lambda oid: ".1.3.6.1.4.1.3375.2.1.3.4.20" in oid(".1.3.6.1.2.1.1.2.0"),
+ "snmp_info" : ( ".1.3.6.1.4.1.3375.2.1.2.4.4.3.1", [1, 13, 3, 5]),
+