2 # -*- encoding: utf-8; py-indent-offset: 4 -*-
3 # +------------------------------------------------------------------+
4 # | ____ _ _ __ __ _ __ |
5 # | / ___| |__ ___ ___| | __ | \/ | |/ / |
6 # | | | | '_ \ / _ \/ __| |/ / | |\/| | ' / |
7 # | | |___| | | | __/ (__| < | | | | . \ |
8 # | \____|_| |_|\___|\___|_|\_\___|_| |_|_|\_\ |
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 # Example output from agent:
29 # 1440580801.44 4 3579545
31 # 20 643575808 large_rawcount
32 # 22 291414016 large_rawcount
33 # 26 6212497408 large_rawcount
38 # 36 2011463 counter -----> Pages Counter
42 # 52 35241984 large_rawcount
43 # 54 6586368 large_rawcount
48 # 814 114274304 large_rawcount
49 # 816 155688960 large_rawcount
50 # 62 35016704 large_rawcount
51 # 64 1003520 large_rawcount
52 # 66 131072 large_rawcount
53 # 68 2777088 large_rawcount
54 # 70 1777664 large_rawcount
55 # 72 77348864 large_rawcount
56 # 1402 71146 raw_fraction
57 # 1402 1516723 raw_base
58 # 1376 628492 large_rawcount
59 # 1378 613 large_rawcount
62 def inventory_winperf_mem(info
):
67 def check_winperf_mem(_unused
, params
, info
):
69 this_time
= float(init_line
[0])
76 page_counter
= int(line
[1])
81 pages_per_sec
= get_rate(None, this_time
, page_counter
)
83 if "pages_per_second" in params
:
84 warn
, crit
= params
["pages_per_second"]
85 if pages_per_sec
>= crit
:
87 elif pages_per_sec
>= warn
:
90 yield state
, "Pages/s: %d" % pages_per_sec
, [("mem_pages_rate", pages_per_sec
)]
93 check_info
["winperf_mem"] = {
94 'check_function': check_winperf_mem
,
95 'inventory_function': inventory_winperf_mem
,
96 'service_description': 'Memory Pages',