Skip to content

Commit 0a64837

Browse files
committed
Add simple perfometer implementation.
1 parent 54898d3 commit 0a64837

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

perfometer/cisco_dom.py

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
#!/usr/bin/python
2+
# -*- encoding: utf-8; py-indent-offset: 4 -*-
3+
4+
# cmk_cisco-dom - check-mk plugin for SNMP-based Cisco Digital-Optical-Monitoring monitoring
5+
#
6+
# Authors:
7+
# Thomas Liske <[email protected]>
8+
#
9+
# Copyright Holder:
10+
# 2015 - 2016 (C) IBH IT-Service GmbH [http://www.ibh.de/]
11+
#
12+
# License:
13+
# This program is free software; you can redistribute it and/or modify
14+
# it under the terms of the GNU General Public License as published by
15+
# the Free Software Foundation; either version 2 of the License, or
16+
# (at your option) any later version.
17+
#
18+
# This program is distributed in the hope that it will be useful,
19+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
20+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21+
# GNU General Public License for more details.
22+
#
23+
# You should have received a copy of the GNU General Public License
24+
# along with this package; if not, write to the Free Software
25+
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
26+
#
27+
28+
def perfometer_cisco_dom(row, check_command, perf_data):
29+
color = { 0: "#a4f", 1: "#ff2", 2: "#f22", 3: "#fa2" }[row["service_state"]]
30+
return "%.1f dBm" % perf_data[0][1], perfometer_logarithmic(perf_data[0][1] + 20, 20, 2, color)
31+
32+
perfometers["check_mk-cisco_dom"] = perfometer_cisco_dom

0 commit comments

Comments
 (0)