├── if64_xx ├── check_host │ ├── config │ │ ├── domains.txt │ │ ├── neighbor_ignore_find.txt │ │ ├── neighbor_ignore_startswith.txt │ │ ├── hostname_wrong_ignore_startwith.txt │ │ └── firmware_remove_domain.txt │ └── log │ │ └── check_hosts_2015-09-17_15-55-12.log ├── 1.png ├── 2.png ├── 3.png ├── 4.png ├── .DS_Store ├── Tags.png ├── Inventory1.png ├── Inventory2.png ├── WATO_Fehler.png ├── web │ ├── .DS_Store │ └── plugins │ │ ├── .DS_Store │ │ ├── metrics │ │ ├── .DS_Store │ │ └── if64_xx_metrics.py │ │ ├── perfometer │ │ ├── .DS_Store │ │ └── if64_xx_perfometer.py │ │ └── views │ │ └── switch_x.py ├── inventory │ ├── .DS_Store │ ├── mac_custom.db │ ├── switch_ipaddr │ ├── switch_mac │ ├── switch_ipRoute │ └── switch_ipCidrRoute ├── mac_test │ ├── oui_wireshark.db │ └── convert_oui.py ├── if64_xx_DisabledChecks.png └── checks │ ├── if64_neighbor │ ├── port_utilization │ ├── if64_trunk │ └── if64_router ├── .DS_Store ├── cisco_rf ├── 1.png ├── README.md └── checks │ └── cisco_rf ├── cisco_wlc ├── 1.png ├── 2.png ├── .DS_Store └── README.md ├── qnap ├── .DS_Store ├── mkp │ ├── .DS_Store │ ├── qnap-1.3.mkp │ └── qnap ├── screenshort_qnap.png ├── checkman │ ├── qnap_volumes │ ├── qnap_fans │ ├── qnap_hdd │ └── qnap_temp ├── README.md ├── pnp-templates │ ├── check_mk-qnap_temp.php │ ├── check_mk-qnap_hdd.php │ └── check_mk-qnap_fans.php ├── checks │ ├── qnap_info │ ├── qnap_fans │ ├── qnap_hdd │ └── qnap_temp └── snmpwalk.txt ├── cisco_asa_x ├── 1.png ├── .DS_Store ├── README.md └── checks │ ├── cisco_asa_connections │ └── cisco_asa_vpnsessions ├── cisco_hsrp ├── 1.png ├── 2.png ├── 3.png ├── 4.png ├── .DS_Store └── README.md ├── cisco_stack ├── 1.png ├── .DS_Store └── README.md ├── fc_port └── README.md ├── qemu_kvm ├── .DS_Store ├── mkp │ ├── qemu-1.0.mkp │ └── qemu ├── screenshort_qemu.png ├── README.md ├── agent │ └── plugins │ │ └── qemu └── checks │ └── qemu ├── f5_bigip_x ├── .DS_Store ├── web │ ├── .DS_Store │ └── plugins │ │ ├── .DS_Store │ │ └── wato │ │ └── ace_serverfarm.py ├── README.md └── checks │ ├── lb.include │ ├── f5_bigip_ips_self_floating │ ├── f5_bigip_cluster_v11 │ ├── f5_bigip_clusterstatus │ ├── f5_bigip_vserver │ └── f5_bigip_pool ├── lucent_dhcp_x ├── 1.png ├── 2.png ├── 3.png ├── .DS_Store ├── README.md └── checks │ └── lucent_dhcp_failover ├── mcafee_IPS ├── .DS_Store └── checks │ ├── mcafee_chassis │ └── mcafee_if ├── power_ethernet ├── 1.png ├── .DS_Store ├── README.md └── checks │ └── power_ethernet ├── cisco_ace_cluster ├── 1.png ├── 2.png ├── .DS_Store ├── checks │ ├── .DS_Store │ └── cisco_ace_cluster └── README.md ├── cisco_power ├── .DS_Store └── checks │ └── cisco_power ├── dulpex_status ├── .DS_Store ├── README.md └── checks │ └── dulpex_status ├── port_utilization ├── 1.png ├── README.md └── checks │ └── port_utilization ├── snmp_info_v2 ├── .DS_Store ├── Firmware.png ├── web │ ├── .DS_Store │ └── wato │ │ ├── .DS_Store │ │ └── snmp_info_v2_parameters.py ├── screenshort_snmp_info_v2.png ├── screenshort_snmp_info_v2_changed.png ├── screenshort_snmp_info_v2_keineSSHFirmware.png └── README.md ├── snmp_uptime ├── .DS_Store ├── Uptime.png ├── README.md └── checks │ └── snmp_uptime ├── cisco_ace_serverfarm ├── 1.png ├── 2.png ├── 4.png ├── 5.png ├── .DS_Store ├── web │ ├── .DS_Store │ └── plugins │ │ ├── .DS_Store │ │ └── wato │ │ └── ace_serverfarm.py ├── checks │ ├── .DS_Store │ └── lb.include └── README.md ├── cisco_stp ├── Cisco_STP-0.0.1.mkp └── README.md ├── network_management_with_cmk ├── .DS_Store └── get_config.py ├── cisco_dtp ├── README.md └── checks │ └── cisco_dtp ├── jeelink_TX29DTH ├── readme.md ├── check_mk_agent │ └── jeelink_temp.py ├── jeelink.data └── check_mk_server │ └── jeelink_temp.py ├── convert-mk-csv └── README.md └── livestatus_hosts ├── README.md ├── livestatus_host.py └── livestatus_cmk.py /if64_xx/check_host/config/domains.txt: -------------------------------------------------------------------------------- 1 | .dsl 2 | -------------------------------------------------------------------------------- /if64_xx/check_host/config/neighbor_ignore_find.txt: -------------------------------------------------------------------------------- 1 | .qsc.de 2 | -------------------------------------------------------------------------------- /if64_xx/check_host/config/neighbor_ignore_startswith.txt: -------------------------------------------------------------------------------- 1 | AP__ 2 | 3 | -------------------------------------------------------------------------------- /.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/christianbur/check_mk/HEAD/.DS_Store -------------------------------------------------------------------------------- /if64_xx/1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/christianbur/check_mk/HEAD/if64_xx/1.png -------------------------------------------------------------------------------- /if64_xx/2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/christianbur/check_mk/HEAD/if64_xx/2.png -------------------------------------------------------------------------------- /if64_xx/3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/christianbur/check_mk/HEAD/if64_xx/3.png -------------------------------------------------------------------------------- /if64_xx/4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/christianbur/check_mk/HEAD/if64_xx/4.png -------------------------------------------------------------------------------- /cisco_rf/1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/christianbur/check_mk/HEAD/cisco_rf/1.png -------------------------------------------------------------------------------- /cisco_wlc/1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/christianbur/check_mk/HEAD/cisco_wlc/1.png -------------------------------------------------------------------------------- /cisco_wlc/2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/christianbur/check_mk/HEAD/cisco_wlc/2.png -------------------------------------------------------------------------------- /qnap/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/christianbur/check_mk/HEAD/qnap/.DS_Store -------------------------------------------------------------------------------- /cisco_asa_x/1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/christianbur/check_mk/HEAD/cisco_asa_x/1.png -------------------------------------------------------------------------------- /cisco_hsrp/1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/christianbur/check_mk/HEAD/cisco_hsrp/1.png -------------------------------------------------------------------------------- /cisco_hsrp/2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/christianbur/check_mk/HEAD/cisco_hsrp/2.png -------------------------------------------------------------------------------- /cisco_hsrp/3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/christianbur/check_mk/HEAD/cisco_hsrp/3.png -------------------------------------------------------------------------------- /cisco_hsrp/4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/christianbur/check_mk/HEAD/cisco_hsrp/4.png -------------------------------------------------------------------------------- /cisco_rf/README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/christianbur/check_mk/HEAD/cisco_rf/README.md -------------------------------------------------------------------------------- /cisco_stack/1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/christianbur/check_mk/HEAD/cisco_stack/1.png -------------------------------------------------------------------------------- /fc_port/README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/christianbur/check_mk/HEAD/fc_port/README.md -------------------------------------------------------------------------------- /if64_xx/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/christianbur/check_mk/HEAD/if64_xx/.DS_Store -------------------------------------------------------------------------------- /if64_xx/Tags.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/christianbur/check_mk/HEAD/if64_xx/Tags.png -------------------------------------------------------------------------------- /qemu_kvm/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/christianbur/check_mk/HEAD/qemu_kvm/.DS_Store -------------------------------------------------------------------------------- /qnap/mkp/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/christianbur/check_mk/HEAD/qnap/mkp/.DS_Store -------------------------------------------------------------------------------- /cisco_hsrp/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/christianbur/check_mk/HEAD/cisco_hsrp/.DS_Store -------------------------------------------------------------------------------- /cisco_wlc/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/christianbur/check_mk/HEAD/cisco_wlc/.DS_Store -------------------------------------------------------------------------------- /f5_bigip_x/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/christianbur/check_mk/HEAD/f5_bigip_x/.DS_Store -------------------------------------------------------------------------------- /lucent_dhcp_x/1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/christianbur/check_mk/HEAD/lucent_dhcp_x/1.png -------------------------------------------------------------------------------- /lucent_dhcp_x/2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/christianbur/check_mk/HEAD/lucent_dhcp_x/2.png -------------------------------------------------------------------------------- /lucent_dhcp_x/3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/christianbur/check_mk/HEAD/lucent_dhcp_x/3.png -------------------------------------------------------------------------------- /mcafee_IPS/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/christianbur/check_mk/HEAD/mcafee_IPS/.DS_Store -------------------------------------------------------------------------------- /power_ethernet/1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/christianbur/check_mk/HEAD/power_ethernet/1.png -------------------------------------------------------------------------------- /cisco_ace_cluster/1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/christianbur/check_mk/HEAD/cisco_ace_cluster/1.png -------------------------------------------------------------------------------- /cisco_ace_cluster/2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/christianbur/check_mk/HEAD/cisco_ace_cluster/2.png -------------------------------------------------------------------------------- /cisco_asa_x/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/christianbur/check_mk/HEAD/cisco_asa_x/.DS_Store -------------------------------------------------------------------------------- /cisco_power/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/christianbur/check_mk/HEAD/cisco_power/.DS_Store -------------------------------------------------------------------------------- /cisco_stack/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/christianbur/check_mk/HEAD/cisco_stack/.DS_Store -------------------------------------------------------------------------------- /cisco_stack/README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/christianbur/check_mk/HEAD/cisco_stack/README.md -------------------------------------------------------------------------------- /dulpex_status/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/christianbur/check_mk/HEAD/dulpex_status/.DS_Store -------------------------------------------------------------------------------- /dulpex_status/README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/christianbur/check_mk/HEAD/dulpex_status/README.md -------------------------------------------------------------------------------- /if64_xx/Inventory1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/christianbur/check_mk/HEAD/if64_xx/Inventory1.png -------------------------------------------------------------------------------- /if64_xx/Inventory2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/christianbur/check_mk/HEAD/if64_xx/Inventory2.png -------------------------------------------------------------------------------- /if64_xx/WATO_Fehler.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/christianbur/check_mk/HEAD/if64_xx/WATO_Fehler.png -------------------------------------------------------------------------------- /if64_xx/web/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/christianbur/check_mk/HEAD/if64_xx/web/.DS_Store -------------------------------------------------------------------------------- /lucent_dhcp_x/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/christianbur/check_mk/HEAD/lucent_dhcp_x/.DS_Store -------------------------------------------------------------------------------- /lucent_dhcp_x/README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/christianbur/check_mk/HEAD/lucent_dhcp_x/README.md -------------------------------------------------------------------------------- /port_utilization/1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/christianbur/check_mk/HEAD/port_utilization/1.png -------------------------------------------------------------------------------- /qnap/mkp/qnap-1.3.mkp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/christianbur/check_mk/HEAD/qnap/mkp/qnap-1.3.mkp -------------------------------------------------------------------------------- /snmp_info_v2/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/christianbur/check_mk/HEAD/snmp_info_v2/.DS_Store -------------------------------------------------------------------------------- /snmp_uptime/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/christianbur/check_mk/HEAD/snmp_uptime/.DS_Store -------------------------------------------------------------------------------- /snmp_uptime/Uptime.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/christianbur/check_mk/HEAD/snmp_uptime/Uptime.png -------------------------------------------------------------------------------- /f5_bigip_x/web/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/christianbur/check_mk/HEAD/f5_bigip_x/web/.DS_Store -------------------------------------------------------------------------------- /if64_xx/check_host/config/hostname_wrong_ignore_startwith.txt: -------------------------------------------------------------------------------- 1 | Your System Name Here 2 | Support 3 | 4 | -------------------------------------------------------------------------------- /power_ethernet/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/christianbur/check_mk/HEAD/power_ethernet/.DS_Store -------------------------------------------------------------------------------- /power_ethernet/README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/christianbur/check_mk/HEAD/power_ethernet/README.md -------------------------------------------------------------------------------- /qemu_kvm/mkp/qemu-1.0.mkp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/christianbur/check_mk/HEAD/qemu_kvm/mkp/qemu-1.0.mkp -------------------------------------------------------------------------------- /qnap/screenshort_qnap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/christianbur/check_mk/HEAD/qnap/screenshort_qnap.png -------------------------------------------------------------------------------- /snmp_info_v2/Firmware.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/christianbur/check_mk/HEAD/snmp_info_v2/Firmware.png -------------------------------------------------------------------------------- /cisco_ace_cluster/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/christianbur/check_mk/HEAD/cisco_ace_cluster/.DS_Store -------------------------------------------------------------------------------- /cisco_ace_serverfarm/1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/christianbur/check_mk/HEAD/cisco_ace_serverfarm/1.png -------------------------------------------------------------------------------- /cisco_ace_serverfarm/2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/christianbur/check_mk/HEAD/cisco_ace_serverfarm/2.png -------------------------------------------------------------------------------- /cisco_ace_serverfarm/4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/christianbur/check_mk/HEAD/cisco_ace_serverfarm/4.png -------------------------------------------------------------------------------- /cisco_ace_serverfarm/5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/christianbur/check_mk/HEAD/cisco_ace_serverfarm/5.png -------------------------------------------------------------------------------- /if64_xx/inventory/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/christianbur/check_mk/HEAD/if64_xx/inventory/.DS_Store -------------------------------------------------------------------------------- /snmp_info_v2/web/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/christianbur/check_mk/HEAD/snmp_info_v2/web/.DS_Store -------------------------------------------------------------------------------- /cisco_ace_serverfarm/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/christianbur/check_mk/HEAD/cisco_ace_serverfarm/.DS_Store -------------------------------------------------------------------------------- /cisco_stp/Cisco_STP-0.0.1.mkp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/christianbur/check_mk/HEAD/cisco_stp/Cisco_STP-0.0.1.mkp -------------------------------------------------------------------------------- /if64_xx/web/plugins/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/christianbur/check_mk/HEAD/if64_xx/web/plugins/.DS_Store -------------------------------------------------------------------------------- /qemu_kvm/screenshort_qemu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/christianbur/check_mk/HEAD/qemu_kvm/screenshort_qemu.png -------------------------------------------------------------------------------- /f5_bigip_x/web/plugins/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/christianbur/check_mk/HEAD/f5_bigip_x/web/plugins/.DS_Store -------------------------------------------------------------------------------- /if64_xx/mac_test/oui_wireshark.db: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/christianbur/check_mk/HEAD/if64_xx/mac_test/oui_wireshark.db -------------------------------------------------------------------------------- /snmp_info_v2/web/wato/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/christianbur/check_mk/HEAD/snmp_info_v2/web/wato/.DS_Store -------------------------------------------------------------------------------- /cisco_ace_cluster/checks/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/christianbur/check_mk/HEAD/cisco_ace_cluster/checks/.DS_Store -------------------------------------------------------------------------------- /cisco_ace_serverfarm/web/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/christianbur/check_mk/HEAD/cisco_ace_serverfarm/web/.DS_Store -------------------------------------------------------------------------------- /if64_xx/if64_xx_DisabledChecks.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/christianbur/check_mk/HEAD/if64_xx/if64_xx_DisabledChecks.png -------------------------------------------------------------------------------- /cisco_ace_serverfarm/checks/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/christianbur/check_mk/HEAD/cisco_ace_serverfarm/checks/.DS_Store -------------------------------------------------------------------------------- /if64_xx/web/plugins/metrics/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/christianbur/check_mk/HEAD/if64_xx/web/plugins/metrics/.DS_Store -------------------------------------------------------------------------------- /network_management_with_cmk/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/christianbur/check_mk/HEAD/network_management_with_cmk/.DS_Store -------------------------------------------------------------------------------- /if64_xx/web/plugins/perfometer/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/christianbur/check_mk/HEAD/if64_xx/web/plugins/perfometer/.DS_Store -------------------------------------------------------------------------------- /cisco_ace_serverfarm/web/plugins/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/christianbur/check_mk/HEAD/cisco_ace_serverfarm/web/plugins/.DS_Store -------------------------------------------------------------------------------- /cisco_dtp/README.md: -------------------------------------------------------------------------------- 1 | Ein Check für das Cisco Dynamic Trunking Protocol (DTP). 2 | Wenn Ports auf desirable stehen, gibt es einen Warnung. 3 | -------------------------------------------------------------------------------- /snmp_info_v2/screenshort_snmp_info_v2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/christianbur/check_mk/HEAD/snmp_info_v2/screenshort_snmp_info_v2.png -------------------------------------------------------------------------------- /if64_xx/check_host/config/firmware_remove_domain.txt: -------------------------------------------------------------------------------- 1 | Version 12.2(25)SEF1 2 | Version 12.2(25)SEE3 3 | Version 12.2(50)SE3 4 | Version 12.2(37)SE1 5 | -------------------------------------------------------------------------------- /snmp_info_v2/screenshort_snmp_info_v2_changed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/christianbur/check_mk/HEAD/snmp_info_v2/screenshort_snmp_info_v2_changed.png -------------------------------------------------------------------------------- /cisco_stp/README.md: -------------------------------------------------------------------------------- 1 | Noch in Entwicklung 2 | 3 | In meiner Testumgeung funktioniert der Check schon, aber nur bei MSTP, einfaches STP wird noch nicht unterstützt. 4 | -------------------------------------------------------------------------------- /snmp_info_v2/screenshort_snmp_info_v2_keineSSHFirmware.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/christianbur/check_mk/HEAD/snmp_info_v2/screenshort_snmp_info_v2_keineSSHFirmware.png -------------------------------------------------------------------------------- /f5_bigip_x/README.md: -------------------------------------------------------------------------------- 1 | 2 | **Beschreibung:** 3 | Erweiterung des bestehenden F5 CMK-Checks umd die Serverfarmen besser in WATO einstellen zu könnnen (siehe auch cisco_ace_serverfarm) 4 | -------------------------------------------------------------------------------- /if64_xx/inventory/mac_custom.db: -------------------------------------------------------------------------------- 1 | mac_custom_decode_dict = { 2 | '00:08:5D': 'Aastra Telefon', 3 | '00:E0:C5': 'ThinClient', 4 | '00:0B:CA': 'ThinClient', 5 | '00:26:73': 'Drucker', 6 | } 7 | -------------------------------------------------------------------------------- /jeelink_TX29DTH/readme.md: -------------------------------------------------------------------------------- 1 | http://forum.fhem.de/index.php?topic=14786.msg401221#msg401221 2 | http://www.meintechblog.de/2015/01/fhem-mit-jeelink-luftfeuchte-und-temperatur-zum-low-cost-tarif-messen/ 3 | -------------------------------------------------------------------------------- /if64_xx/web/plugins/perfometer/if64_xx_perfometer.py: -------------------------------------------------------------------------------- 1 | perfometers["check_mk-if64_router"] = perfometer_check_mk_if 2 | perfometers["check_mk-if64_neighbor"] = perfometer_check_mk_if 3 | perfometers["check_mk-if64_trunk"] = perfometer_check_mk_if 4 | -------------------------------------------------------------------------------- /if64_xx/web/plugins/metrics/if64_xx_metrics.py: -------------------------------------------------------------------------------- 1 | check_metrics["check_mk-if64_trunk"] = if_translation 2 | check_metrics["check_mk-if64_router"] = if_translation 3 | check_metrics["check_mk-if64_neighbor"] = if_translation 4 | -------------------------------------------------------------------------------- /jeelink_TX29DTH/check_mk_agent/jeelink_temp.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # -*- coding: utf-8 -*- 3 | 4 | 5 | # import sys module 6 | import sys 7 | 8 | file = open('/root/python/jeelink.data') 9 | jeelink_data = file.readlines() 10 | file.close() 11 | 12 | print( '<<>>' ) 13 | for line in jeelink_data: 14 | print line.strip() 15 | -------------------------------------------------------------------------------- /jeelink_TX29DTH/jeelink.data: -------------------------------------------------------------------------------- 1 | KS_Kuehlschrank;6.3;0;-;-;85;1454241691;1454241847 2 | KS_Gefrierfach;-18.7;0;-;NEW;93;1454241765;1454241834 3 | Schlafzimmer_Bett;16.3;58;-;-;184;1454241848;1454241848 4 | Bad;17.5;55;-;-;258;1454241708;1454241842 5 | Schlafzimmer_Fenster;17.3;56;-;-;149;1454240358;1454241845 6 | Wohnzimmer;18.1;55;-;-;180;1454241562;1454241840 7 | Kueche;18.2;54;-;-;171;1454241808;1454241843 8 | -------------------------------------------------------------------------------- /qemu_kvm/mkp/qemu: -------------------------------------------------------------------------------- 1 | {'author': 'Christian Burmeister', 2 | 'description': 'Monitor qemu/KVM virtal maschines', 3 | 'download_url': 'https://github.com/christianbur/check_mk/qemu_kvm', 4 | 'files': {'agents': ['qemu'], 5 | 'checkman': [], 6 | 'checks': ['qemu'], 7 | 'doc': [], 8 | 'pnp-rraconf': [], 9 | 'pnp-templates': [], 10 | 'web': []}, 11 | 'name': 'qemu', 12 | 'num_files': 2, 13 | 'title': 'Qemu', 14 | 'version': '1.0', 15 | 'version.min_required': '1.2.6', 16 | 'version.packaged': '1.2.7i3p3'} 17 | -------------------------------------------------------------------------------- /convert-mk-csv/README.md: -------------------------------------------------------------------------------- 1 | **Beschreibung:** 2 | Das Skript convert-mk-csv.py habe ich mal geschrieben um mehren tausend Hostes in CMK zu importieren. 3 | Es konvertiert das CMK Format in eine CSV-Datei und umgekehrt. 4 | 5 | Möglichkeiten: 6 | host.mk -> host.csv (python convert-mk-csv.py -c csv2mk -i ./input.csv -o ./output.mk) 7 | host.csv -> host.mk (python convert-mk-csv.py -c mk2csv -i ./input.mk -o ./output.csv) 8 | 9 | 10 | **Installation:** 11 | Einfach die CMK-Datein (unter OMD[site]:~/etc/check_mk/conf.d/wato/*/*.mk) dem Skript als Parameter übergeben 12 | -------------------------------------------------------------------------------- /if64_xx/check_host/log/check_hosts_2015-09-17_15-55-12.log: -------------------------------------------------------------------------------- 1 | 2 | #-------------------------------------------------------------------------------- 3 | 4 | 5 | Verbinde zu: ('1.1.1.10', 6557) 6 | Verbindungsversuch: #0 7 | 8 | 9 | Verbinde zu: ('1.1.1.13', 6557) 10 | Verbindungsversuch: #0 11 | 12 | Checked Hosts: 2855 13 | Date: 2015-09-17_15-55-12 14 | 15 | ERROR: Neuer Host: TEST-Switch1.domain.de...GigabitEthernet2/2 gefunden mit CDP, von: test1 16 | ERROR: Neuer Host: TEST-Switch2.domain.de...GigabitEthernet1/2 gefunden mit CDP, von: test2 17 | 18 | 19 | -------------------------------------------------------------------------------- /snmp_uptime/README.md: -------------------------------------------------------------------------------- 1 | 2 | **Beschreibung:** 3 | Der snmp_uptimeCheck überwacht die Uptime von Geräten. 4 | Ich musste den Check anpassen, da der abgefrage Uptime Werte nur ein 32-Bit Counter ist und dieser daher nach 496 Tagen auf 0 zurückgesetzt wird (https://tools.cisco.com/quickview/bug/CSCeh49492). 5 | Auf Cisco Geräten wird daher, wenn vorhanden, die OID snmpEngineTime verwendet. 6 | 7 | 8 | 9 | **Installation:** 10 | Manuell: 11 | CMK-Server: den Check aus "checks/snmp_uptime" nach "/omd/sites/SITE/local/share/check_mk/checks/" kopieren 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /qnap/checkman/qnap_volumes: -------------------------------------------------------------------------------- 1 | title: Check Qnap Volumes 2 | catalog: hw/storagehw/qnap 3 | agents: snmp 4 | author: Andre Eckstein 5 | license: GPL 6 | distribution: check_mk 7 | description: 8 | This check monitors the (raid) state of the volumes. 9 | 10 | item: 11 | The items are the volumes. 12 | 13 | perfdata: 14 | no perfdata output is given 15 | 16 | inventory: 17 | All volumes are inventorized automatically 18 | 19 | examples: 20 | check is critical if the volume state is different than "Ready" 21 | 22 | [parameters] 23 | no_params 24 | 25 | [configuration] 26 | no configuration possible 27 | -------------------------------------------------------------------------------- /qemu_kvm/README.md: -------------------------------------------------------------------------------- 1 | **Beschreibung:** 2 | Mit dem "qemu" CMK-Plugin können virtualle Maschinen in der qemu/KVM Umgebung überwacht werden 3 | 4 | **Installation:** 5 | Mit MPK: 6 | check_mk -P install qemu-1.0.mkp 7 | 8 | Manuell: 9 | CMK-Host: den Agent aus "agent/plugins/qemu" nach "/usr/lib/check_mk_agent/local/" kopieren 10 | CMK-Server: den Check aus "checks/qemu" nach "/omd/sites/SITE/local/share/check_mk/checks/" kopieren 11 | 12 | **Screenshot:** 13 | ![ScreenShot](https://github.com/christianbur/check_mk/blob/master/qemu_kvm/screenshort_qemu.png) 14 | 15 | **Performance Data:** 16 | - cpu_% 17 | - memory_current_% 18 | - memory__assigned_MB 19 | -------------------------------------------------------------------------------- /cisco_asa_x/README.md: -------------------------------------------------------------------------------- 1 | **Beschreibung:** 2 | Der cisco_asa_connections und cisco_asa_vpnsessions Check dient zur Überwachung von Cisco ASA Connections und gibt die Werte als PerfData aus. 3 | Der cisco_asa_vpnsessions ist speziell für die Überwachung von Cisco AnyConnect (VPN) und gibt die akutell angemeldeten User als PerfDaten aus. 4 | 5 | **Installation:** 6 | Manuell: 7 | CMK-Server: den Check aus "checks/cisco_asa_connections" nach "/omd/sites/SITE/local/share/check_mk/checks/" kopieren 8 | CMK-Server: den Check aus "checks/cisco_asa_vpnsessions" nach "/omd/sites/SITE/local/share/check_mk/checks/" kopieren 9 | 10 | 11 | **Screenshort:** 12 | ![ScreenShot](https://github.com/christianbur/check_mk/blob/master/cisco_asa_x/1.png) 13 | -------------------------------------------------------------------------------- /livestatus_hosts/README.md: -------------------------------------------------------------------------------- 1 | ***Beschreibung:*** 2 | Mit livestatus_host.py kann man sich sehr einfach eine Host-Datei (/etc/hosts) aus allen CMK-Hosts erstellen. 3 | 4 | Die Hosts werden jeweils pro CMK-Folder ausgegeben mit IP-Adresse, Hostname und Alias. 5 | 6 | ***Beispiel:*** 7 | 8 | ```python 9 | #/dummy 10 | 127.0.0.1 http_test #http_test 11 | 80.69.98.110 dns_test #dns_test 12 | 13 | 14 | # 15 | 192.123.20.1 fw0 #test 16 | 192.123.20.30 test #test 17 | 18 | 19 | #/linux_server 20 | 127.0.0.1 tes #test 21 | ``` 22 | -------------------------------------------------------------------------------- /port_utilization/README.md: -------------------------------------------------------------------------------- 1 | **Beschreibung:** 2 | Der Check port_utilization zeigt die folgenden Werte an: 3 | - Gesamtanzahl der Switchports 4 | - die davon aktiven Ports 5 | - Die Trunk/Uplink von HP und Cisco Switchen 6 | - die davon aktiven Ports 7 | - Die Access-Ports 8 | - die davon aktiven Ports 9 | 10 | **Installation:** 11 | Manuell: 12 | CMK-Server: den Check aus "checks/port_utilization" nach "/omd/sites/SITE/local/share/check_mk/checks/" kopieren 13 | CMK-Server: den Check aus "if64_xxxxx/checks/cmk_v1.2.7/if_network.include" nach "/omd/sites/SITE/local/share/check_mk/checks/" kopieren 14 | 15 | 16 | **Screenshort:** 17 | ![ScreenShot](https://github.com/christianbur/check_mk/blob/master/port_utilization/1.png) 18 | -------------------------------------------------------------------------------- /cisco_wlc/README.md: -------------------------------------------------------------------------------- 1 | **Beschreibung:** 2 | Der cisco_wlc Check dient zur Überwachung von Wireless LAN Controllern und ist einer Erweiterung des CMK-Checks. 3 | Ich verwende den Check im Cluster, da wir zwei Controller verwenden. 4 | 5 | Der Check gibt folgende Informationen aus. 6 | - IP 7 | - AP enabled/disabled 8 | - AP-Group 9 | - WL-Controller 10 | - überprüft den primary und secondary Controller und gibt eine Warnung bei einer Änderung 11 | - Warnung wenn AP nicht mehr gefunden wird 12 | 13 | **Installation:** 14 | Manuell: 15 | CMK-Server: den Check aus "checks/cisco_wlc" nach "/omd/sites/SITE/local/share/check_mk/checks/" kopieren 16 | 17 | 18 | 19 | **Screenshort:** 20 | ![ScreenShot](https://github.com/christianbur/check_mk/blob/master/cisco_wlc/1.png) 21 | -------------------------------------------------------------------------------- /qnap/checkman/qnap_fans: -------------------------------------------------------------------------------- 1 | title: Check Qnap fanse 2 | catalog: hw/storagehw/qnap 3 | agents: snmp 4 | author: Andre Eckstein 5 | license: GPL 6 | distribution: check_mk 7 | description: 8 | This check monitors the fan speed of Qnap Storage devices. 9 | 10 | item: 11 | The first item is Fan1. 12 | The second item is Fan2. 13 | 14 | perfdata: 15 | One variable: the current fan speed in rpm. 16 | 17 | inventory: 18 | Both fans are automatically inventorized. 19 | 20 | examples: 21 | # set default levels for all qnaps 22 | qnap_fans_default_levels = (5000, 5500) 23 | 24 | [parameters] 25 | warning (int): Speed at which a warning level is triggered 26 | critical (int): Speed at wich w critical level is triggered 27 | 28 | [configuration] 29 | qnap_fans_default_levels (int, int): Default levels for warning 30 | and critical. This is preset to {(6000,6500)}. 31 | -------------------------------------------------------------------------------- /qnap/checkman/qnap_hdd: -------------------------------------------------------------------------------- 1 | title: Check Qnap HDD 2 | catalog: hw/storagehw/qnap 3 | agents: snmp 4 | author: Andre Eckstein 5 | license: GPL 6 | distribution: check_mk 7 | description: 8 | This check monitors the state and the temperature of the harddisks. 9 | 10 | item: 11 | The items are the disks hdd1-hddn. 12 | 13 | perfdata: 14 | One variable: the current temperature of the hdd in degrees celsius 15 | 16 | inventory: 17 | All HDDS are inventorized automatically 18 | 19 | examples: 20 | # set default levels for all qnaps 21 | qnap_hdd_temp_default_levels = (30,40) 22 | 23 | [parameters] 24 | warning (int): Temperature at which a warning level is triggered 25 | critical (int): Critical level for temperature 26 | 27 | [configuration] 28 | qnap_hdd_temp_default_levels (int, int): Default levels for warning 29 | and critical. This is preset to {(40,45)}. 30 | -------------------------------------------------------------------------------- /cisco_hsrp/README.md: -------------------------------------------------------------------------------- 1 | **Beschreibung:** 2 | Ich habe den cisco_hsrp Check etwas angepasst (siehe Screenshorts) um sie im produktiven Betieb besser benutzen zu können. 3 | So werden z.B. auch falsch konfigurierte HSRP-Interface gemeldet. 4 | 5 | **Installation:** 6 | Manuell: 7 | CMK-Server: den Check aus "checks/cisco_hsrp" nach "/omd/sites/SITE/local/share/check_mk/checks/" kopieren 8 | 9 | 10 | 11 | **Screenshort:** 12 | Active HSRP-Router 13 | ![ScreenShot](https://github.com/christianbur/check_mk/blob/master/cisco_hsrp/2.png) 14 | 15 | Standby HSRP-Router 16 | ![ScreenShot](https://github.com/christianbur/check_mk/blob/master/cisco_hsrp/1.png) 17 | 18 | Fehelr in HSRP Config 19 | ![ScreenShot](https://github.com/christianbur/check_mk/blob/master/cisco_hsrp/3.png) 20 | 21 | Failover 22 | ![ScreenShot](https://github.com/christianbur/check_mk/blob/master/cisco_hsrp/4.png) 23 | -------------------------------------------------------------------------------- /qnap/mkp/qnap: -------------------------------------------------------------------------------- 1 | {'author': 'Andre Eckstein, Christian Burmeister', 2 | 'description': 'Several checks to monitor Qnap Storage Devices', 3 | 'download_url': 'https://github.com/christianbur/check_mk/tree/master/qnap', 4 | 'files': {'agents': [], 5 | 'checkman': ['qnap_fans', 'qnap_hdd', 'qnap_temp', 'qnap_volumes'], 6 | 'checks': ['qnap_fans', 7 | 'qnap_hdd', 8 | 'qnap_info', 9 | 'qnap_temp', 10 | 'qnap_volumes'], 11 | 'doc': [], 12 | 'pnp-rraconf': [], 13 | 'pnp-templates': ['check_mk-qnap_fans.php', 14 | 'check_mk-qnap_hdd.php', 15 | 'check_mk-qnap_temp.php'], 16 | 'web': []}, 17 | 'name': 'qnap', 18 | 'num_files': 12, 19 | 'title': 'Check Qnap Storage', 20 | 'version': '1.3', 21 | 'version.min_required': '1.1.10p3', 22 | 'version.packaged': '1.2.7i3p3'} 23 | -------------------------------------------------------------------------------- /qnap/checkman/qnap_temp: -------------------------------------------------------------------------------- 1 | title: Check Qnap Temperature 2 | catalog: hw/storagehw/qnap 3 | agents: snmp 4 | author: Andre Eckstein 5 | license: GPL 6 | distribution: check_mk 7 | description: 8 | This check monitors the cpu and system temperature of Qnap Storage devices. 9 | 10 | item: 11 | The first item is the system temperature. 12 | The second item is the cpu temperature. 13 | 14 | perfdata: 15 | One variable: the current temperature in degrees celsius. 16 | 17 | inventory: 18 | CPU and system temperature sensors are automatically inventorized. 19 | 20 | examples: 21 | # set default levels for all qnaps 22 | qnap_temp_default_levels = (25, 30) 23 | 24 | [parameters] 25 | warning (int): Temperature at which a warning level is triggered 26 | critical (int): Critical level for temperature 27 | 28 | [configuration] 29 | qnap_temp_default_levels (int, int): Default levels for warning 30 | and critical. This is preset to {(55,60)}. 31 | -------------------------------------------------------------------------------- /qemu_kvm/agent/plugins/qemu: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # based upon 'qemu' from 4 | # 12/2010 Matthias Henze 5 | # Lizenz: GPL v2 6 | # 7 | # updated for libvirtd (virsh) by 8 | # Jonathan Mills 09/2011 9 | # 10 | # updated by 11 | # Christian Burmeister 05/2015 12 | 13 | if which virsh >/dev/null; then 14 | echo '<<>>' 15 | virsh list | grep -v 'State' | grep -v '^--' | grep -v '^$' | while read L 16 | do 17 | ID=$(echo $L | awk '{print $1}') 18 | NAME=$(echo $L | awk '{print $2}') 19 | STATE=$(echo $L | awk '{print $3}') 20 | MEM=$(virsh dominfo $NAME | grep 'Used memory' | awk '{print $3}') 21 | let MEM=MEM/1024 22 | PID=$(ps aux | grep kvm | grep $NAME | awk '{print $2}') 23 | if [ $PID -gt 0 ]; then 24 | #DATA=$(top -p $PID -n 1 -b | tail -n 2 | head -n 1 | awk -- '{print $9" "$10}') 25 | DATA=$(top -p $PID -n 1 -b | tail -1 | awk -- '{print $9" "$10}') 26 | else 27 | DATA="" 28 | fi 29 | echo $ID" "$NAME" "$STATE" "$MEM" "$DATA 30 | done 31 | fi 32 | -------------------------------------------------------------------------------- /if64_xx/mac_test/convert_oui.py: -------------------------------------------------------------------------------- 1 | import re,os,sys 2 | 3 | def __read_mac_file( filename): 4 | 5 | fh = open(filename) 6 | 7 | mac_dict = {} 8 | for line in fh: 9 | if line.startswith("#") or line.strip() == "" : 10 | continue 11 | 12 | regex = re.compile("^([0-9a-zA-z:\/]*)\s(.*)\s#(.*)$") 13 | m = re.search(regex, line) 14 | if m: 15 | prefix_mac = m.group(1).strip() 16 | vendor = m.group(2).strip() 17 | desc = m.group(3).strip() 18 | 19 | mac_dict[prefix_mac] = vendor 20 | 21 | return mac_dict 22 | 23 | 24 | 25 | 26 | 27 | mac = __read_mac_file("./oui_wireshark.db") 28 | 29 | fh = open("./testmac.txt", "w") 30 | fh.writelines(str(mac).replace(",",",\n")) 31 | fh.close() 32 | -------------------------------------------------------------------------------- /snmp_info_v2/README.md: -------------------------------------------------------------------------------- 1 | **Beschreibung:** 2 | Da mit der Check_mk Installation vorwiegend Cisco und HP Netzwerkgeräte überwacht werden, wurde der snmp_info Check um folgende Punkte erweitert: 3 | - Auslesen der Seriennummer 4 | - Sobald sich die Seriennummer ändert, geht der Check auf WARN. (so bekommt man z.B. mit wenn ein Switch oder Router getaucht wird) 5 | - Auslesen des Models 6 | - Der Check gibt einen Infotext aus, wenn er eine unbekannte Firmware-Version ohne SSH erkennt. 7 | 8 | **Installation:** 9 | Manuell: 10 | CMK-Server: den Check aus "checks/snmp_info_v2" nach "/omd/sites/SITE/local/share/check_mk/checks/" kopieren 11 | 12 | Info: 13 | Der orginale snmp_info Check sollte deaktiviert werden 14 | 15 | **Screenshort:** 16 | ![ScreenShot](https://github.com/christianbur/check_mk/blob/master/snmp_info_v2/screenshort_snmp_info_v2.png) 17 | 18 | Seriennummer hat sich geändert 19 | ![ScreenShot](https://github.com/christianbur/check_mk/blob/master/snmp_info_v2/screenshort_snmp_info_v2_changed.png) 20 | 21 | Cisco Firmware ohne SSH 22 | ![ScreenShot](https://github.com/christianbur/check_mk/blob/master/snmp_info_v2/screenshort_snmp_info_v2_keineSSHFirmware.png) 23 | -------------------------------------------------------------------------------- /qnap/README.md: -------------------------------------------------------------------------------- 1 | **Beschreibung:** 2 | Mit dem "qnap" CMK-Plugin können NAS-Geräte von Qnap überwacht werden. 3 | Der Check wurde in der Version 1.1 von Andre Eckstein geschrieben, um den Check jedoch auf mein CMK-Instanz mit der Version 1.2.7 laufen zu lassen, musste ich einige kleinere Verändeurngen vornehmen. 4 | 5 | **TODO:** 6 | - die statische Inventory Funktion des "qnap_fans" Checks müsste überarbeitet werden, mein Qnap liefert jedoch keine Lüfterdaten im SNMP. 7 | - Komischerweise wird bei neimen Qnap der snmp_info Check nicht ausgeführt, obwohl die OID 1.3.6.1.2.1.1.1.0 ok ist. 8 | SNMPv2-MIB::sysDescr.0 = STRING: Linux TS-219 4.2.0 9 | 10 | 11 | **Installation:** 12 | Mit MPK: 13 | check_mk -P install qnap-1.2.mkp 14 | 15 | Manuell: 16 | checksqnap_* nach /omd/sites/SITE/local/share/check_mk/checks/ kopieren 17 | checkman/qnap_* nach /omd/sites/SITE/local/share/check_mk/checkman/ kopieren 18 | pnp-templates/check_mk-qnap_* nach /omd/sites/SITE/local/share/check_mk/pnp-templates/ kopieren 19 | 20 | **Screenshort:** 21 | ![ScreenShot](https://github.com/christianbur/check_mk/blob/master/qnap/screenshort_qnap.png) 22 | 23 | 24 | -------------------------------------------------------------------------------- /cisco_ace_cluster/README.md: -------------------------------------------------------------------------------- 1 | **Beschreibung:** 2 | Der cisco_ace_cluster Check überwacht die "fault tolerance groups" eines Cisco ACE Loadbalancers (ACE 4710). 3 | Sobald sich der Zustand ändert, meldet der Check einen Alarm. 4 | 5 | **INFO:** 6 | Auf einem Cisco ACE Loadbalancer können unterschiedliche Contexte angelegt werden. 7 | Die Contexte können auf zwei unterschiedliche Arten abgefragt werden: 8 | 1. Über die IP des Admin-Contextes 9 | - um die einzelnen Contexte abzufragen (Ausnahme Admin-Context), muss an die SNMP-Community der Context-Name angehängt werden (z.B. Community@Context) 10 | - CMK unterstützt diese Art der SNMP-Community leider nicht 11 | 2. Über die IP des jeweiligen Contextes 12 | - Ich habe für jeden Context in CMK einen Host mit der jeweiligen IP-Adresse angelegt, somit ist die SNMP-Community bei allen Contexten gleich. 13 | - Der Check cisco_ace_cluster funktioniert nur im Admin-Context. 14 | 15 | 16 | **Installation:** 17 | Manuell: 18 | CMK-Server: den Check aus "checks/cisco_ace_cluster" nach "/omd/sites/SITE/local/share/check_mk/checks/" kopieren 19 | 20 | 21 | 22 | **Screenshort:** 23 | ![ScreenShot](https://github.com/christianbur/check_mk/blob/master/cisco_ace_cluster/1.png) 24 | -------------------------------------------------------------------------------- /snmp_info_v2/web/wato/snmp_info_v2_parameters.py: -------------------------------------------------------------------------------- 1 | register_check_parameters( 2 | subgroup_applications, 3 | "snmp_info_v2_parameters", 4 | _("SNMP Firmware Check"), 5 | Dictionary( 6 | help = _("SNMP Firmware Check"), 7 | elements = [ 8 | ( "standard_firmware", 9 | ListOf( 10 | Tuple( 11 | title = ("SNMP Firmware Check"), 12 | elements = [ 13 | TextUnicode( 14 | title = _("ModelName starts with"), 15 | help = _("ModelName starts with"), 16 | allow_empty = False, 17 | ), 18 | TextUnicode( 19 | title = _("Standard firmware for ModelName (search in sysDescr)"), 20 | help = _("Standard firmware for ModelName (search in sysDescr"), 21 | allow_empty = False, 22 | ), 23 | DropdownChoice( 24 | title = _("Status if standard firmware not found in sysDesc"), 25 | default_value = None, 26 | choices = [ 27 | ( "0", _("OK") ), 28 | ( "1", _("WARN") ), 29 | ]), 30 | ]), 31 | add_label = _("Add Firmware Check"), 32 | movable = False, 33 | title = _("check Firmware-String in sysDesc"), 34 | )), 35 | ], 36 | ), 37 | None, 38 | "dict", 39 | #match_type = "dict", 40 | ) 41 | -------------------------------------------------------------------------------- /qnap/pnp-templates/check_mk-qnap_temp.php: -------------------------------------------------------------------------------- 1 | 37 | -------------------------------------------------------------------------------- /qnap/pnp-templates/check_mk-qnap_hdd.php: -------------------------------------------------------------------------------- 1 | 37 | -------------------------------------------------------------------------------- /qnap/pnp-templates/check_mk-qnap_fans.php: -------------------------------------------------------------------------------- 1 | 37 | -------------------------------------------------------------------------------- /f5_bigip_x/checks/lb.include: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | 3 | 4 | def wato_return_state_lb(params, item, return_status, msg, farm_prefix): 5 | # WATO return_state Config 6 | if params != None: 7 | return_status_orginal = return_status 8 | state_descr = { 9 | 0:"OK", 10 | 1:"WARN", 11 | 2:"CRIT", 12 | 3:"UNKN"} 13 | 14 | individual_wato_config = False 15 | ace_serverfarm_wato = params.get('ace_serverfarm_wato',[]) 16 | for sf in ace_serverfarm_wato: 17 | regex_serverfarm = sf[0].replace(farm_prefix,"") 18 | if regex(regex_serverfarm).match(item): 19 | individual_wato_config = True 20 | return_crit = sf[1] 21 | return_warn = sf[2] 22 | if return_status_orginal == 2 and return_crit != None: 23 | msg += " --- [Individual-Rule, orginal return status: " + state_descr[return_status_orginal] + " ]" 24 | return_status = int(return_crit) 25 | if return_status_orginal == 1 and return_warn != None: 26 | msg += " --- [Individual-Rule, orginal return status: " + state_descr[return_status_orginal] + " ]" 27 | return_status = int(return_warn) 28 | 29 | if not individual_wato_config: 30 | return_default_crit = params.get('default_crit', None) 31 | if return_status_orginal == 2 and return_default_crit != None: 32 | msg += " --- [Default-Rule, orginal return status: " + state_descr[return_status_orginal] + " ]" 33 | return_status = int(return_default_crit) 34 | 35 | return_default_warn = params.get('default_warn', None) 36 | if return_status_orginal == 1 and return_default_warn != None: 37 | msg += " --- [Default-Rule, orginal return status: " + state_descr[return_status_orginal] + " ]" 38 | return_status = int(return_default_warn) 39 | return (return_status, msg) 40 | 41 | 42 | -------------------------------------------------------------------------------- /cisco_ace_serverfarm/checks/lb.include: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | 3 | 4 | def wato_return_state_lb(params, item, return_status, msg, farm_prefix): 5 | # WATO return_state Config 6 | if params != None: 7 | return_status_orginal = return_status 8 | state_descr = { 9 | 0:"OK", 10 | 1:"WARN", 11 | 2:"CRIT", 12 | 3:"UNKN"} 13 | 14 | individual_wato_config = False 15 | ace_serverfarm_wato = params.get('ace_serverfarm_wato',[]) 16 | for sf in ace_serverfarm_wato: 17 | regex_serverfarm = sf[0].replace(farm_prefix,"") 18 | if regex(regex_serverfarm).match(item): 19 | individual_wato_config = True 20 | return_crit = sf[1] 21 | return_warn = sf[2] 22 | if return_status_orginal == 2 and return_crit != None: 23 | msg += " --- [Individual-Rule, orginal return status: " + state_descr[return_status_orginal] + " ]" 24 | return_status = int(return_crit) 25 | if return_status_orginal == 1 and return_warn != None: 26 | msg += " --- [Individual-Rule, orginal return status: " + state_descr[return_status_orginal] + " ]" 27 | return_status = int(return_warn) 28 | 29 | if not individual_wato_config: 30 | return_default_crit = params.get('default_crit', None) 31 | if return_status_orginal == 2 and return_default_crit != None: 32 | msg += " --- [Default-Rule, orginal return status: " + state_descr[return_status_orginal] + " ]" 33 | return_status = int(return_default_crit) 34 | 35 | return_default_warn = params.get('default_warn', None) 36 | if return_status_orginal == 1 and return_default_warn != None: 37 | msg += " --- [Default-Rule, orginal return status: " + state_descr[return_status_orginal] + " ]" 38 | return_status = int(return_default_warn) 39 | return (return_status, msg) 40 | 41 | 42 | -------------------------------------------------------------------------------- /qnap/checks/qnap_info: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | # -*- encoding: utf-8; py-indent-offset: 4 -*- 3 | # +------------------------------------------------------------------+ 4 | # | ____ _ _ __ __ _ __ | 5 | # | / ___| |__ ___ ___| | __ | \/ | |/ / | 6 | # | | | | '_ \ / _ \/ __| |/ / | |\/| | ' / | 7 | # | | |___| | | | __/ (__| < | | | | . \ | 8 | # | \____|_| |_|\___|\___|_|\_\___|_| |_|_|\_\ | 9 | # | | 10 | # | Copyright Mathias Kettner 2010 mk@mathias-kettner.de | 11 | # +------------------------------------------------------------------+ 12 | # 13 | # This file is part of Check_MK. 14 | # The official homepage is at http://mathias-kettner.de/check_mk. 15 | # 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 | # ails. 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. 26 | 27 | # Author: Andre Eckstein 28 | # updated by Christian Burmeister 10/2015 29 | 30 | def inventory_qnap_info(checkname, info): 31 | # import pprint; pprint.pprint(info) 32 | return [(None, None, None)] 33 | 34 | def check_qnap_info(item, no_params, info): 35 | try: 36 | uptime = int(info[0][2]) 37 | uptime = uptime / 360000 38 | return (0, "%s -- Serial Nr.: %s -- Uptime: %s hours" % (info[0][0], info[0][1], uptime )) 39 | print "test" 40 | except: 41 | return (3, "UNKNOWN - No SNMP Output from Agent") 42 | 43 | check_info['qnap_info'] = (check_qnap_info, "QNAP Info", 0, inventory_qnap_info) 44 | 45 | snmp_info['qnap_info'] = ( ".1.3.6.1", [ "2.1.1.1.0", "2.1.47.1.1.1.1.11.1", "2.1.25.1.1.0" ] ) 46 | snmp_scan_functions['qnap_info'] = \ 47 | lambda oid: "QNAP Systems" in oid('.1.3.6.1.2.1.47.1.1.1.1.12.1') 48 | -------------------------------------------------------------------------------- /jeelink_TX29DTH/check_mk_server/jeelink_temp.py: -------------------------------------------------------------------------------- 1 | factory_settings["jeelink_default_levels"] = { 2 | "levels" : (70, 80), 3 | "device_levels_handling" : "devdefault", 4 | } 5 | 6 | 7 | 8 | def inventory_jeelink_temp(info): 9 | inventory = [] 10 | for sensor in info: 11 | sensor_name = sensor[0].split(";")[0] 12 | inventory.append( (sensor_name, None) ) 13 | 14 | return inventory 15 | 16 | def check_jeelink_temp(item, params, info): 17 | 18 | dev_warn = 1 19 | dev_crit = 1 20 | 21 | for sensor in info: 22 | sensor_name = sensor[0].split(";")[0] 23 | if sensor_name == item: 24 | temperature = savefloat(sensor[0].split(";")[1]) 25 | humidity = saveint(sensor[0].split(";")[2]) 26 | battery_weak = sensor[0].split(";")[3] 27 | battery_new = sensor[0].split(";")[4] 28 | counter = saveint(sensor[0].split(";")[5]) 29 | last_update = saveint(sensor[0].split(";")[6]) 30 | last_seen = saveint(sensor[0].split(";")[7]) 31 | 32 | minute_2 = 2 * 60 33 | if last_seen < int(time.time()) - minute_2: 34 | return 1, "received data older than 2 minutes (!)" 35 | 36 | if humidity == 0: 37 | t_status, t_infotext, t_perfdata = check_temperature(temperature, params) 38 | status = t_status 39 | infotext = "T: %s" % t_infotext 40 | perfdata = t_perfdata 41 | 42 | else: 43 | h_status, h_infotext, h_perfdata = check_humidity(humidity, params) 44 | t_status, t_infotext, t_perfdata = check_temperature(temperature, params) 45 | status = t_status 46 | infotext = "T: %s, H: %s" % (t_infotext, h_infotext) 47 | perfdata = t_perfdata + h_perfdata 48 | 49 | infotext += ", (Counter: %s)" % (counter) 50 | if battery_weak != "-": 51 | infotext += " - (!) Battery weak" 52 | status = 1 53 | if battery_new != "-": 54 | infotext += " -(!) Battery New" 55 | 56 | return status, infotext, perfdata 57 | 58 | 59 | # declare the check to Check_MK 60 | check_info["jeelink_temp"] = { 61 | 'check_function': check_jeelink_temp, 62 | 'has_perfdata': True, 63 | 'inventory_function': inventory_jeelink_temp, 64 | 'service_description': 'jeelink %s', 65 | "includes" : [ "temperature.include" , "humidity.include"], 66 | "group" : "temperature", 67 | "default_levels_variable" : "jeelink_temp_default_levels", 68 | } 69 | -------------------------------------------------------------------------------- /qemu_kvm/checks/qemu: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | # -*- encoding: utf-8; py-indent-offset: 4 -*- 3 | 4 | # based upon 'qemu' from 5 | # 12/2010 Matthias Henze 6 | # Lizenz: GPL v2 7 | # 8 | # updated for libvirtd (virsh) by 9 | # Jonathan Mills 09/2011 10 | # 11 | # updated by 12 | # Christian Burmeister 05/2015 13 | 14 | # Example output from agent: 15 | # <<>> 16 | # 4 i-4B9008BE running 2048 4.0 2.7 17 | # 5 i-44F608B6 running 2048 0.0 0.7 18 | 19 | 20 | 21 | 22 | # inventory 23 | def inventory_qemu(checkname, info): 24 | inventory = [] 25 | for line in info: 26 | if line[2] == "running": # only VM's running while inventory are monitored ! 27 | vm = line[1] # we want to capture hostname, not vm id here 28 | 29 | # Fix annoying OpenStack misnaming of VMs 30 | name = vm.split('-') 31 | if name[0] == "instance": 32 | name[0] = "i" 33 | vm = '-'.join(name) 34 | ## 35 | 36 | inventory.append( (vm, None) ) 37 | return inventory 38 | 39 | # check 40 | def check_qemu(name, param, info): 41 | for line in info: 42 | perfdata = [] 43 | 44 | vm = line[1] 45 | host = vm.split('-') 46 | if host[0] == "instance": 47 | host[0] = "i" 48 | vm = '-'.join(host) 49 | 50 | if vm == name: 51 | item = line[0] 52 | status = line[2] 53 | assigned_mem = line[3] 54 | 55 | infotext = "%s (id: %s" % (status, item) 56 | 57 | if status == "running": 58 | # 4 i-4B9008BE running 2048 4.0 2.7 59 | if len(line) == 6: 60 | current_cpu = int(round(float(line[4]))) 61 | infotext += ", CPU: %s%%" % (current_cpu) 62 | perfdata.append( ( "cpu_%", current_cpu ) ) 63 | 64 | current_mem = int(round(float(line[5]))) 65 | infotext += ", Memory: (assined: %s MB, used: %s%%" % (assigned_mem ,current_mem) 66 | perfdata.append( ( "memory_current_%", current_mem ) ) 67 | perfdata.append( ( "memory__assigned_MB", assigned_mem ) ) 68 | 69 | 70 | infotext += ")" 71 | 72 | warn = 80 73 | if current_cpu > warn or current_mem > warn: 74 | return (1, "WARN - status is " + infotext, perfdata) 75 | else: 76 | return (0, "OK - status is " + infotext, perfdata) 77 | else: 78 | infotext += ")" 79 | return (2, "CRITICAL - status is " + infotext, perfdata) 80 | 81 | return (3, "UNKNOWN - VM not found in agent output") 82 | 83 | # declare the check to Check_MK 84 | check_info['qemu'] = \ 85 | (check_qemu, "VM %s", 1, inventory_qemu) 86 | -------------------------------------------------------------------------------- /livestatus_hosts/livestatus_host.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | # 3 | import socket 4 | import time 5 | 6 | def recv_timeout(the_socket,timeout=2): 7 | #make socket non blocking 8 | the_socket.setblocking(0) 9 | 10 | #total data partwise in an array 11 | total_data=[]; 12 | data=''; 13 | 14 | #beginning time 15 | begin=time.time() 16 | while 1: 17 | #if you got some data, then break after timeout 18 | if total_data and time.time()-begin > timeout: 19 | break 20 | 21 | #if you got no data at all, wait a little longer, twice the timeout 22 | elif time.time()-begin > timeout*2: 23 | break 24 | 25 | #recv something 26 | try: 27 | data = the_socket.recv(8192) 28 | if data: 29 | total_data.append(data) 30 | #change the beginning time for measurement 31 | begin=time.time() 32 | else: 33 | #sleep for sometime to indicate a gap 34 | time.sleep(0.1) 35 | except: 36 | pass 37 | 38 | #join all parts to make final string 39 | return ''.join(total_data) 40 | 41 | def get_etchosts(output): 42 | 43 | all_hosts = {} 44 | for host in output: 45 | (host_name, address, alias, filename) = host 46 | 47 | if not all_hosts.has_key(filename): 48 | all_hosts[filename] = {} 49 | 50 | new_host = {address:(host_name,alias)} 51 | all_hosts[filename].update(new_host) 52 | 53 | 54 | for filename in sorted(all_hosts.keys()): 55 | print "\n\n#" + filename.replace("/hosts.mk","").replace("/wato","") 56 | 57 | for ip in sorted(all_hosts[filename].keys()): 58 | hostname = all_hosts[filename][ip][0] 59 | alias = all_hosts[filename][ip][1] 60 | 61 | print "%-20s %-40s #%s" % (ip, hostname, alias) 62 | 63 | def main(): 64 | 65 | 66 | #socket_path = "/omd/sites/prod/tmp/run/live" 67 | #s = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM) 68 | #s.connect(socket_path) 69 | 70 | all_server = [('10.3.3.3', 6557),('10.2.2.2', 6557)] 71 | lql = "GET hosts\n" 72 | lql += "Columns: host_name address alias filename\n" 73 | lql += "OutputFormat: python\n" 74 | 75 | for server in all_server: 76 | s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) 77 | s.connect(server) 78 | 79 | s.send(lql) 80 | 81 | s.shutdown(socket.SHUT_WR) 82 | 83 | answer = recv_timeout(s) 84 | table = eval(answer) 85 | get_etchosts(table) 86 | 87 | main() 88 | -------------------------------------------------------------------------------- /cisco_asa_x/checks/cisco_asa_connections: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | # -*- encoding: utf-8; py-indent-offset: 4 -*- 3 | # +------------------------------------------------------------------+ 4 | # | ____ _ _ __ __ _ __ | 5 | # | / ___| |__ ___ ___| | __ | \/ | |/ / | 6 | # | | | | '_ \ / _ \/ __| |/ / | |\/| | ' / | 7 | # | | |___| | | | __/ (__| < | | | | . \ | 8 | # | \____|_| |_|\___|\___|_|\_\___|_| |_|_|\_\ | 9 | # | | 10 | # | Copyright Mathias Kettner 2014 mk@mathias-kettner.de | 11 | # +------------------------------------------------------------------+ 12 | # 13 | # This file is part of Check_MK. 14 | # The official homepage is at http://mathias-kettner.de/check_mk. 15 | # 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 | # ails. 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. 26 | 27 | 28 | 29 | 30 | 31 | def inventory_cisco_asa_connections(info): 32 | if len(info) == 1: 33 | if len(info[0]) == 2: 34 | return [(None,None)] 35 | return [] 36 | 37 | 38 | def check_cisco_asa_connections(item, params, info): 39 | 40 | pixsessions = info[0][0] 41 | pixMaxSessions = info[0][1] 42 | 43 | state = 0 44 | msgtxt = "Anzahl der aktuellen IP-Connections %s, Hoechste Anzahl seit Systemstart %s" % (pixsessions, pixMaxSessions) 45 | perfdata = [("pixsessions", pixsessions), ("pixMaxSessions", pixMaxSessions)] 46 | return (state, msgtxt, perfdata) 47 | 48 | 49 | check_info["cisco_asa_connections"] = { 50 | "check_function" : check_cisco_asa_connections, 51 | "inventory_function" : inventory_cisco_asa_connections, 52 | "service_description": "ASA Connections", 53 | "has_perfdata" : True, 54 | "snmp_scan_function" : lambda oid: oid(".1.3.6.1.2.1.1.1.0").lower().startswith("cisco adaptive security"), 55 | "snmp_info" : (".1.3.6.1.4.1.9.9.147.1.2.2.2.1.5.40", [ 56 | "6", # PixSessions 57 | "7", # PixMaxSessions 58 | ]), 59 | } 60 | -------------------------------------------------------------------------------- /cisco_ace_cluster/checks/cisco_ace_cluster: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | 3 | 4 | # author 5 | # Christian Burmeister 05/2015 6 | 7 | 8 | #http://tools.cisco.com/Support/SNMP/do/BrowseOID.do?objectInput=1.3.6.1.4.1.9.9.650.1.1.4.1.2&translate=Translate&submitValue=SUBMIT&submitClicked=true 9 | 10 | def inventory_cisco_ace_cluster(info): 11 | inventory = [] 12 | if len(info) != 0: 13 | for oid, value in info[0]: 14 | inventory.append( (oid[2:], value) ) 15 | return inventory 16 | 17 | 18 | def check_cisco_ace_cluster(item, params, info): 19 | 20 | cluster_state = {} 21 | for oid, value in info[0]: 22 | cluster_state[str(oid[2:])] = str(value) 23 | 24 | clrRedundancyState = { 25 | "1":"other", 26 | "2":"nonRedundant", 27 | "3":"initializing", 28 | "4":"negotiation", 29 | "5":"active", 30 | "6":"standbyCold", 31 | "7":"standbyConfig", 32 | "8":"standbyBulk", 33 | "9":"standbyHot", 34 | "10":"standbyWarm", 35 | } 36 | 37 | for ft_group in cluster_state.keys(): 38 | if str(ft_group) == item: 39 | 40 | msg = "ft_group: %s, state: %s" % (ft_group, clrRedundancyState[cluster_state[ft_group]]) 41 | 42 | if (clrRedundancyState[cluster_state[ft_group]] in ["active", "standbyHot", "standbyWarm"]) and \ 43 | (clrRedundancyState[str(params)] in ["active", "standbyHot", "standbyWarm"]): 44 | 45 | if str(params) == cluster_state[ft_group]: 46 | msg += " --> OK" 47 | return (0, msg) 48 | else: 49 | msg += " --> ft_group failed over (!)" 50 | return (1, msg) 51 | 52 | msg += ", state_saved: " + clrRedundancyState[params[ft_group]] + " --> UNKOWN STATE" 53 | return (3, msg) 54 | 55 | msg += " --> UNKOWN STATE" 56 | return (3, msg) 57 | 58 | 59 | 60 | check_info["cisco_ace_cluster"] = { 61 | "check_function" : check_cisco_ace_cluster, 62 | "inventory_function" : inventory_cisco_ace_cluster, 63 | "service_description": "ACE-Cluster-Status, ft-group: ", 64 | "has_perfdata" : False, 65 | 'snmp_scan_function': lambda oid: "ACE 4710 Application Control Engine Appliance" in oid(".1.3.6.1.2.1.1.1.0"), 66 | "snmp_info" : [(".1.3.6.1.4.1.9.9.650.1.1.4.1", [OID_END, "2"]), # clrRedundancyState 67 | # (".1.3.6.1.6.3.16.1.1.1", ["1"]) # vacmContextName 68 | ], 69 | } 70 | -------------------------------------------------------------------------------- /if64_xx/inventory/switch_ipaddr: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | # -*- encoding: utf-8; py-indent-offset: 4 -*- 3 | # +------------------------------------------------------------------+ 4 | # | ____ _ _ __ __ _ __ | 5 | # | / ___| |__ ___ ___| | __ | \/ | |/ / | 6 | # | | | | '_ \ / _ \/ __| |/ / | |\/| | ' / | 7 | # | | |___| | | | __/ (__| < | | | | . \ | 8 | # | \____|_| |_|\___|\___|_|\_\___|_| |_|_|\_\ | 9 | # | | 10 | # | Copyright Mathias Kettner 2013 mk@mathias-kettner.de | 11 | # +------------------------------------------------------------------+ 12 | # 13 | # This file is part of Check_MK. 14 | # The official homepage is at http://mathias-kettner.de/check_mk. 15 | # 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 | # ails. 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. 26 | 27 | 28 | # Author: Christian Burmeister 29 | 30 | 31 | def inv_switch_ipaddr(info, params): 32 | 33 | port_info, ipAdEntAddr, ipAdEntNetMask = info 34 | 35 | ipAddress_dict = get_ip_address_raw(ipAdEntAddr, ipAdEntNetMask) 36 | 37 | addresses = inv_tree("networking.switch_addresses:") 38 | for if_index, if_descr, if_alias, if_type in port_info: 39 | if if_index in ipAddress_dict.keys(): 40 | ipaddr = "; ".join(ipAddress_dict[if_index]) 41 | addresses.append({ 42 | "index" : if_index, 43 | "description" : if_descr, 44 | "alias" : if_alias, 45 | "address" : ipaddr, 46 | }) 47 | 48 | 49 | inv_info['switch_ipaddr'] = { 50 | "inv_function" : inv_switch_ipaddr, 51 | 'includes': [ 'if_network.include' ], 52 | 'snmp_info': [ 53 | ( ".1.3.6.1.2.1", [ 54 | "2.2.1.1", # ifIndex 55 | "2.2.1.2", # ifDescr 56 | "31.1.1.1.18", # ifAlias 57 | "2.2.1.3", # ifType 58 | ]), 59 | oid_ipAdEntAddr, 60 | oid_ipAdEntNetMask, 61 | ], 62 | 'snmp_scan_function': lambda oid: int(oid(".1.3.6.1.2.1.2.1.0")) >= 2, 63 | } 64 | -------------------------------------------------------------------------------- /f5_bigip_x/checks/f5_bigip_ips_self_floating: -------------------------------------------------------------------------------- 1 | """ 2 | #!/usr/bin/python 3 | # -*- encoding: utf-8; py-indent-offset: 4 -*- 4 | # +------------------------------------------------------------------+ 5 | # | ____ _ _ __ __ _ __ | 6 | # | / ___| |__ ___ ___| | __ | \/ | |/ / | 7 | # | | | | '_ \ / _ \/ __| |/ / | |\/| | ' / | 8 | # | | |___| | | | __/ (__| < | | | | . \ | 9 | # | \____|_| |_|\___|\___|_|\_\___|_| |_|_|\_\ | 10 | # | | 11 | # | Copyright Mathias Kettner 2014 mk@mathias-kettner.de | 12 | # +------------------------------------------------------------------+ 13 | # 14 | # This file is part of Check_MK. 15 | # The official homepage is at http://mathias-kettner.de/check_mk. 16 | # 17 | # check_mk is free software; you can redistribute it and/or modify it 18 | # under the terms of the GNU General Public License as published by 19 | # the Free Software Foundation in version 2. check_mk is distributed 20 | # in the hope that it will be useful, but WITHOUT ANY WARRANTY; with- 21 | # out even the implied warranty of MERCHANTABILITY or FITNESS FOR A 22 | # PARTICULAR PURPOSE. See the GNU General Public License for more de- 23 | # ails. You should have received a copy of the GNU General Public 24 | # License along with GNU Make; see the file COPYING. If not, write 25 | # to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, 26 | # Boston, MA 02110-1301 USA. 27 | 28 | 29 | 30 | # F5 nodes need to be ntp synced otherwise status reports might be wrong. 31 | 32 | #http://www.oidview.com/mibs/3375/F5-BIGIP-SYSTEM-MIB.html 33 | #https://support.f5.com/kb/en-us/solutions/public/14000/300/sol14399.html 34 | 35 | def inventory_f5_bigip_ips_self_floating(info): 36 | 37 | sysSelfIpAddr = info[0] 38 | sysSelfIpNetmaskType = info[1] 39 | sysSelfIpIsFloating = info[2] 40 | 41 | #return [ (None, [sysCmFailoverStatus[1][0].strip()] )] 42 | 43 | 44 | def check_f5_bigip_ips_self_floating(item, params, info): 45 | 46 | return (2, "test") 47 | 48 | 49 | 50 | 51 | 52 | check_info["f5_bigip_ips_self_floating"] = { 53 | 'check_function': check_f5_bigip_ips_self_floating, 54 | 'inventory_function': inventory_f5_bigip_ips_self_floating, 55 | 'service_description': 'Cluster status', 56 | 'snmp_info': [('.1.3.6.1.4.1.3375.2.1.2.8.1.2.1', [OID_END, "2"]), # sysSelfIpAddr 57 | ('.1.3.6.1.4.1.3375.2.1.2.8.1.2.1', [OID_END, "4"]), # sysSelfIpNetmaskType 58 | ('.1.3.6.1.4.1.3375.2.1.2.8.1.2.1', [OID_END, "6"]), # sysSelfIpIsFloating 59 | ], 60 | 'snmp_scan_function': \ 61 | lambda oid: '.1.3.6.1.4.1.3375.2' in oid(".1.3.6.1.2.1.1.2.0") \ 62 | and "big-ip" in oid(".1.3.6.1.4.1.3375.2.1.4.1.0").lower() \ 63 | and int(oid(".1.3.6.1.4.1.3375.2.1.4.2.0").split('.')[0]) >= 11, 64 | } 65 | """ 66 | -------------------------------------------------------------------------------- /qnap/checks/qnap_fans: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | # -*- encoding: utf-8; py-indent-offset: 4 -*- 3 | # +------------------------------------------------------------------+ 4 | # | ____ _ _ __ __ _ __ | 5 | # | / ___| |__ ___ ___| | __ | \/ | |/ / | 6 | # | | | | '_ \ / _ \/ __| |/ / | |\/| | ' / | 7 | # | | |___| | | | __/ (__| < | | | | . \ | 8 | # | \____|_| |_|\___|\___|_|\_\___|_| |_|_|\_\ | 9 | # | | 10 | # | Copyright Mathias Kettner 2010 mk@mathias-kettner.de | 11 | # +------------------------------------------------------------------+ 12 | # 13 | # This file is part of Check_MK. 14 | # The official homepage is at http://mathias-kettner.de/check_mk. 15 | # 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 | # ails. 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. 26 | 27 | # Author: Andre Eckstein 28 | # updated by Christian Burmeister 10/2015 29 | 30 | qnap_fans_default_levels = (6000,6500) 31 | 32 | def inventory_qnap_fans(checkname, info): 33 | inventory = [] 34 | 35 | if len(info) == 0: 36 | return inventory 37 | 38 | # Dieses statische Inventory sollte ueberarbeitet werden, mein Qnap hat aber leider keine Luefter zum testen. 39 | inventory.append(("Fan 1", "qnap_fans_default_levels")) 40 | inventory.append(("Fan 2", "qnap_fans_default_levels")) 41 | return inventory 42 | 43 | def check_qnap_fans(item, params, info): 44 | warn,crit = params 45 | rpm = "" 46 | for line in info: 47 | if item == "Fan 1": 48 | rpm = info[0][0] 49 | elif item == "Fan 2": 50 | rpm = info[0][1] 51 | rpm = rpm.rstrip("RPM ") 52 | rpm = int(rpm) 53 | perfdata = [("rpm", rpm, warn, crit)] 54 | infotxt = " - %d RPM (levels at %d/%d)" % (rpm, warn, crit) 55 | if rpm >= crit: 56 | return (2, "CRIT" + infotxt, perfdata) 57 | elif rpm >= warn: 58 | return (1, "WARN" + infotxt, perfdata) 59 | else: 60 | return (0, "OK" + infotxt, perfdata) 61 | 62 | return (3, "UNKNOWN - No SNMP Output from agent") 63 | 64 | check_info['qnap_fans'] = (check_qnap_fans, "QNAP %s", 1, inventory_qnap_fans) 65 | 66 | snmp_info['qnap_fans'] = ( ".1.3.6.1.4.1.24681.1.2.15.1.3", [ "1", "2" ] ) 67 | snmp_scan_functions['qnap_fans'] = \ 68 | lambda oid: "QNAP Systems" in oid('.1.3.6.1.2.1.47.1.1.1.1.12.1') 69 | -------------------------------------------------------------------------------- /qnap/checks/qnap_hdd: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | # -*- encoding: utf-8; py-indent-offset: 4 -*- 3 | # +------------------------------------------------------------------+ 4 | # | ____ _ _ __ __ _ __ | 5 | # | / ___| |__ ___ ___| | __ | \/ | |/ / | 6 | # | | | | '_ \ / _ \/ __| |/ / | |\/| | ' / | 7 | # | | |___| | | | __/ (__| < | | | | . \ | 8 | # | \____|_| |_|\___|\___|_|\_\___|_| |_|_|\_\ | 9 | # | | 10 | # | Copyright Mathias Kettner 2010 mk@mathias-kettner.de | 11 | # +------------------------------------------------------------------+ 12 | # 13 | # This file is part of Check_MK. 14 | # The official homepage is at http://mathias-kettner.de/check_mk. 15 | # 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 | # ails. 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. 26 | 27 | # Author: Andre Eckstein 28 | # updated by Christian Burmeister 10/2015 29 | 30 | qnap_hdd_temp_default_levels = (40,45) 31 | 32 | def inventory_qnap_hdd(checkname, info): 33 | # import pprint; pprint.pprint(info) 34 | inventory = [] 35 | for hdd, state, temp, model in info: 36 | if hdd.startswith( 'HDD' ): 37 | inventory.append( (hdd, "", "qnap_hdd_temp_default_levels") ) 38 | return inventory 39 | 40 | def check_qnap_hdd(item, params, info): 41 | warn,crit = params 42 | 43 | for hdd, state, temp, model in info: 44 | temp = temp.split("/") 45 | temp = temp[0] 46 | temp = temp.rsplit(" C") 47 | temp = int(temp[0]) 48 | perfdata = [("temp", temp, warn, crit)] 49 | infotext = " State is %s, HDD temperature is at %sC (levels at %s/%s), HDD-model: %s" % (state, temp, warn, crit, model) 50 | if hdd == item: 51 | if (state == "GOOD") and (temp < warn): 52 | return (0, "OK - " + infotext, perfdata ) 53 | elif (state == "GOOD") and (temp >= warn): 54 | return (1, "Warning - " + infotext, perfdata ) 55 | elif (state != "GOOD") or (temp >=critical): 56 | return (2, "Critical - " + infotext, perfdata ) 57 | return (3, "UNKNOWN - HDD") 58 | 59 | check_info['qnap_hdd'] = (check_qnap_hdd, "QNAP %s", 1, inventory_qnap_hdd) 60 | 61 | snmp_info['qnap_hdd'] = ( ".1.3.6.1.4.1.24681.1.2", [ "11.1.2", "11.1.7" , "11.1.3", "11.1.5"] ) 62 | snmp_scan_functions['qnap_hdd'] = \ 63 | lambda oid: "QNAP Systems" in oid('.1.3.6.1.2.1.47.1.1.1.1.12.1') 64 | -------------------------------------------------------------------------------- /qnap/checks/qnap_temp: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | # -*- encoding: utf-8; py-indent-offset: 4 -*- 3 | # +------------------------------------------------------------------+ 4 | # | ____ _ _ __ __ _ __ | 5 | # | / ___| |__ ___ ___| | __ | \/ | |/ / | 6 | # | | | | '_ \ / _ \/ __| |/ / | |\/| | ' / | 7 | # | | |___| | | | __/ (__| < | | | | . \ | 8 | # | \____|_| |_|\___|\___|_|\_\___|_| |_|_|\_\ | 9 | # | | 10 | # | Copyright Mathias Kettner 2010 mk@mathias-kettner.de | 11 | # +------------------------------------------------------------------+ 12 | # 13 | # This file is part of Check_MK. 14 | # The official homepage is at http://mathias-kettner.de/check_mk. 15 | # 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 | # ails. 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. 26 | 27 | # Author: Andre Eckstein 28 | # updated by Christian Burmeister 10/2015 29 | 30 | qnap_temp_default_levels = (55, 60) 31 | 32 | def inventory_qnap_temp(checkname, info): 33 | 34 | inventory = [] 35 | if "C/" in info[0][0]: 36 | inventory.append(("Temperature System", "", "qnap_temp_default_levels" )) 37 | if "C/" in info[0][1]: 38 | inventory.append(("Temperature CPU", "", "qnap_temp_default_levels" )) 39 | return inventory 40 | 41 | def check_qnap_temp(item, params, info): 42 | warn, crit = params 43 | temp = "" 44 | 45 | for line in info: 46 | if item == "Temperature System": 47 | temp = info[0][0] 48 | elif item == "Temperature CPU": 49 | temp = info[0][1] 50 | 51 | temp = temp.split("/") 52 | temp = temp[0] 53 | temp = temp.rsplit(" C") 54 | temp = int(temp[0]) 55 | 56 | perfdata = [("temp", temp, warn, crit)] 57 | infotext = " %s is at %sC (levels at %s/%s)" % ( item, temp, warn, crit ) 58 | 59 | if temp >= crit: 60 | return (2, "Critical - " + infotext, perfdata ) 61 | elif temp >= warn: 62 | return (1, "Warning - " + infotext, perfdata ) 63 | else: 64 | return (0, "OK - " + infotext, perfdata) 65 | return (3, "UNKNOWN", []) 66 | 67 | check_info['qnap_temp'] = (check_qnap_temp, "QNAP %s", 1, inventory_qnap_temp) 68 | 69 | snmp_info['qnap_temp'] = ( ".1.3.6.1.4.1.24681.1.2", ["5", "6"] ) 70 | snmp_scan_functions['qnap_temp'] = \ 71 | lambda oid: "QNAP Systems" in oid('.1.3.6.1.2.1.47.1.1.1.1.12.1') 72 | -------------------------------------------------------------------------------- /f5_bigip_x/web/plugins/wato/ace_serverfarm.py: -------------------------------------------------------------------------------- 1 | register_check_parameters( 2 | subgroup_networking, 3 | "cisco_ace_serverfarm", 4 | _("ACE_F5 Serverfarm"), 5 | Dictionary( 6 | elements = [ 7 | ( "ace_serverfarm_wato", 8 | ListOf( 9 | Tuple( 10 | title = ("ACE_F5 Serverfarm"), 11 | elements = [ 12 | TextUnicode( 13 | title = _("Name of ACE_F5-Serverfarm"), 14 | help = _("The configured value must match a serverfarm reported by the monitored " 15 | "device."), 16 | allow_empty = False, 17 | ), 18 | DropdownChoice( 19 | title = _("Worst state if serverfarm is crit"), 20 | default_value = None, 21 | choices = [ 22 | ( None, _("original return state") ), 23 | ( "0", _("OK") ), 24 | ( "1", _("WARN") ), 25 | ( "3", _("UNKNOWN") ), 26 | ]), 27 | DropdownChoice( 28 | title = _("Worst state if serverfarm is warning"), 29 | default_value = None, 30 | choices = [ 31 | ( None, _("orginal return state") ), 32 | ( "0", _("OK") ), 33 | ( "3", _("UNKNOWN") ), 34 | ]), 35 | Checkbox( 36 | title = _("Show only short status of other nodes (only ACE)"), 37 | label = _(""), 38 | ), 39 | ]), 40 | add_label = _("Add Serverfarm"), 41 | movable = False, 42 | title = _("ACE_F5 Serverfarm specific configuration"), 43 | )), 44 | ("default_crit", DropdownChoice( 45 | title = _("DEFAULT: Worst state if serverfarm is crit"), 46 | default_value = None, 47 | choices = [ 48 | ( None, _("original return state") ), 49 | ( "0", _("OK") ), 50 | ( "1", _("WARN") ), 51 | ( "3", _("UNKNOWN") ) 52 | ])), 53 | ("default_warn", DropdownChoice( 54 | title = _("DEFAULT: Worst state if serverfarm is warning"), 55 | default_value = None, 56 | choices = [ 57 | ( None, _("orginal return state") ), 58 | ( "0", _("OK") ), 59 | ( "3", _("UNKNOWN") ) 60 | ])), 61 | ], 62 | ), 63 | TextAscii( title = _("ACE_F5 Serverfarm")), 64 | #"first" 65 | "dict", 66 | ) 67 | -------------------------------------------------------------------------------- /cisco_ace_serverfarm/web/plugins/wato/ace_serverfarm.py: -------------------------------------------------------------------------------- 1 | register_check_parameters( 2 | subgroup_networking, 3 | "cisco_ace_serverfarm", 4 | _("ACE_F5 Serverfarm"), 5 | Dictionary( 6 | elements = [ 7 | ( "ace_serverfarm_wato", 8 | ListOf( 9 | Tuple( 10 | title = ("ACE_F5 Serverfarm"), 11 | elements = [ 12 | TextUnicode( 13 | title = _("Name of ACE_F5-Serverfarm"), 14 | help = _("The configured value must match a serverfarm reported by the monitored " 15 | "device."), 16 | allow_empty = False, 17 | ), 18 | DropdownChoice( 19 | title = _("Worst state if serverfarm is crit"), 20 | default_value = None, 21 | choices = [ 22 | ( None, _("original return state") ), 23 | ( "0", _("OK") ), 24 | ( "1", _("WARN") ), 25 | ( "3", _("UNKNOWN") ), 26 | ]), 27 | DropdownChoice( 28 | title = _("Worst state if serverfarm is warning"), 29 | default_value = None, 30 | choices = [ 31 | ( None, _("orginal return state") ), 32 | ( "0", _("OK") ), 33 | ( "3", _("UNKNOWN") ), 34 | ]), 35 | Checkbox( 36 | title = _("Show only short status of other nodes (only ACE)"), 37 | label = _(""), 38 | ), 39 | ]), 40 | add_label = _("Add Serverfarm"), 41 | movable = False, 42 | title = _("ACE_F5 Serverfarm specific configuration"), 43 | )), 44 | ("default_crit", DropdownChoice( 45 | title = _("DEFAULT: Worst state if serverfarm is crit"), 46 | default_value = None, 47 | choices = [ 48 | ( None, _("original return state") ), 49 | ( "0", _("OK") ), 50 | ( "1", _("WARN") ), 51 | ( "3", _("UNKNOWN") ) 52 | ])), 53 | ("default_warn", DropdownChoice( 54 | title = _("DEFAULT: Worst state if serverfarm is warning"), 55 | default_value = None, 56 | choices = [ 57 | ( None, _("orginal return state") ), 58 | ( "0", _("OK") ), 59 | ( "3", _("UNKNOWN") ) 60 | ])), 61 | ], 62 | ), 63 | TextAscii( title = _("ACE_F5 Serverfarm")), 64 | #"first" 65 | "dict", 66 | ) 67 | -------------------------------------------------------------------------------- /dulpex_status/checks/dulpex_status: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | # -*- encoding: utf-8; py-indent-offset: 4 -*- 3 | # +------------------------------------------------------------------+ 4 | # | ____ _ _ __ __ _ __ | 5 | # | / ___| |__ ___ ___| | __ | \/ | |/ / | 6 | # | | | | '_ \ / _ \/ __| |/ / | |\/| | ' / | 7 | # | | |___| | | | __/ (__| < | | | | . \ | 8 | # | \____|_| |_|\___|\___|_|\_\___|_| |_|_|\_\ | 9 | # | | 10 | # | Copyright Mathias Kettner 2014 mk@mathias-kettner.de | 11 | # +------------------------------------------------------------------+ 12 | # 13 | # This file is part of Check_MK. 14 | # The official homepage is at http://mathias-kettner.de/check_mk. 15 | # 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 | # ails. 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. 26 | 27 | #Test Inventory 28 | #cmk -II --checks=snmp_duplex asw0038 29 | 30 | def inventory_duplex_status(info): 31 | 32 | return [(None, None)] 33 | 34 | 35 | #Test check 36 | # cmk --debug -vn --checks=snmp_duplex asw0038 37 | def check_duplex_status(item, params, info): 38 | 39 | if_halfduplex = [] 40 | 41 | for interface in info[1]: 42 | 43 | dot3StatsDuplexStatus_unknown = "1" 44 | dot3StatsDuplexStatus_halfDuplex = "2" 45 | dot3StatsDuplexStatus_fullDuplex = "3" 46 | 47 | if interface[1] == dot3StatsDuplexStatus_halfDuplex: 48 | if_halfduplex.append(interface[0]) 49 | 50 | 51 | 52 | 53 | 54 | if_halfduplex_ifdescr = [] 55 | for interface in if_halfduplex: 56 | for interface_2 in info[0]: 57 | if interface == interface_2[0]: 58 | if_speed = "10" 59 | if interface_2[2] != if_speed: 60 | if_halfduplex_ifdescr.append(interface_2[1]) 61 | 62 | if len(if_halfduplex_ifdescr) != 0: 63 | return (1, "Interface mit halfDuplex: " + str(if_halfduplex_ifdescr)) 64 | else: 65 | return (0, "Kein Interface mit halfDuplex gefunden.") 66 | 67 | 68 | 69 | 70 | # This check works on all SNMP hosts 71 | 72 | check_info["duplex_status"] = { 73 | 'check_function': check_duplex_status, 74 | 'inventory_function': inventory_duplex_status, 75 | 'service_description': 'SNMP Duplex', 76 | 77 | 'snmp_info': [( ".1.3.6.1.2.1", [ 78 | "2.2.1.1", # ifIndex 0 79 | "2.2.1.2", # ifDescr 1 80 | "31.1.1.1.15", # ifHighSpeed .. 1000 means 1GBit 81 | ]), 82 | ('.1.3.6.1.2.1.10.7.2.1', [OID_END,'19']), 83 | ], 84 | 'snmp_scan_function': lambda oid: oid(".1.3.6.1.2.1.10.7.2.1.19.*") != None, 85 | } 86 | -------------------------------------------------------------------------------- /cisco_dtp/checks/cisco_dtp: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | # -*- encoding: utf-8; py-indent-offset: 4 -*- 3 | # +------------------------------------------------------------------+ 4 | # | ____ _ _ __ __ _ __ | 5 | # | / ___| |__ ___ ___| | __ | \/ | |/ / | 6 | # | | | | '_ \ / _ \/ __| |/ / | |\/| | ' / | 7 | # | | |___| | | | __/ (__| < | | | | . \ | 8 | # | \____|_| |_|\___|\___|_|\_\___|_| |_|_|\_\ | 9 | # | | 10 | # | Copyright Mathias Kettner 2014 mk@mathias-kettner.de | 11 | # +------------------------------------------------------------------+ 12 | # 13 | # This file is part of Check_MK. 14 | # The official homepage is at http://mathias-kettner.de/check_mk. 15 | # 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 | # ails. 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. 26 | 27 | vlanTrunkPortDynamicState_dict = { 28 | "1" : "on", 29 | "2" : "off", 30 | "3" : "desirable", 31 | "4" : "auto", 32 | "5" : "onNoNegotiate" 33 | } 34 | 35 | def parse_cisco_dtp(info): 36 | 37 | if info == []: 38 | return [] 39 | 40 | parsed = {} 41 | for interface, status in info: 42 | if vlanTrunkPortDynamicState_dict[status] not in parsed: 43 | parsed[vlanTrunkPortDynamicState_dict[status]] = [] 44 | 45 | parsed[vlanTrunkPortDynamicState_dict[status]].append(interface) 46 | 47 | 48 | return parsed 49 | 50 | def inventory_cisco_dtp(parsed): 51 | 52 | if "desirable" in parsed: 53 | return [ (None, None) ] 54 | else: 55 | return [] 56 | 57 | def check_cisco_dtp(item, params, parsed): 58 | 59 | return_status = 0 60 | msg = [] 61 | for item in parsed: 62 | item_msg = item + ": " + str(len(parsed[item])) + "x" 63 | if item == "desirable": 64 | msg.append( "(!)" + item_msg + "(!)" ) 65 | return_status = 1 66 | else: 67 | msg.append( item_msg ) 68 | 69 | return return_status, "DTP Port Status: " + ", ".join(msg) 70 | 71 | 72 | check_info["cisco_dtp"] = { 73 | 'check_function': check_cisco_dtp, 74 | 'inventory_function': inventory_cisco_dtp, 75 | 'parse_function': parse_cisco_dtp, 76 | 'service_description': 'Cisco DTP', 77 | 'snmp_info': (".1.3.6.1.4.1.9.9.46.1.6.1.1", [OID_END,"13"]), 78 | # 'snmp_scan_function': lambda oid: oid(".1.3.6.1.4.1.9.9.46.1.2.1.1.3") != None, 79 | } 80 | -------------------------------------------------------------------------------- /f5_bigip_x/checks/f5_bigip_cluster_v11: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | # -*- encoding: utf-8; py-indent-offset: 4 -*- 3 | # +------------------------------------------------------------------+ 4 | # | ____ _ _ __ __ _ __ | 5 | # | / ___| |__ ___ ___| | __ | \/ | |/ / | 6 | # | | | | '_ \ / _ \/ __| |/ / | |\/| | ' / | 7 | # | | |___| | | | __/ (__| < | | | | . \ | 8 | # | \____|_| |_|\___|\___|_|\_\___|_| |_|_|\_\ | 9 | # | | 10 | # | Copyright Mathias Kettner 2013 mk@mathias-kettner.de | 11 | # +------------------------------------------------------------------+ 12 | # 13 | # This file is part of Check_MK. 14 | # The official homepage is at http://mathias-kettner.de/check_mk. 15 | # 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 | # ails. 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. 26 | 27 | 28 | # Agent / MIB output 29 | # see: .1.3.6.1.4.1.3375.2.1.14.1.1.0 30 | # .1.3.6.1.4.1.3375.2.1.14.1.2.0 31 | # F5-BIGIP-SYSTEM-MIB::sysCmSyncStatusId 32 | # F5-BIGIP-SYSTEM-MIB::sysCmSyncStatusStatus 33 | 34 | # F5 nodes need to be ntp synced otherwise status reports might be wrong. 35 | 36 | 37 | f5_bigip_cluster_v11_states = { 38 | '0': ( "Unknown", 3), 39 | '1': ( "Syncing", 0), 40 | '2': ( "Need Manual Sync", 1), 41 | '3': ( "In Sync", 0), 42 | '4': ( "Sync Failed", 2), 43 | '5': ( "Sync Disconnected", 2), 44 | '6': ( "Standalone", 0), 45 | '7': ( "Awaiting Initial Sync", 1), 46 | '8': ( "Incompatible Version", 2), 47 | '9': ( "Partial Sync", 2), 48 | } 49 | 50 | 51 | def inventory_f5_bigip_cluster_v11(info): 52 | if len(info) == 1: 53 | return [(None, None)] 54 | 55 | 56 | def check_f5_bigip_cluster_v11(_no_item, _no_params, info): 57 | statusid, statustxt = info[0] 58 | statename, state = f5_bigip_cluster_v11_states[statusid] 59 | infotext = statename 60 | if statename != statustxt: 61 | infotext += ' - ' + statustxt 62 | return state, infotext 63 | 64 | 65 | check_info["f5_bigip_cluster_v11"] = { 66 | 'check_function': check_f5_bigip_cluster_v11, 67 | 'inventory_function': inventory_f5_bigip_cluster_v11, 68 | 'service_description': 'Config Sync Status', 69 | 'snmp_info': ('.1.3.6.1.4.1.3375.2.1.14.1', [ 70 | "1.0", # sysCmSyncStatusId 71 | "2.0" # sysCmSyncStatusStatus 72 | ]), 73 | 74 | 'snmp_scan_function': \ 75 | lambda oid: '.1.3.6.1.4.1.3375.2' in oid(".1.3.6.1.2.1.1.2.0") \ 76 | and "big-ip" in oid(".1.3.6.1.4.1.3375.2.1.4.1.0").lower() \ 77 | and int(oid(".1.3.6.1.4.1.3375.2.1.4.2.0").split('.')[0]) >= 11, 78 | } 79 | -------------------------------------------------------------------------------- /lucent_dhcp_x/checks/lucent_dhcp_failover: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | # -*- encoding: utf-8; py-indent-offset: 4 -*- 3 | # +------------------------------------------------------------------+ 4 | # | ____ _ _ __ __ _ __ | 5 | # | / ___| |__ ___ ___| | __ | \/ | |/ / | 6 | # | | | | '_ \ / _ \/ __| |/ / | |\/| | ' / | 7 | # | | |___| | | | __/ (__| < | | | | . \ | 8 | # | \____|_| |_|\___|\___|_|\_\___|_| |_|_|\_\ | 9 | # | | 10 | # | Copyright Mathias Kettner 2014 mk@mathias-kettner.de | 11 | # +------------------------------------------------------------------+ 12 | # 13 | # This file is part of Check_MK. 14 | # The official homepage is at http://mathias-kettner.de/check_mk. 15 | # 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 | # ails. 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. 26 | 27 | dhcpServFailoverPartnerType_map = { "1":"primar", "2":"failover/standby", "3":"unconfigured"} 28 | dhcpServFailoverPartnerStatus_map = { "0":"unknown", "1":"syncing", "2":"active", "3":"inactive"} 29 | 30 | 31 | 32 | def inventory_lucent_dhcp_failover(info): 33 | return [(None, info[0][:3])] 34 | 35 | def check_lucent_dhcp_failover(item, params, info): 36 | 37 | 38 | server = info[0][0] 39 | failover_type = dhcpServFailoverPartnerType_map[info[0][1]] 40 | failover_status = dhcpServFailoverPartnerStatus_map[info[0][2]] 41 | failover_time = time.ctime(int(info[0][3])) 42 | 43 | #['10.2.4.100', '1', '2'] 44 | #[['10.2.4.100', '1', '2', '1430213751']] 45 | 46 | msg = "Server %s, Type: %s, Status: %s, Last successfull communication: %s" % (server, failover_type, failover_status, failover_time) 47 | if int(info[0][1]) < 3 and params == info[0][:3]: 48 | status = 0 49 | else: 50 | 51 | status = 1 52 | msg += " -- STATE CHANGED (!) -- OLD: Type: %s, Status: %s" % (dhcpServFailoverPartnerType_map[params[1]], dhcpServFailoverPartnerStatus_map[params[2]]) 53 | 54 | return (status, msg) 55 | 56 | # This check works on all SNMP hosts 57 | check_info["lucent_dhcp_failover"] = { 58 | 'check_function': check_lucent_dhcp_failover, 59 | 'inventory_function': inventory_lucent_dhcp_failover, 60 | 'service_description': 'Lucent_Failover', 61 | "snmp_info" : ( ".1.3.6.1.4.1.1751.1.48.1.1.1.1.8.1.1", [ "1", # dhcpServFailoverPartnerAddr 62 | "2", # dhcpServFailoverPartnerType 63 | "3", # dhcpServFailoverPartnerStatus 64 | "4" # dhcpServFailoverPartnerPolltime 65 | ]), 66 | "snmp_scan_function" : lambda oid: oid(".1.3.6.1.4.1.1751.1.48.1.1.1.1.1.*") != None, 67 | 68 | } 69 | -------------------------------------------------------------------------------- /qnap/snmpwalk.txt: -------------------------------------------------------------------------------- 1 | OMD[prod]:~/var/check_mk/packages$ snmpwalk -c snmp6060 -v 2c 192.168.x.x 1.3.6.1.2.1.1.1.0 2 | SNMPv2-MIB::sysDescr.0 = STRING: Linux TS-219 4.2.0 3 | 4 | OMD[prod]:~/var/check_mk/packages$ snmpwalk -c snmp6060 -v 2c 192.168.x.x1.3.6.1.4.1.24681 5 | SNMPv2-SMI::enterprises.24681.1.2.1.0 = STRING: "9.30 %" 6 | SNMPv2-SMI::enterprises.24681.1.2.9.1.1.1 = INTEGER: 1 7 | SNMPv2-SMI::enterprises.24681.1.2.9.1.2.1 = STRING: "eth0" 8 | SNMPv2-SMI::enterprises.24681.1.2.9.1.3.1 = Counter32: 13172563 9 | SNMPv2-SMI::enterprises.24681.1.2.9.1.4.1 = Counter32: 9281261 10 | SNMPv2-SMI::enterprises.24681.1.2.9.1.5.1 = Counter32: 0 11 | SNMPv2-SMI::enterprises.24681.1.2.11.1.1.1 = INTEGER: 1 12 | SNMPv2-SMI::enterprises.24681.1.2.11.1.1.2 = INTEGER: 2 13 | SNMPv2-SMI::enterprises.24681.1.2.11.1.2.1 = STRING: "HDD1" 14 | SNMPv2-SMI::enterprises.24681.1.2.11.1.2.2 = STRING: "HDD2" 15 | SNMPv2-SMI::enterprises.24681.1.2.11.1.3.1 = STRING: "27 C/80 F" 16 | SNMPv2-SMI::enterprises.24681.1.2.11.1.3.2 = STRING: "26 C/78 F" 17 | SNMPv2-SMI::enterprises.24681.1.2.11.1.4.1 = INTEGER: 0 18 | SNMPv2-SMI::enterprises.24681.1.2.11.1.4.2 = INTEGER: 0 19 | SNMPv2-SMI::enterprises.24681.1.2.11.1.5.1 = STRING: "WD30EFRX-68EUZN0 20 | " 21 | SNMPv2-SMI::enterprises.24681.1.2.11.1.5.2 = STRING: "WD30EFRX-68EUZN0 22 | " 23 | SNMPv2-SMI::enterprises.24681.1.2.11.1.6.1 = STRING: "2.73 TB" 24 | SNMPv2-SMI::enterprises.24681.1.2.11.1.6.2 = STRING: "2.73 TB" 25 | SNMPv2-SMI::enterprises.24681.1.2.11.1.7.1 = STRING: "GOOD" 26 | SNMPv2-SMI::enterprises.24681.1.2.11.1.7.2 = STRING: "GOOD" 27 | SNMPv2-SMI::enterprises.24681.1.2.17.1.1.1 = INTEGER: 1 28 | SNMPv2-SMI::enterprises.24681.1.2.17.1.2.1 = STRING: "[Mirror Disk Volume: Drive 1 2]" 29 | SNMPv2-SMI::enterprises.24681.1.2.17.1.3.1 = STRING: "EXT4" 30 | SNMPv2-SMI::enterprises.24681.1.2.17.1.4.1 = STRING: "2.68 TB" 31 | SNMPv2-SMI::enterprises.24681.1.2.17.1.5.1 = STRING: "1.22 TB" 32 | SNMPv2-SMI::enterprises.24681.1.2.17.1.6.1 = STRING: "Ready" 33 | SNMPv2-SMI::enterprises.24681.1.3.9.1.1.1 = INTEGER: 1 34 | SNMPv2-SMI::enterprises.24681.1.3.9.1.2.1 = STRING: "eth0" 35 | SNMPv2-SMI::enterprises.24681.1.3.9.1.3.1 = Counter32: 13174853 36 | SNMPv2-SMI::enterprises.24681.1.3.9.1.4.1 = Counter32: 9282405 37 | SNMPv2-SMI::enterprises.24681.1.3.9.1.5.1 = Counter32: 0 38 | SNMPv2-SMI::enterprises.24681.1.3.11.1.1.1 = INTEGER: 1 39 | SNMPv2-SMI::enterprises.24681.1.3.11.1.1.2 = INTEGER: 2 40 | SNMPv2-SMI::enterprises.24681.1.3.11.1.2.1 = STRING: "HDD1" 41 | SNMPv2-SMI::enterprises.24681.1.3.11.1.2.2 = STRING: "HDD2" 42 | SNMPv2-SMI::enterprises.24681.1.3.11.1.3.1 = INTEGER: 27 43 | SNMPv2-SMI::enterprises.24681.1.3.11.1.3.2 = INTEGER: 26 44 | SNMPv2-SMI::enterprises.24681.1.3.11.1.4.1 = INTEGER: 0 45 | SNMPv2-SMI::enterprises.24681.1.3.11.1.4.2 = INTEGER: 0 46 | SNMPv2-SMI::enterprises.24681.1.3.11.1.5.1 = STRING: "WD30EFRX-68EUZN0 47 | " 48 | SNMPv2-SMI::enterprises.24681.1.3.11.1.5.2 = STRING: "WD30EFRX-68EUZN0 49 | " 50 | SNMPv2-SMI::enterprises.24681.1.3.11.1.6.1 = Counter64: 3000592982016 51 | SNMPv2-SMI::enterprises.24681.1.3.11.1.6.2 = Counter64: 3000592982016 52 | SNMPv2-SMI::enterprises.24681.1.3.11.1.7.1 = STRING: "GOOD" 53 | SNMPv2-SMI::enterprises.24681.1.3.11.1.7.2 = STRING: "GOOD" 54 | SNMPv2-SMI::enterprises.24681.1.3.17.1.1.1 = INTEGER: 1 55 | SNMPv2-SMI::enterprises.24681.1.3.17.1.2.1 = STRING: "[Mirror Disk Volume: Drive 1 2]" 56 | SNMPv2-SMI::enterprises.24681.1.3.17.1.3.1 = STRING: "EXT4" 57 | SNMPv2-SMI::enterprises.24681.1.3.17.1.4.1 = Counter64: 2882740748 58 | SNMPv2-SMI::enterprises.24681.1.3.17.1.5.1 = Counter64: 1307052460 59 | SNMPv2-SMI::enterprises.24681.1.3.17.1.6.1 = STRING: "Ready" 60 | -------------------------------------------------------------------------------- /snmp_uptime/checks/snmp_uptime: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | # -*- encoding: utf-8; py-indent-offset: 4 -*- 3 | # +------------------------------------------------------------------+ 4 | # | ____ _ _ __ __ _ __ | 5 | # | / ___| |__ ___ ___| | __ | \/ | |/ / | 6 | # | | | | '_ \ / _ \/ __| |/ / | |\/| | ' / | 7 | # | | |___| | | | __/ (__| < | | | | . \ | 8 | # | \____|_| |_|\___|\___|_|\_\___|_| |_|_|\_\ | 9 | # | | 10 | # | Copyright Mathias Kettner 2014 mk@mathias-kettner.de | 11 | # +------------------------------------------------------------------+ 12 | # 13 | # This file is part of Check_MK. 14 | # The official homepage is at http://mathias-kettner.de/check_mk. 15 | # 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 | # ails. 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. 26 | 27 | 28 | #https://tools.cisco.com/quickview/bug/CSCeh49492 29 | 30 | 31 | def inventory_snmp_uptime(info): 32 | if len(info) > 0 and len(info[0]) >= 1: 33 | return [ (None, {}) ] 34 | 35 | def check_snmp_uptime(checktype, params, info): 36 | sysUpTime, snmpEngineTime, whyReload = info 37 | 38 | sysUpTime = parse_snmp_uptime(sysUpTime[0][0]) 39 | 40 | if snmpEngineTime != []: 41 | snmpEngineTime = saveint(snmpEngineTime[0][0]) 42 | 43 | diff = snmpEngineTime - sysUpTime 44 | if snmpEngineTime > sysUpTime: 45 | greater_UpTime = snmpEngineTime 46 | msg_info = " (snmpEngineTime Diff: "+ str(diff) +")" 47 | else: 48 | greater_UpTime = sysUpTime 49 | msg_info = " (sysUpTime Diff: "+ str(diff) +")" 50 | else: 51 | greater_UpTime = sysUpTime 52 | msg_info = "" 53 | 54 | 55 | state, msg, perfdata = check_uptime_seconds(params, greater_UpTime) 56 | 57 | 58 | try: 59 | msg += " --- whyReload: " + str(whyReload[0][0]) 60 | except: 61 | pass 62 | 63 | one_hour = 3600 64 | if greater_UpTime < one_hour: 65 | state = 1 66 | msg += " (!)Neustart innerhalb der letzten Stunde(!)" 67 | 68 | return (state, msg, perfdata) 69 | 70 | 71 | check_info["snmp_uptime"] = { 72 | 'check_function' : check_snmp_uptime, 73 | 'inventory_function' : inventory_snmp_uptime, 74 | 'service_description' : 'Uptime', 75 | 'has_perfdata' : True, 76 | 'snmp_info' : [('.1.3.6.1.2.1.1', ['3.0']), # DISMAN-EVENT-MIB::sysUpTime 77 | ('.1.3.6.1.6.3.10.2.1', ['3.0']), # snmpEngineTime 78 | ('.1.3.6.1.4.1.9.2.1.2', ["0"]), #whyReload 79 | ], 80 | 'snmp_scan_function' : lambda oid: oid(".1.3.6.1.2.1.1.1.0") != None, 81 | 'group' : 'uptime', 82 | 'includes' : [ 'uptime.include' ], 83 | } 84 | -------------------------------------------------------------------------------- /cisco_asa_x/checks/cisco_asa_vpnsessions: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | 3 | def decode_oid_asa(oid): 4 | 5 | # Example: 6 | # 13.67.111.103.110.111.115.32.77.111.98.105.108.101.66551809 7 | # 13.C. o. g. n. o. s. . M. o. b. i. l. e. .66551809 8 | string = "LEER" 9 | port = "LEER" 10 | 11 | oid_list = oid.split('.') 12 | string_array = [] 13 | 14 | oid_list.reverse() # Liste drehen, da pop() von hinten entnimmt 15 | 16 | len_string = int(oid_list.pop()) # Serverfarm laenge speichern (im Beispiel 8) 17 | for i in range(len_string): 18 | # Mit unichr Ascii-Zahl in Ascii-Buchstabe wandeln und an array haengen 19 | string_array.append(unichr(int(oid_list.pop()))) 20 | 21 | 22 | port = oid_list.pop() 23 | 24 | # Aus dem Array ein Sting machen 25 | string = "".join(string_array) 26 | 27 | return (str(string)) 28 | 29 | 30 | 31 | 32 | 33 | def inventory_cisco_asa_vpnsession(info): 34 | 35 | if len(info) == 0: 36 | return [] 37 | 38 | if len(info[0]) == 0: 39 | return [] 40 | 41 | counter = 0 42 | for value in info[0][0]: 43 | counter += saveint(value) 44 | 45 | if counter > 0: 46 | return [ (None, None) ] 47 | else: 48 | return [] 49 | 50 | def get_perfdata_clients(crasSessionTable): 51 | 52 | session_dict = {} 53 | for line in crasSessionTable: 54 | connection_typ = line[1] 55 | user = decode_oid_asa(line[0])[0] 56 | 57 | if connection_typ not in session_dict.keys(): 58 | session_dict[connection_typ] = [] 59 | session_dict[connection_typ].append(user) 60 | 61 | 62 | msg = "" 63 | perfdata = [] 64 | counter_all = 0 65 | for key in session_dict.keys(): 66 | counter = len(session_dict[key]) 67 | counter_all += counter 68 | msg += "%s: %sx --" % (key, counter) 69 | perfdata.append( (key, counter) ) 70 | 71 | #msg += "%s: %sx, " % ("All", counter_all) 72 | return perfdata 73 | 74 | def check_cisco_asa_vpnsession(item, params, info): 75 | 76 | crasSVCNumSessions = info[0][0][0] 77 | crasSVCCumulateSessions = info[0][0][1] 78 | crasSVCPeakConcurrentSessions = info[0][0][2] 79 | crasWebvpnNumSessions = info[0][0][3] 80 | crasWebvpnCumulateSessions = info[0][0][4] 81 | crasWebvpnPeakConcurrentSessions= info[0][0][5] 82 | crasSessionTable = info[1] 83 | 84 | msg = "" 85 | msg += "VPN-FullClient: %s/%s/%s -- " % (crasSVCNumSessions, crasSVCCumulateSessions, crasSVCPeakConcurrentSessions) 86 | msg += "VPN-Clientless: %s/%s/%s -- " % (crasWebvpnNumSessions, crasWebvpnCumulateSessions, crasWebvpnPeakConcurrentSessions) 87 | msg += "(Active-Inactive/Cumulative/Peak Concurrent)" 88 | 89 | perfdata = [ ("_VPN-FullClient", crasSVCNumSessions), ("_VPN-Clientless", crasWebvpnNumSessions) ] 90 | perfdata = perfdata + get_perfdata_clients(crasSessionTable) 91 | 92 | return (0, msg, perfdata) 93 | 94 | 95 | check_info["cisco_asa_vpnsession"] = { 96 | 'check_function': check_cisco_asa_vpnsession, 97 | 'inventory_function': inventory_cisco_asa_vpnsession, 98 | 'service_description': 'ASA VPNSessions', 99 | 'has_perfdata': True, 100 | 'group': "cisco_asa_sessions", 101 | 'snmp_info': [( ".1.3.6.1.4.1.9.9.392.1.3", [ '35', '36', '37', '38', '39', '40']), 102 | ( ".1.3.6.1.4.1.9.9.392.1.3.21.1", [OID_END, '2']), 103 | ], 104 | 'snmp_scan_function': lambda oid: "Cisco Adaptive Security Appliance" in oid(".1.3.6.1.2.1.1.1.0"), 105 | } 106 | -------------------------------------------------------------------------------- /livestatus_hosts/livestatus_cmk.py: -------------------------------------------------------------------------------- 1 | import time 2 | import sys 3 | import re 4 | import socket 5 | import os 6 | 7 | 8 | class Livestatus_CMK(): 9 | 10 | def __init__(self): 11 | pass 12 | 13 | def __recv_timeout(self,the_socket,timeout=2): 14 | #make socket non blocking 15 | the_socket.setblocking(0) 16 | 17 | #total data partwise in an array 18 | total_data=[]; 19 | data=''; 20 | 21 | #beginning time 22 | begin=time.time() 23 | while 1: 24 | #if you got some data, then break after timeout 25 | if total_data and time.time()-begin > timeout: 26 | break 27 | 28 | #if you got no data at all, wait a little longer, twice the timeout 29 | elif time.time()-begin > timeout*2: 30 | break 31 | 32 | #recv something 33 | try: 34 | data = the_socket.recv(8192) 35 | if data: 36 | total_data.append(data) 37 | #change the beginning time for measurement 38 | begin=time.time() 39 | else: 40 | #sleep for sometime to indicate a gap 41 | time.sleep(0.1) 42 | except: 43 | pass 44 | 45 | #join all parts to make final string 46 | return ''.join(total_data) 47 | 48 | 49 | def get_livestatus(self,cmk_server_port, lql): 50 | 51 | 52 | lql_answer_python = None 53 | livestatus_log = "" 54 | 55 | try: 56 | msg = "\n#--------------------------------------------------------------------------------\n\n" 57 | msg += "Verbinde zu: " + str(cmk_server_port) 58 | livestatus_log += msg + "\n" 59 | print msg 60 | 61 | max_attempts = 10 62 | for attempt in range(max_attempts): 63 | msg = "Verbindungsversuch: #" + str(attempt) 64 | livestatus_log += msg + "\n" 65 | print msg 66 | 67 | # Verbinden zum Server und LQL abfragen 68 | s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) 69 | s.connect(cmk_server_port) 70 | s.send(lql) 71 | s.shutdown(socket.SHUT_WR) 72 | lql_answer = self.__recv_timeout(s) 73 | 74 | if len(lql_answer) < 10: 75 | if attempt < max_attempts: 76 | time.sleep(20) 77 | else: 78 | raise Exception("ERROR: Es wurden keine Daten von Server empfangen!") 79 | else: 80 | break 81 | 82 | 83 | #konvertiere Antwort in Python Sourcecode 84 | lql_answer_python = eval(lql_answer) 85 | 86 | if len(lql_answer_python) < 10: 87 | raise Exception("ERROR: Die von Server empfangenen Daten konnten nicht in Python-Daten konvertiert werden!") 88 | 89 | 90 | 91 | except Exception, e: 92 | livestatus_log += str(e) + "\n" 93 | print str(e) 94 | 95 | 96 | 97 | return (lql_answer_python, livestatus_log) 98 | -------------------------------------------------------------------------------- /if64_xx/checks/if64_neighbor: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | # -*- encoding: utf-8; py-indent-offset: 4 -*- 3 | # +------------------------------------------------------------------+ 4 | # | ____ _ _ __ __ _ __ | 5 | # | / ___| |__ ___ ___| | __ | \/ | |/ / | 6 | # | | | | '_ \ / _ \/ __| |/ / | |\/| | ' / | 7 | # | | |___| | | | __/ (__| < | | | | . \ | 8 | # | \____|_| |_|\___|\___|_|\_\___|_| |_|_|\_\ | 9 | # | | 10 | # | Copyright Mathias Kettner 2014 mk@mathias-kettner.de | 11 | # +------------------------------------------------------------------+ 12 | # 13 | # This file is part of Check_MK. 14 | # The official homepage is at http://mathias-kettner.de/check_mk. 15 | # 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 | # ails. 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. 26 | 27 | # Author: Christian Burmeister 28 | 29 | neighbor_search = [] 30 | neighbor_ignore = ["IP Phone", " ATA "] 31 | 32 | 33 | def parse_if64_neighbor(info): 34 | 35 | if_all, lldpRemSysName, lldpLocPortDesc, cdpCacheDeviceId = info 36 | 37 | info_neighbor = (if_all,lldpRemSysName, lldpLocPortDesc, cdpCacheDeviceId, neighbor_ignore, neighbor_search) 38 | 39 | info_neighbor_parsed = parse_neighbor_info(info_neighbor) 40 | 41 | parsed = (if_all, info_neighbor_parsed) 42 | 43 | return parsed 44 | 45 | def inventory_if64_neighbor(parsed): 46 | (if_all, info_neighbor_parsed) = parsed 47 | 48 | tmp_if_all = [] 49 | for interface in if_all: 50 | if interface == None: 51 | continue 52 | tmp_if_all.append([None] + interface) 53 | if_all = tmp_if_all 54 | 55 | return inventory_if64_params_neighbor(if_all, info_neighbor_parsed) 56 | 57 | 58 | def check_if64_neighbor(item, params, parsed): 59 | (if_all, info_neighbor_parsed) = parsed 60 | 61 | 62 | info_if64_check = [] 63 | for interface in if_all: 64 | if interface == None: 65 | continue 66 | info_if64_check.append([None] + interface) 67 | if interface[1] == item: 68 | return check_if64_neighbor_interface(interface, if_all, info_neighbor_parsed, params, item) 69 | 70 | return check_if64_original(item, params, info_if64_check) 71 | 72 | 73 | 74 | 75 | check_info["if64_neighbor"] = { 76 | # 'parse_function' : parse_if64, 77 | 'check_function' : check_if64_neighbor, 78 | 'inventory_function' : inventory_if64_neighbor, 79 | 'parse_function' : parse_if64_neighbor, 80 | 'service_description' : 'Interface %s', 81 | 'has_perfdata' : True, 82 | 'includes' : [ 'if.include', 'if64.include', 'if_network.include' ], 83 | 'snmp_info' : [( ".1.3.6.1.2.1", if64_snmp_end_oids), 84 | oid_lldpRemSysName, 85 | oid_lldpLocPortDesc, 86 | oid_cdpCacheDeviceId, 87 | ], 88 | 'snmp_scan_function' : lambda oid: if64_scan_function(oid, False), 89 | 'group' : 'if', 90 | # 'node_info' : True, 91 | 'default_levels_variable' : 'if_default_levels', 92 | } 93 | -------------------------------------------------------------------------------- /network_management_with_cmk/get_config.py: -------------------------------------------------------------------------------- 1 | from device_cisco_hp import Device_cisco_hp 2 | import time 3 | import sys 4 | import re 5 | import socket 6 | 7 | 8 | def recv_timeout(the_socket,timeout=2): 9 | #make socket non blocking 10 | the_socket.setblocking(0) 11 | 12 | #total data partwise in an array 13 | total_data=[]; 14 | data=''; 15 | 16 | #beginning time 17 | begin=time.time() 18 | while 1: 19 | #if you got some data, then break after timeout 20 | if total_data and time.time()-begin > timeout: 21 | break 22 | 23 | #if you got no data at all, wait a little longer, twice the timeout 24 | elif time.time()-begin > timeout*2: 25 | break 26 | 27 | #recv something 28 | try: 29 | data = the_socket.recv(8192) 30 | if data: 31 | total_data.append(data) 32 | #change the beginning time for measurement 33 | begin=time.time() 34 | else: 35 | #sleep for sometime to indicate a gap 36 | time.sleep(0.1) 37 | except: 38 | pass 39 | 40 | #join all parts to make final string 41 | return ''.join(total_data) 42 | 43 | 44 | def read_file(filename): 45 | 46 | file = open(filename, 'r') 47 | 48 | list = [] 49 | for line in file: 50 | list.append(line.strip()) 51 | 52 | return list 53 | 54 | 55 | def get_HostByLivestatus(): 56 | 57 | 58 | all_server = [('10.3.3.3', 6557)] 59 | lql = "GET services\n" 60 | lql += "Columns: host_name host_alias host_address plugin_output host_filename\n" 61 | lql += "Filter: check_command = check_mk-snmp_info_v2\n" 62 | lql += "Filter: host_plugin_output !~ No IP packet received\n" 63 | lql += "OutputFormat: python\n" 64 | 65 | 66 | date = time.strftime("%Y-%m-%d_%H-%M-%S") 67 | path = "./" 68 | log_file = open(path + "CHANGELOG_" + date + ".log","w") 69 | 70 | 71 | for server in all_server: 72 | try: 73 | 74 | # Verbinden zum Server und LQL abfragen 75 | s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) 76 | s.connect(server) 77 | s.send(lql) 78 | s.shutdown(socket.SHUT_WR) 79 | lql_answer = recv_timeout(s) 80 | 81 | lql_answer_python = eval(lql_answer) 82 | 83 | 84 | lql_answer_python_dopple = [] 85 | for host in lql_answer_python: 86 | lql_answer_python_dopple.append(host) 87 | lql_answer_python_dopple.append(host) 88 | 89 | 90 | 91 | for host in lql_answer_python: 92 | (host_name, host_alias, host_address, plugin_output, host_filename) = host 93 | 94 | print host 95 | if "cisco".lower() in plugin_output: 96 | 97 | device = Device_cisco_hp(host_address,log_file) 98 | device.logging("--- cmk_host_filname: "+ host_filename) 99 | device.connect('user','pass',"enable_pass") 100 | config = device.command("show running-config") 101 | print config 102 | 103 | #device.command("wr") 104 | device.disconnect() 105 | except Exception, e: 106 | print str(e) 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | def save_output(ip, config, extension, path,date): 115 | #date = time.strftime("%Y-%m-%d_%H-%M-%S") 116 | file_name = str(ip) + "_" + str(date) + "." + extension 117 | fh = open(path + file_name,"w") 118 | fh.writelines(config) 119 | fh.close() 120 | 121 | 122 | if __name__ == "__main__": 123 | get_HostByLivestatus() 124 | -------------------------------------------------------------------------------- /mcafee_IPS/checks/mcafee_chassis: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | # -*- encoding: utf-8; py-indent-offset: 4 -*- 3 | # +------------------------------------------------------------------+ 4 | # | ____ _ _ __ __ _ __ | 5 | # | / ___| |__ ___ ___| | __ | \/ | |/ / | 6 | # | | | | '_ \ / _ \/ __| |/ / | |\/| | ' / | 7 | # | | |___| | | | __/ (__| < | | | | . \ | 8 | # | \____|_| |_|\___|\___|_|\_\___|_| |_|_|\_\ | 9 | # | | 10 | # | Copyright Mathias Kettner 2014 mk@mathias-kettner.de | 11 | # +------------------------------------------------------------------+ 12 | # 13 | # This file is part of Check_MK. 14 | # The official homepage is at http://mathias-kettner.de/check_mk. 15 | # 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 | # ails. 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. 26 | 27 | 28 | def inventory_mcafee_chassis(info): 29 | if len(info[0][0]) == 5: 30 | return [ (None, None) ] 31 | return [] 32 | 33 | def check_mcafee_chassis(item, params, info): 34 | (temperatureStatus, fanStatus, primaryPowerSupplyStatus, secondaryPowerSupplyStatus, ivSysHealth) = info[0][0] 35 | temperatureStatus_map = {"0":"normal", "1":"abnormal"} 36 | fanStatus_map = {"0":"normal", "1":"abnormal","2":"removed"} 37 | PowerSupplyStatus_map = {"0":"not-present", "1":"present-operational","2":"present-nonoperational"} 38 | ivSysHealth_map = {"0":"bad", "1":"good","2":"uninitialized"} 39 | 40 | warn = 0 41 | msg = [] 42 | 43 | msg_temp = "SysHealth: " + ivSysHealth_map[ivSysHealth] 44 | if saveint(ivSysHealth) != 1: 45 | warn = 1 46 | msg_temp += "(!)" 47 | msg.append( msg_temp ) 48 | 49 | msg_temp = "temperature: " + temperatureStatus_map[temperatureStatus] 50 | if saveint(temperatureStatus) != 0: 51 | warn = 1 52 | msg_temp += "(!)" 53 | msg.append( msg_temp ) 54 | 55 | msg_temp = "fan: " + fanStatus_map[fanStatus] 56 | if saveint(fanStatus) != 0: 57 | warn = 1 58 | msg_temp += "(!)" 59 | msg.append( msg_temp ) 60 | 61 | 62 | msg_temp = "primaryPowerSupply: " + PowerSupplyStatus_map[primaryPowerSupplyStatus] 63 | if saveint(primaryPowerSupplyStatus) != 1: 64 | warn = 1 65 | msg_temp += "(!)" 66 | msg.append( msg_temp ) 67 | 68 | msg_temp = "secondaryPowerSupply: " + PowerSupplyStatus_map[secondaryPowerSupplyStatus] 69 | if saveint(secondaryPowerSupplyStatus) != 1: 70 | warn = 1 71 | msg_temp += "(!)" 72 | msg.append( msg_temp ) 73 | 74 | if warn > 0: 75 | return 1, " - ".join(msg) 76 | return 0, " - ".join(msg) 77 | 78 | 79 | 80 | 81 | 82 | check_info["mcafee_chassis"] = { 83 | 'check_function': check_mcafee_chassis, 84 | 'inventory_function': inventory_mcafee_chassis, 85 | 'service_description': 'Chassis_Status', 86 | 'has_perfdata': True, 87 | 'snmp_info': [( ".1.3.6.1.4.1.8962.2.1.2.1", ["7.1","7.2","7.3","7.4","1.13"]), # chassisGrp 88 | ], 89 | 'snmp_scan_function' : lambda oid: oid(".1.3.6.1.4.1.8962.2.1.2.1.1.6.0") == "MCAFEE-NETWORK-SECURITY-PLATFORM", 90 | } 91 | -------------------------------------------------------------------------------- /cisco_power/checks/cisco_power: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | # -*- encoding: utf-8; py-indent-offset: 4 -*- 3 | # +------------------------------------------------------------------+ 4 | # | ____ _ _ __ __ _ __ | 5 | # | / ___| |__ ___ ___| | __ | \/ | |/ / | 6 | # | | | | '_ \ / _ \/ __| |/ / | |\/| | ' / | 7 | # | | |___| | | | __/ (__| < | | | | . \ | 8 | # | \____|_| |_|\___|\___|_|\_\___|_| |_|_|\_\ | 9 | # | | 10 | # | Copyright Mathias Kettner 2014 mk@mathias-kettner.de | 11 | # +------------------------------------------------------------------+ 12 | # 13 | # This file is part of Check_MK. 14 | # The official homepage is at http://mathias-kettner.de/check_mk. 15 | # 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 | # ails. 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. 26 | 27 | # .1.3.6.1.4.1.9.9.13.1.5.1.2.1 "removed" 28 | # .1.3.6.1.4.1.9.9.13.1.5.1.2.2 "AC Power Supply" 29 | # .1.3.6.1.4.1.9.9.13.1.5.1.3.1 5 30 | # .1.3.6.1.4.1.9.9.13.1.5.1.3.2 1 31 | # .1.3.6.1.4.1.9.9.13.1.5.1.4.1 1 32 | # .1.3.6.1.4.1.9.9.13.1.5.1.4.2 2 33 | 34 | cisco_power_states = ( 35 | '', 36 | 'normal', 37 | 'warning', 38 | 'critical', 39 | 'shutdown', 40 | 'not present', 41 | 'not functioning', 42 | ) 43 | 44 | cisco_power_sources = ( 45 | '', 46 | 'unknown', 47 | 'AC', 48 | 'DC', 49 | 'external power supply', 50 | 'internal redundant', 51 | ) 52 | 53 | def inventory_cisco_power(info): 54 | # Note: the name of the power supply is not unique. We have seen 55 | # a Cisco with four entries in the MIB. So we force uniqueness 56 | # by appending a "/4" for ID 4 if the name is not unique 57 | discovered = {} 58 | for sid, textinfo, state, source in info: 59 | if state != '5': 60 | name = cisco_sensor_item(textinfo, sid) 61 | discovered.setdefault(name, []).append(sid) 62 | 63 | for name, entries in discovered.items(): 64 | if len(entries) == 1: 65 | yield name, None 66 | else: 67 | for entry in entries: 68 | yield ("%s %s" % (name, entry)), None 69 | 70 | 71 | def check_cisco_power(item, no_params, info): 72 | for sid, textinfo, state, source in info: 73 | if cisco_sensor_item(textinfo, sid) == item or cisco_sensor_item(textinfo, sid)+" "+sid == item: 74 | state = int(state) 75 | source = int(source) 76 | output = 'state: %s, source: %s' % \ 77 | (cisco_power_states[state], cisco_power_sources[source]) 78 | if state == 1: 79 | return 0, "%s" % output 80 | elif state == 2: 81 | return 1, "%s" % output 82 | else: 83 | return 2, "%s" % output 84 | 85 | 86 | 87 | check_info["cisco_power"] = { 88 | 'check_function' : check_cisco_power, 89 | 'inventory_function' : inventory_cisco_power, 90 | 'service_description' : 'Power %s', 91 | 'snmp_info' : ('.1.3.6.1.4.1.9.9.13.1.5.1', [ # ciscoEnvMonSupplyStatusEntry 92 | OID_END, 93 | 2, # ciscoEnvMonSupplyStatusDescr 94 | 3, # ciscoEnvMonSupplyState 95 | 4 # ciscoEnvMonSupplySource 96 | ]), 97 | 'snmp_scan_function' : lambda oid: "cisco" in oid(".1.3.6.1.2.1.1.1.0").lower(), 98 | 'includes' : ['cisco_sensor_item.include'], 99 | } 100 | 101 | 102 | -------------------------------------------------------------------------------- /power_ethernet/checks/power_ethernet: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | # -*- encoding: utf-8; py-indent-offset: 4 -*- 3 | # +------------------------------------------------------------------+ 4 | # | ____ _ _ __ __ _ __ | 5 | # | / ___| |__ ___ ___| | __ | \/ | |/ / | 6 | # | | | | '_ \ / _ \/ __| |/ / | |\/| | ' / | 7 | # | | |___| | | | __/ (__| < | | | | . \ | 8 | # | \____|_| |_|\___|\___|_|\_\___|_| |_|_|\_\ | 9 | # | | 10 | # | Copyright Mathias Kettner 2014 mk@mathias-kettner.de | 11 | # +------------------------------------------------------------------+ 12 | # 13 | # This file is part of Check_MK. 14 | # The official homepage is at http://mathias-kettner.de/check_mk. 15 | # 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 | # ails. 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. 26 | 27 | 28 | pethPsePortDetectionStatus_map = { 29 | '1': 'disabled', 30 | '2': 'searching', 31 | '3': 'deliveringPower', 32 | '4': 'fault', 33 | '5': 'test', 34 | '6': 'otherFault' } 35 | 36 | pethMainPseOperStatus_map = { 37 | '1': 'on', 38 | '2': 'off', 39 | '3': 'faulty' } 40 | 41 | def inventory_power_ethernet(info): 42 | return [ (None, None) ] 43 | 44 | def check_power_ethernet(item, params, info): 45 | 46 | pethPsePortEntry = info[0] 47 | pethMainPseEntry = info[1][0] 48 | 49 | interface_status = {} 50 | for interface in pethPsePortEntry: 51 | interface = str(interface[0]) 52 | 53 | if pethPsePortDetectionStatus_map[interface] not in interface_status.keys(): 54 | interface_status[pethPsePortDetectionStatus_map[interface]] = 1 55 | else: 56 | interface_status[pethPsePortDetectionStatus_map[interface]] += 1 57 | 58 | for status in interface_status.keys(): 59 | interface_status[status] = str(interface_status[status]) + "x" 60 | 61 | pethMainPsePower = pethMainPseEntry[0] 62 | pethMainPseOperStatus = pethMainPseEntry[1] 63 | pethMainPseConsumptionPower = pethMainPseEntry[2] 64 | pethMainPseUsageThreshold = int(pethMainPseEntry[3]) 65 | 66 | warn_power = False 67 | if pethMainPseUsageThreshold != 0: 68 | if (int(pethMainPsePower) * ( int(pethMainPseUsageThreshold) / 100.0 )) <= pethMainPseUsageThreshold: 69 | warn_power = True 70 | 71 | msg = "Operational Status: %s, Maximum Power: %sW, " % (pethMainPseOperStatus_map[pethMainPseOperStatus], pethMainPsePower) 72 | msg += "Power in Use: %sW , Details: %s" % (pethMainPseConsumptionPower, str(interface_status)) 73 | 74 | if "fault" in interface_status.keys() or "otherFault" in interface_status.keys() or pethMainPseOperStatus_map[pethMainPseOperStatus] == "faulty" or warn_power: 75 | return (2, "PoE faulty (!) -- " + msg) 76 | elif len(interface_status) != 0: 77 | return (0, msg) 78 | else: 79 | return (3, "item not found in snmp data") 80 | 81 | 82 | 83 | check_info["power_ethernet"] = { 84 | 'check_function': check_power_ethernet, 85 | 'inventory_function': inventory_power_ethernet, 86 | 'service_description': 'PoE Status', 87 | 'snmp_info': [ ('.1.3.6.1.2.1.105.1.1.1', ['6']), # pethPsePortDetectionStatus 88 | ('.1.3.6.1.2.1.105.1.3.1.1', ['2', # pethMainPsePower 89 | '3', # pethMainPseOperStatus 90 | '4', # pethMainPseConsumptionPower 91 | '5']) # pethMainPseUsageThreshold 92 | ], 93 | 'snmp_scan_function': lambda oid: oid(".1.3.6.1.2.1.105.1.1.1.*") != None, 94 | } 95 | -------------------------------------------------------------------------------- /mcafee_IPS/checks/mcafee_if: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | # -*- encoding: utf-8; py-indent-offset: 4 -*- 3 | # +------------------------------------------------------------------+ 4 | # | ____ _ _ __ __ _ __ | 5 | # | / ___| |__ ___ ___| | __ | \/ | |/ / | 6 | # | | | | '_ \ / _ \/ __| |/ / | |\/| | ' / | 7 | # | | |___| | | | __/ (__| < | | | | . \ | 8 | # | \____|_| |_|\___|\___|_|\_\___|_| |_|_|\_\ | 9 | # | | 10 | # | Copyright Mathias Kettner 2014 mk@mathias-kettner.de | 11 | # +------------------------------------------------------------------+ 12 | # 13 | # This file is part of Check_MK. 14 | # The official homepage is at http://mathias-kettner.de/check_mk. 15 | # 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 | # ails. 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. 26 | 27 | def parse_mcafee_if(info): 28 | if_mcafee_mib = ["intfPortIfDescr","intfPortIfAdminStatus", "intfPortIfOperStatus", "intfPortOperatingMode","intfPortInOutType"] 29 | 30 | parsed_info = {} 31 | for i in range(len(info)): 32 | for (if_oid, value) in info[i]: 33 | if if_oid not in parsed_info: 34 | parsed_info[if_oid] = {} 35 | parsed_info[if_oid].update( {if_mcafee_mib[i]:value} ) 36 | 37 | return parsed_info 38 | 39 | 40 | def inventory_mcafee_if(info): 41 | inventory = [] 42 | parsed_info = parse_mcafee_if(info) 43 | 44 | for if_oid in parsed_info: 45 | if_admin_up = "1" 46 | if parsed_info[if_oid]["intfPortIfAdminStatus"] == if_admin_up: 47 | inventory.append( (parsed_info[if_oid]["intfPortIfDescr"], {"if_oid":if_oid}) ) 48 | 49 | return inventory 50 | 51 | def check_mcafee_if(item, params, info): 52 | parsed_info = parse_mcafee_if(info) 53 | if_oid = params.get("if_oid") 54 | 55 | intfPortIfStatus_map = {"1":"up", "2":"down"} 56 | intfPortInOutType_map = {"1":"inside", "2":"outside", "3":"not-specified"} 57 | intfPortOperatingMode_map = {"1":"inline-fail-open-passive","2":"monitor-dual-intf","3":"monitor-single-intf", 58 | "4":"inline-fail-close","5":"inline-fail-open-active"} 59 | 60 | msg = [] 61 | warn = 0 62 | if intfPortIfStatus_map[parsed_info[if_oid]["intfPortIfAdminStatus"]] != "up": 63 | warn += 1 64 | msg.append( "IfAdminStatus: " + intfPortIfStatus_map[parsed_info[if_oid]["intfPortIfAdminStatus"]] + "(!)" ) 65 | 66 | 67 | if intfPortIfStatus_map[parsed_info[if_oid]["intfPortIfOperStatus"]] != "up": 68 | warn += 1 69 | msg.append( "IfOperStatus: " + intfPortIfStatus_map[parsed_info[if_oid]["intfPortIfOperStatus"]] + "(!)" ) 70 | 71 | msg.append( "OperatingMode: " + intfPortOperatingMode_map[parsed_info[if_oid]["intfPortOperatingMode"]] ) 72 | msg.append( "InOutType: " + intfPortInOutType_map[parsed_info[if_oid]["intfPortInOutType"]] ) 73 | 74 | 75 | if warn > 0: 76 | return 1, " - ".join(msg) 77 | return 0, " - ".join(msg) 78 | 79 | 80 | 81 | 82 | 83 | check_info["mcafee_if"] = { 84 | 'check_function': check_mcafee_if, 85 | 'inventory_function': inventory_mcafee_if, 86 | 'service_description': 'Interface %s', 87 | 'has_perfdata': True, 88 | 'snmp_info': [( ".1.3.6.1.4.1.8962", [OID_END,"2.1.2.1.11.1.1.1"]), # intfPortIfDescr 89 | ( ".1.3.6.1.4.1.8962", [OID_END,"2.1.2.1.11.1.1.3"]), # intfPortIfAdminStatus 90 | ( ".1.3.6.1.4.1.8962", [OID_END,"2.1.2.1.11.1.1.4"]), # intfPortIfOperStatus 91 | ( ".1.3.6.1.4.1.8962", [OID_END,"2.1.2.1.11.1.1.5"]), # intfPortOperatingMode 92 | ( ".1.3.6.1.4.1.8962", [OID_END,"2.1.2.1.11.1.1.11"]), # intfPortInOutType 93 | ], 94 | 'snmp_scan_function' : lambda oid: oid(".1.3.6.1.4.1.8962.2.1.2.1.1.6.0") == "MCAFEE-NETWORK-SECURITY-PLATFORM", 95 | } 96 | -------------------------------------------------------------------------------- /cisco_ace_serverfarm/README.md: -------------------------------------------------------------------------------- 1 | 2 | **Beschreibung:** 3 | Der cisco_ace_serverfarm Check überwacht die einzelnen Serverfarmen eines Cisco ACE Loadbalancers (ACE 4710). 4 | 5 | Als "Status details" werden folgende Werte angezeigt (siehe Screenshort 1.png und 2.png): 6 | - rServer: Anzahl der konfigurierten Server in der Serverfarm 7 | - inService: Anzahl der aktiven Server in der Serverfarm 8 | - OutOfOrder: deaktivierte Server 9 | - Error: Server mit einem Fehler 10 | - Error_detail: genauere Fehlermeldung 11 | 12 | Perfdata: 13 | - TotalConns: Anzahl der Verbindungen seit Neustart des Loadbalancers 14 | - FailedConns: Anzahl der fehlerhaften Verbindungen seit Neustart des Loadbalancers 15 | - CurrentConns: Anzahl der aktuellen Verbindungen des rServers 16 | 17 | 18 | Konfiguration der Serverfarmen: 19 | Der Check lässt sich sehr variabel über WATO konfigurieren. 20 | Man findet die Einstellungen unter "Host & Service Parameters -> ACE_F5_Serverfarm". 21 | 22 | Für jeden einzelnen Contex ist folgende Einstellung möglich: 23 | - Default: 24 | Man kann einen Default Werte für WARN/CRIT hinterlegen, um z.B. die Serferfarmen einer Testumgebung immer auf OK zu belassen. 25 | Wenn dies eingestellt ist erscheint im "Status detail" der Text "[Default-Rule, orginal return status: WARN]" oder "[Default-Rule, orginal return status: CRIT]", der CMK Status ist jedoch der eingestellt Wert. 26 | - für jede Serverfarm 27 | für jede Serverfarm kann (auch abweichend vom Default Wert) einzeln festgelegt werden welcher CMK Status zurückgegeben werden soll. Wenn dies eingestellt ist erscheint im "Status detail" der Text "[Individual-Rule, orginal return status: WARN]" oder "[Individual-Rule, orginal return status: CRIT]", der CMK Status ist jedoch der eingestellt Wert. 28 | 29 | - Normalerweise werden die IPs der Endgeräte bei den einzelnen Servern der Serverfarm nicht angezeigt, sondern nur die IP des Loadbalancers, will man jedoch die IPs der Endgeräte auf den einzelnen Servern sehen, verwendet man route-maps auf den Core-Routern. 30 | Dies führt jedoch dazu, dann immer nur der aktive Loadbanlacer Context OK ist, der Backup Context ist immer CRIT (kann nicht geroutet werden). Daher gibt es in WATO die Funktion "Show only short status of other nodes (only ACE)", dadurch wird nur noch der verkürzte Status der andern Nodes (z.B. -- other Cluster-Nodes: Nodename -> CRIT) angezeigt und nicht mehr die kompletten "Status details" der jeweiligen Node. 31 | 32 | Cluster: 33 | Meinst werden Loadbanlacer im Cluster betrieben, daher ist der Check für den Cluster Betrieb ausgelegt. Hierbei werden zwei Hosts (zwei gleiche ACE Contexte auf zwei physikalischen ACEs) zusammengefallst, der schlechtere Status wird dabei ignoiert. Eigentich wäre es besser, denn Cluster Status (Check: cisco_ace_cluster) abzufragen und immer den Status den aktiven Context zu verwenden (so habe ich es bei F5-Check gelöst), jedoch kann der Cluster-Status nur im Admin-Context abgefragt werden. 34 | 35 | Zunächst muss ein Cluster aus den beiden Hosts des gleichen Contextes erstellt werden, danach muss dann unter "Clustered services" eine Regel mit "Farm: .*" angelegt werden. Danach wertet der Check dann die Serverfarmen beider Hosts zu einem Service aus. 36 | 37 | 38 | 39 | **INFO:** 40 | Auf einem Cisco ACE Loadbalancer können unterschiedliche Contexte angelegt werden. 41 | Die Contexte können auf zwei unterschiedliche Arten abgefragt werden: 42 | 1. Über die IP des Admin-Contextes 43 | - um die einzelnen Contexte abzufragen (Ausnahme Admin-Context), muss an die SNMP-Community der Context-Name angehängt werden (z.B. Community@Context) 44 | - CMK unterstützt diese Art der SNMP-Community leider nicht 45 | 2. Über die IP des jeweiligen Contextes 46 | - Ich habe für jeden Context in CMK einen Host mit der jeweiligen IP-Adresse angelegt, somit ist die SNMP-Community bei allen Contexten gleich. 47 | - Der Check cisco_ace_serverfarm funktioniert nicht im Admin-Context. 48 | 49 | **TODO:** 50 | Der Plugin ist für Version 1.2.6p5 entwickelt worden, mit Version 1.2.7 muss die Datei ace_serverfarm.py angepasst werden, dies habe ich bis jetzt noch nicht gemacht. 51 | 52 | **Installation:** 53 | Manuell: 54 | CMK-Server: den Check aus "checks/cisco_ace_serverfarm" nach "/omd/sites/SITE/local/share/check_mk/checks/" kopieren 55 | CMK-Server: den Check aus "checks/lb.include nach "/omd/sites/SITE/local/share/check_mk/checks/" kopieren 56 | CMK-Server: den Check aus "web/plugins/wato/ace_serverfarm.py nach "/omd/sites/SITE/local/share/check_mk/web/plugins/wato" kopieren 57 | 58 | 59 | 60 | **Screenshort:** 61 | ![ScreenShot](https://github.com/christianbur/check_mk/blob/master/cisco_ace_serverfarm/1.png) 62 | ![ScreenShot](https://github.com/christianbur/check_mk/blob/master/cisco_ace_serverfarm/2.png) 63 | ![ScreenShot](https://github.com/christianbur/check_mk/blob/master/cisco_ace_serverfarm/4.png) 64 | ![ScreenShot](https://github.com/christianbur/check_mk/blob/master/cisco_ace_serverfarm/5.png) 65 | -------------------------------------------------------------------------------- /f5_bigip_x/checks/f5_bigip_clusterstatus: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | # -*- encoding: utf-8; py-indent-offset: 4 -*- 3 | # +------------------------------------------------------------------+ 4 | # | ____ _ _ __ __ _ __ | 5 | # | / ___| |__ ___ ___| | __ | \/ | |/ / | 6 | # | | | | '_ \ / _ \/ __| |/ / | |\/| | ' / | 7 | # | | |___| | | | __/ (__| < | | | | . \ | 8 | # | \____|_| |_|\___|\___|_|\_\___|_| |_|_|\_\ | 9 | # | | 10 | # | Copyright Mathias Kettner 2014 mk@mathias-kettner.de | 11 | # +------------------------------------------------------------------+ 12 | # 13 | # This file is part of Check_MK. 14 | # The official homepage is at http://mathias-kettner.de/check_mk. 15 | # 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 | # ails. 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. 26 | 27 | 28 | 29 | # F5 nodes need to be ntp synced otherwise status reports might be wrong. 30 | 31 | #http://www.oidview.com/mibs/3375/F5-BIGIP-SYSTEM-MIB.html 32 | #https://support.f5.com/kb/en-us/solutions/public/14000/300/sol14399.html 33 | 34 | def inventory_f5_bigip_clusterstatus(info): 35 | 36 | sysCmFailoverStatus = info[0] 37 | sysCmFailoverStatusDetails = info[1] 38 | 39 | return [ (None, [sysCmFailoverStatus[1][0].strip()] )] 40 | 41 | 42 | def check_f5_bigip_clusterstatus(item, params, info): 43 | 44 | 45 | sysCmFailoverStatus = info[0] 46 | sysCmFailoverStatusDetails = info[1] 47 | 48 | stored_sysCmFailoverStatusStatus = params[0].strip() 49 | sysCmFailoverStatusStatus = sysCmFailoverStatus[1][0].strip() 50 | 51 | sysCmFailoverStatusDetailsNumber = int(sysCmFailoverStatusDetails[0][0]) 52 | sysCmFailoverStatusId = int(sysCmFailoverStatus[0][0].strip()) 53 | 54 | if sysCmFailoverStatusDetailsNumber > 0: 55 | sysCmFailoverStatusDetailsDetails =[] 56 | for i in range(sysCmFailoverStatusDetailsNumber + 1, len(sysCmFailoverStatusDetails)): 57 | sysCmFailoverStatusDetailsDetails.append(sysCmFailoverStatusDetails[i][0].replace("active for ","")) 58 | 59 | 60 | 61 | if stored_sysCmFailoverStatusStatus == sysCmFailoverStatusStatus and sysCmFailoverStatusId in [3,4]: 62 | msg = "Cluster-Status: " + sysCmFailoverStatusStatus 63 | if sysCmFailoverStatusDetailsNumber > 0: 64 | msg += " --- active for: " + str(sysCmFailoverStatusDetailsDetails) 65 | return (0, msg) 66 | elif stored_sysCmFailoverStatusStatus != sysCmFailoverStatusStatus and sysCmFailoverStatusId in [3,4]: 67 | msg = "Cluster-Status: " + sysCmFailoverStatusStatus 68 | msg += " (erwateter Cluster-Status: " + stored_sysCmFailoverStatusStatus + ") " 69 | if sysCmFailoverStatusDetailsNumber > 0: 70 | msg += " --- active for: " + str(sysCmFailoverStatusDetailsDetails) 71 | return (1, msg) 72 | elif sysCmFailoverStatusId in [1,2]: 73 | msg = "Offline: Cluster-Status: " + sysCmFailoverStatusStatus + ") " 74 | msg += " (erwateter Cluster-Status: " + stored_sysCmFailoverStatusStatus + ") " 75 | if sysCmFailoverStatusDetailsNumber > 0: 76 | msg += " --- active for: " + str(sysCmFailoverStatusDetailsDetails) 77 | return (2, msg) 78 | else: 79 | msg = "Unkown: Cluster-Status: " + sysCmFailoverStatusStatus + ") " 80 | msg += " (erwateter Cluster-Status: " + stored_sysCmFailoverStatusStatus + ") " 81 | if sysCmFailoverStatusDetailsNumber > 0: 82 | msg += " --- active for: " + str(sysCmFailoverStatusDetailsDetails) 83 | return (2, msg) 84 | 85 | 86 | 87 | 88 | 89 | check_info["f5_bigip_clusterstatus"] = { 90 | 'check_function': check_f5_bigip_clusterstatus, 91 | 'inventory_function': inventory_f5_bigip_clusterstatus, 92 | 'service_description': 'Cluster status', 93 | 'snmp_info': [('.1.3.6.1.4.1.3375.2.1.14', ["3"]), # sysCmFailoverStatus 94 | ('.1.3.6.1.4.1.3375.2.1.14', ["4"]), # sysCmFailoverStatusDetails 95 | ], 96 | 'snmp_scan_function': \ 97 | lambda oid: '.1.3.6.1.4.1.3375.2' in oid(".1.3.6.1.2.1.1.2.0") \ 98 | and "big-ip" in oid(".1.3.6.1.4.1.3375.2.1.4.1.0").lower() \ 99 | and int(oid(".1.3.6.1.4.1.3375.2.1.4.2.0").split('.')[0]) >= 11, 100 | } 101 | -------------------------------------------------------------------------------- /port_utilization/checks/port_utilization: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | # -*- encoding: utf-8; py-indent-offset: 4 -*- 3 | # +------------------------------------------------------------------+ 4 | # | ____ _ _ __ __ _ __ | 5 | # | / ___| |__ ___ ___| | __ | \/ | |/ / | 6 | # | | | | '_ \ / _ \/ __| |/ / | |\/| | ' / | 7 | # | | |___| | | | __/ (__| < | | | | . \ | 8 | # | \____|_| |_|\___|\___|_|\_\___|_| |_|_|\_\ | 9 | # | | 10 | # | Copyright Mathias Kettner 2014 mk@mathias-kettner.de | 11 | # +------------------------------------------------------------------+ 12 | # 13 | # This file is part of Check_MK. 14 | # The official homepage is at http://mathias-kettner.de/check_mk. 15 | # 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 | # ails. 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. 26 | 27 | 28 | uthor: Christian Burmeister 29 | 30 | def inventory_port_utilization(info): 31 | return [(None, None)] 32 | 33 | 34 | def check_port_utilization(item, params, info): 35 | 36 | if_all, vlanTrunkPortDynamicStatus, dot1qVlanCurrentEntry = info 37 | index_trunk_cisco = get_index_trunk_cisco(vlanTrunkPortDynamicStatus) 38 | index_trunk_hp = get_index_trunk_hp(dot1qVlanCurrentEntry) 39 | 40 | ifOperStatus_up = "1" 41 | find_ifType = ["6"] 42 | 43 | trunk_port_index = [] 44 | trunk_port_up = [] 45 | for interface in if_all: 46 | if interface == None: 47 | continue 48 | if interface[0] in index_trunk_cisco + index_trunk_hp: 49 | if interface[2] in find_ifType: 50 | trunk_port_index.append(interface[0]) 51 | if interface[4] == ifOperStatus_up: 52 | trunk_port_up.append(interface) 53 | 54 | 55 | access_port_up = [] 56 | access_port = [] 57 | for interface in if_all: 58 | if interface == None: 59 | continue 60 | if interface[0] not in trunk_port_index: 61 | if interface[2] in find_ifType: 62 | access_port.append(interface) 63 | if interface[4] == ifOperStatus_up: 64 | access_port_up.append(interface) 65 | 66 | 67 | msg = "Anzahl der Switchports: " 68 | msg += "All_Ports : " + str(len(trunk_port_index) + len(access_port)) 69 | msg += " (All_UP: " + str(len(trunk_port_up) + len(access_port_up)) + ")" 70 | msg += " --- " 71 | msg += "Trunk_Ports : " + str(len(trunk_port_index)) + " (Trunk_UP: " + str(len(trunk_port_up)) + ")" 72 | msg += " --- " 73 | msg += "Access_Ports: " + str(len(access_port)) + " (Access_UP: " + str(len(access_port_up)) + ")" 74 | 75 | max_port = 25 76 | if len(access_port) > max_port: 77 | max_port = len(access_port) * 2 78 | if len(access_port) > max_port: 79 | max_port = len(access_port) * 2 80 | if len(access_port) > max_port: 81 | max_port = len(access_port) * 2 82 | 83 | perfdata = [("access_port_up", len(access_port_up), "", "", 0, max_port)] 84 | return (0, msg, perfdata) 85 | 86 | 87 | def scan_function_port_utilization(oid): 88 | 89 | if oid(".1.3.6.1.4.1.9.9.46.1.6.1.1.14.*") != None: 90 | return True 91 | if oid(".1.3.6.1.2.1.17.7.1.4.3.1.4.*") != None: 92 | return True 93 | 94 | return False 95 | 96 | 97 | check_info["port_utilization"] = { 98 | 'check_function': check_port_utilization, 99 | 'inventory_function': inventory_port_utilization, 100 | 'includes': [ 'if_network.include' ], 101 | 'service_description': "Port utilization", 102 | 'has_perfdata': True, 103 | 'snmp_info': [( ".1.3.6.1.2.1", [ 104 | "2.2.1.1", # ifIndex 0 105 | "2.2.1.2", # ifDescr 1 106 | "2.2.1.3", # ifType 2 107 | "31.1.1.1.15", # ifHighSpeed .. 1000 means 1GBit 108 | "2.2.1.8", # ifOperStatus 4 109 | ]), 110 | oid_vlanTrunkPortDynamicStatus, 111 | oid_dot1qVlanCurrentEntry 112 | ], 113 | 'snmp_scan_function' : scan_function_port_utilization, 114 | # 'group' : 'if', 115 | 'node_info' : True, 116 | 'default_levels_variable' : 'if_default_levels', 117 | } 118 | -------------------------------------------------------------------------------- /if64_xx/checks/port_utilization: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | # -*- encoding: utf-8; py-indent-offset: 4 -*- 3 | # +------------------------------------------------------------------+ 4 | # | ____ _ _ __ __ _ __ | 5 | # | / ___| |__ ___ ___| | __ | \/ | |/ / | 6 | # | | | | '_ \ / _ \/ __| |/ / | |\/| | ' / | 7 | # | | |___| | | | __/ (__| < | | | | . \ | 8 | # | \____|_| |_|\___|\___|_|\_\___|_| |_|_|\_\ | 9 | # | | 10 | # | Copyright Mathias Kettner 2014 mk@mathias-kettner.de | 11 | # +------------------------------------------------------------------+ 12 | # 13 | # This file is part of Check_MK. 14 | # The official homepage is at http://mathias-kettner.de/check_mk. 15 | # 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 | # ails. 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. 26 | 27 | 28 | #Author: Christian Burmeister 29 | 30 | def inventory_port_utilization(info): 31 | return [(None, None)] 32 | 33 | 34 | def check_port_utilization(item, params, info): 35 | 36 | if_all, vlanTrunkPortDynamicStatus, dot1qVlanCurrentEntry = info 37 | index_trunk_cisco = get_index_trunk_cisco(vlanTrunkPortDynamicStatus) 38 | index_trunk_hp = get_index_trunk_hp(dot1qVlanCurrentEntry) 39 | 40 | ifOperStatus_up = "1" 41 | find_ifType = ["6"] 42 | 43 | trunk_port_index = [] 44 | trunk_port_up = [] 45 | for interface in if_all: 46 | if interface == None: 47 | continue 48 | if interface[0] in index_trunk_cisco + index_trunk_hp: 49 | if interface[2] in find_ifType: 50 | trunk_port_index.append(interface[0]) 51 | if interface[4] == ifOperStatus_up: 52 | trunk_port_up.append(interface) 53 | 54 | 55 | access_port_up = [] 56 | access_port = [] 57 | for interface in if_all: 58 | if interface == None: 59 | continue 60 | if interface[0] not in trunk_port_index: 61 | if interface[2] in find_ifType: 62 | access_port.append(interface) 63 | if interface[4] == ifOperStatus_up: 64 | access_port_up.append(interface) 65 | 66 | 67 | msg = "Anzahl der Switchports: " 68 | msg += "All_Ports : " + str(len(trunk_port_index) + len(access_port)) 69 | msg += " (All_UP: " + str(len(trunk_port_up) + len(access_port_up)) + ")" 70 | msg += " --- " 71 | msg += "Trunk_Ports : " + str(len(trunk_port_index)) + " (Trunk_UP: " + str(len(trunk_port_up)) + ")" 72 | msg += " --- " 73 | msg += "Access_Ports: " + str(len(access_port)) + " (Access_UP: " + str(len(access_port_up)) + ")" 74 | 75 | max_port = 25 76 | if len(access_port) > max_port: 77 | max_port = len(access_port) * 2 78 | if len(access_port) > max_port: 79 | max_port = len(access_port) * 2 80 | if len(access_port) > max_port: 81 | max_port = len(access_port) * 2 82 | 83 | perfdata = [("access_port_up", len(access_port_up), "", "", 0, max_port)] 84 | return (0, msg, perfdata) 85 | 86 | 87 | 88 | 89 | check_info["port_utilization"] = { 90 | # 'parse_function' : parse_if64, 91 | 'check_function' : check_port_utilization, 92 | 'inventory_function' : inventory_port_utilization, 93 | 'service_description' : "Port utilization", 94 | 'has_perfdata' : True, 95 | 'includes' : [ 'if.include', 'if64.include', 'if_network.include' ], 96 | 'snmp_info' : [( ".1.3.6.1.2.1", [ 97 | "2.2.1.1", # ifIndex 0 98 | "2.2.1.2", # ifDescr 1 99 | "2.2.1.3", # ifType 2 100 | "31.1.1.1.15", # ifHighSpeed .. 1000 means 1GBit 101 | "2.2.1.8", # ifOperStatus 4 102 | ]), 103 | oid_vlanTrunkPortDynamicStatus, 104 | oid_dot1qVlanCurrentEntry 105 | ], 106 | 107 | 'snmp_scan_function' : lambda oid: if64_scan_function(oid, False), 108 | # 'group' : 'if', 109 | # 'node_info' : True, 110 | 'default_levels_variable' : 'if_default_levels', 111 | } 112 | -------------------------------------------------------------------------------- /f5_bigip_x/checks/f5_bigip_vserver: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | # -*- encoding: utf-8; py-indent-offset: 4 -*- 3 | # +------------------------------------------------------------------+ 4 | # | ____ _ _ __ __ _ __ | 5 | # | / ___| |__ ___ ___| | __ | \/ | |/ / | 6 | # | | | | '_ \ / _ \/ __| |/ / | |\/| | ' / | 7 | # | | |___| | | | __/ (__| < | | | | . \ | 8 | # | \____|_| |_|\___|\___|_|\_\___|_| |_|_|\_\ | 9 | # | | 10 | # | Copyright Mathias Kettner 2014 mk@mathias-kettner.de | 11 | # +------------------------------------------------------------------+ 12 | # 13 | # This file is part of Check_MK. 14 | # The official homepage is at http://mathias-kettner.de/check_mk. 15 | # 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 | # ails. 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. 26 | 27 | 28 | def parse_f5_bigip_vserver(info): 29 | sysCmFailoverStatusStatus = info[1][0][0] 30 | 31 | vservers = {} 32 | for name, status, tot_conns, cur_conns in info[0]: 33 | vservers[name] = { 34 | "status" : int(status), 35 | "tot_conns" : int(tot_conns), 36 | "cur_conns" : int(cur_conns), 37 | } 38 | return (vservers, sysCmFailoverStatusStatus) 39 | 40 | 41 | def inventory_f5_bigip_vserver(parsed): 42 | (parsed_vservers, sysCmFailoverStatusStatus) = parsed 43 | for name, vserver in parsed_vservers.items(): 44 | #if vserver["status"] == 1: 45 | yield name, None 46 | 47 | 48 | def check_f5_bigip_vserver(item, params, parsed): 49 | (parsed_vservers, sysCmFailoverStatusStatus) = parsed 50 | if item in parsed_vservers: 51 | vserver = parsed_vservers[item] 52 | 53 | # Current number of connections 54 | #yield 0, "Client connections: %d" % vserver["cur_conns"], [("connections", vserver["cur_conns"])] 55 | msg = "Client connections: %d, " % vserver["cur_conns"] 56 | perfdata = [ ("connections", vserver["cur_conns"]) ] 57 | 58 | # New connections per time 59 | counter_name = "f5_bigip_vserver.%s.connections" % item 60 | rate = get_rate(counter_name, time.time(), vserver["tot_conns"]) 61 | #yield 0, "Rate: %.2f/sec" % rate, [("conn_rate", rate)] 62 | msg += "Rate: %.2f/sec, " % rate 63 | perfdata.append( ("conn_rate", rate) ) 64 | 65 | 66 | # Current server status 67 | status = vserver["status"] 68 | if status == 0: 69 | return_status = 1 70 | msg += "Virtual Server is disabled (!)" 71 | elif status == 1: 72 | return_status = 0 73 | msg += "Virtual Server is up and available" 74 | elif status == 2: 75 | return_status = 2 76 | msg += "Virtual Server is currently not available (!!)" 77 | elif status == 3: 78 | return_status = 2 79 | msg += "Virtual Server is not available (!!)" 80 | elif status == 4: 81 | return_status = 1 82 | msg += "Virtual Server status is unknown (!)" 83 | else: 84 | return_status = 3 85 | msg += "Unhandled status (%d) (!)" % status 86 | 87 | if sysCmFailoverStatusStatus == "STANDBY" and return_status != 0: 88 | return_status = 0 89 | msg += " ---- Cluster-Status is STANDBY, ignore vServer status" 90 | 91 | (return_status, msg) = wato_return_state_lb(params, item, return_status, msg, "Virtual Server ") 92 | return return_status, msg, perfdata 93 | 94 | 95 | 96 | 97 | check_info["f5_bigip_vserver"] = { 98 | 'parse_function' : parse_f5_bigip_vserver, 99 | 'check_function' : check_f5_bigip_vserver, 100 | 'inventory_function' : inventory_f5_bigip_vserver, 101 | 'service_description' : 'Virtual Server %s', 102 | "has_perfdata" : True, 103 | 'group' : "cisco_ace_serverfarm", 104 | 'includes' : [ 'lb.include' ], 105 | 'snmp_info' : [('.1.3.6.1.4.1.3375.2.2.10', [ 106 | "13.2.1.1", # Name 107 | "13.2.1.2", # Status 108 | "2.3.1.11", # ltmVirtualServStatClientTotConns 109 | "2.3.1.12", # ltmVirtualServStatClientCurConns 110 | ]), 111 | ('.1.3.6.1.4.1.3375.2.1.14.3', ['2']), # sysCmFailoverStatusStatus 112 | ], 113 | 'snmp_scan_function' : lambda oid: '.1.3.6.1.4.1.3375.2' in oid(".1.3.6.1.2.1.1.2.0") \ 114 | and "big-ip" in oid(".1.3.6.1.4.1.3375.2.1.4.1.0").lower(), 115 | } 116 | -------------------------------------------------------------------------------- /if64_xx/inventory/switch_mac: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | # -*- encoding: utf-8; py-indent-offset: 4 -*- 3 | # +------------------------------------------------------------------+ 4 | # | ____ _ _ __ __ _ __ | 5 | # | / ___| |__ ___ ___| | __ | \/ | |/ / | 6 | # | | | | '_ \ / _ \/ __| |/ / | |\/| | ' / | 7 | # | | |___| | | | __/ (__| < | | | | . \ | 8 | # | \____|_| |_|\___|\___|_|\_\___|_| |_|_|\_\ | 9 | # | | 10 | # | Copyright Mathias Kettner 2013 mk@mathias-kettner.de | 11 | # +------------------------------------------------------------------+ 12 | # 13 | # This file is part of Check_MK. 14 | # The official homepage is at http://mathias-kettner.de/check_mk. 15 | # 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 | # ails. 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. 26 | 27 | # Author: Christian Burmeister 28 | 29 | ifOperStatus = { 30 | "1":"up", 31 | "2":"down", 32 | "3":"testing", 33 | "4":"unknown", 34 | "5":"dormant", 35 | "6":"notPresent", 36 | "7":"lowerLayerDown"} 37 | 38 | 39 | def get_if_desc(port_info): 40 | ifDesc_dict = {} 41 | 42 | for interface in port_info: 43 | if_index = str(interface[0]) 44 | if_desc = interface[1] 45 | ifDesc_dict[if_index] = if_desc 46 | 47 | return ifDesc_dict 48 | 49 | 50 | def inv_switch_mac(info, params): 51 | port_info, sysName, vlanTrunkPortDynamicStatus, dot1qVlanCurrentEntry, vmMembershipTable, dot3adAggPortSelectedAggID = info 52 | 53 | ip_address = lookup_ip_address(g_hostname) 54 | snmp_credentials = snmp_credentials_of(g_hostname) 55 | 56 | all_macs = MAC_SNMP(ip_address, snmp_credentials, mac_decode_dict, mac_custom_decode_dict).get_all_macs() 57 | count_macs = {} 58 | 59 | vmMembershipTable_dict = get_vmMembershipTable(vmMembershipTable) 60 | (index_trunk_cisco, index_nottrunk_cisco) = get_index_trunk_cisco(vlanTrunkPortDynamicStatus, vmMembershipTable_dict, True) 61 | (index_trunk_hp, index_nottrunk_hp) = get_index_trunk_hp(dot1qVlanCurrentEntry, True) 62 | index_portchannel_cisco = get_index_portchannel_cisco(dot3adAggPortSelectedAggID) 63 | 64 | ifDesc_dict = get_if_desc(port_info) 65 | 66 | node_mac = inv_tree("networking.switch_mac:") 67 | 68 | 69 | for if_index in sorted(all_macs.keys()): 70 | for vlan in sorted(all_macs[if_index].keys()): 71 | 72 | port_type = get_port_type(if_index, index_trunk_cisco, index_nottrunk_cisco, index_trunk_hp, index_nottrunk_hp, index_portchannel_cisco) 73 | 74 | 75 | node_mac.append({ 76 | "index" : if_index, 77 | "description" : ifDesc_dict.get(if_index, "UNKOWN"), 78 | "trunk" : port_type, 79 | "vlan" : vlan, 80 | "mac" : ", ".join(["%s (%s)" % (mac, mac_vendor) for mac, mac_vendor in sorted(all_macs[if_index][vlan])]) 81 | }) 82 | 83 | if not "Trunk" in port_type or "Access" in port_type: 84 | for mac, mac_vendor in all_macs[if_index][vlan]: 85 | vendor_index = mac_vendor + " (" + mac[:8] + ")" 86 | 87 | if vendor_index not in count_macs: 88 | count_macs[vendor_index] = 0 89 | count_macs[vendor_index] += 1 90 | 91 | 92 | 93 | node_mac_vendor = inv_tree("networking.switch_mac_count:") 94 | for mac_vendor in sorted(count_macs.keys()): 95 | node_mac_vendor.append({ 96 | "vendor" : mac_vendor, 97 | "counter" : count_macs[mac_vendor] 98 | }) 99 | 100 | 101 | 102 | 103 | inv_info['switch_mac'] = { 104 | "inv_function" : inv_switch_mac, 105 | 'includes': [ 'mac.include', 'mac.db', 'mac_custom.db' ], 106 | 'snmp_info': [ 107 | ( ".1.3.6.1.2.1", [ 108 | "2.2.1.1", # ifIndex 109 | "2.2.1.2", # ifDescr 110 | "31.1.1.1.18", # ifAlias 111 | "2.2.1.3", # ifType 112 | "2.2.1.8", # ifOperStatus 113 | ]), 114 | ('.1.3.6.1.2.1.1', ['5']), #sysName 115 | oid_vlanTrunkPortDynamicStatus, 116 | oid_dot1qVlanCurrentEntry, 117 | oid_vmMembershipTable, 118 | oid_dot3adAggPortSelectedAggID 119 | ], 120 | 'snmp_scan_function' : lambda oid: if64_scan_function(oid, False), 121 | } 122 | -------------------------------------------------------------------------------- /cisco_rf/checks/cisco_rf: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | # -*- encoding: utf-8; py-indent-offset: 4 -*- 3 | # +------------------------------------------------------------------+ 4 | # | ____ _ _ __ __ _ __ | 5 | # | / ___| |__ ___ ___| | __ | \/ | |/ / | 6 | # | | | | '_ \ / _ \/ __| |/ / | |\/| | ' / | 7 | # | | |___| | | | __/ (__| < | | | | . \ | 8 | # | \____|_| |_|\___|\___|_|\_\___|_| |_|_|\_\ | 9 | # | | 10 | # | Copyright Mathias Kettner 2014 mk@mathias-kettner.de | 11 | # +------------------------------------------------------------------+ 12 | # 13 | # This file is part of Check_MK. 14 | # The official homepage is at http://mathias-kettner.de/check_mk. 15 | # 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 | # ails. 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. 26 | 27 | 28 | cRFStatusUnitState_dict = { 29 | "0":"NOT_FOUND", 30 | "1":"notKnown", 31 | "2":"disabled", 32 | "3":"initialization", 33 | "4":"negotiation", 34 | "5":"standbyCold", 35 | "6":"standbyColdConfig", 36 | "7":"standbyColdFileSys", 37 | "8":"standbyColdBulk", 38 | "9":"standbyHot", 39 | "10":"activeFast", 40 | "11":"activeDrain", 41 | "12":"activePreconfig", 42 | "13":"activePostconfig", 43 | "14":"active", 44 | "15":"activeExtraload", 45 | "16":"activeHandback" 46 | } 47 | 48 | cRFStatusPeerUnitState_dict = cRFStatusUnitState_dict 49 | 50 | cRFStatusLastSwactReasonCode_dict = { 51 | "1":"unsupported", 52 | "2":"none", 53 | "3":"notKnown", 54 | "4":"userInitiated", 55 | "5":"userForced", 56 | "6":"activeUnitFailed", 57 | "7":"activeUnitRemoved" 58 | } 59 | 60 | cRFCfgAdminAction_dict = { 61 | "0":"noAction", 62 | "1":"reloadPeer", 63 | "2":"reloadShelf", 64 | "3":"switchActivity", 65 | "4":"forceSwitchActivity", 66 | } 67 | 68 | cRFStatusDuplexMode_dict = { 69 | "2":"False (SUB-Peer not detected)", 70 | "1":"True (SUB-Peer detected)", 71 | } 72 | 73 | def inventory_cisco_rf(info): 74 | return [ (None, info[0][0:6]) ] 75 | 76 | def check_cisco_rf(item, params, info): 77 | if params == info[0][0:6]: 78 | return_status = 0 79 | msg = "UnitId: %s, UnitState: %s, PeerUnitId: %s, PeerUnitState: %s, LastSwactReasonCode: %s, DuplexMode: %s" % ( \ 80 | info[0][1], cRFStatusUnitState_dict[info[0][2]], \ 81 | info[0][3], cRFStatusPeerUnitState_dict[info[0][4]], \ 82 | cRFStatusLastSwactReasonCode_dict[info[0][7]], 83 | cRFStatusDuplexMode_dict[info[0][5]]) 84 | else: 85 | warn_state = ["active", "standbyHot", "disabled"] 86 | if cRFStatusUnitState_dict[info[0][2]] in warn_state and cRFStatusPeerUnitState_dict[info[0][4]] in warn_state: 87 | return_status = 1 88 | else: 89 | return_status = 2 90 | 91 | msg_new = "UnitId: %s, UnitState: %s, PeerUnitId: %s, PeerUnitState: %s, LastSwactReasonCode: %s, DuplexMode: %s" % ( \ 92 | info[0][1], cRFStatusUnitState_dict[info[0][2]], \ 93 | info[0][3], cRFStatusPeerUnitState_dict[info[0][4]], \ 94 | cRFStatusLastSwactReasonCode_dict[info[0][7]], 95 | cRFStatusDuplexMode_dict[info[0][5]]) 96 | msg_old = "UnitId: %s, UnitState: %s, PeerUnitId: %s, PeerUnitState: %s, DuplexMode: %s" % ( \ 97 | params[1], cRFStatusUnitState_dict[params[2]], \ 98 | params[3], cRFStatusPeerUnitState_dict[params[4]], \ 99 | cRFStatusDuplexMode_dict[params[5]]) 100 | 101 | msg = "Supervisor Switchover (!) ------ OLD-Status: [%s], NEW-Status: [%s]" % (msg_new, msg_old) 102 | 103 | 104 | return (return_status, msg) 105 | 106 | check_info["cisco_rf"] = { 107 | 'check_function' : check_cisco_rf, 108 | 'inventory_function' : inventory_cisco_rf, 109 | 'service_description' : 'Supervisor status', 110 | 'snmp_info' : ('.1.3.6.1.4.1.9.9.176.1', [ 111 | OID_END, 112 | 1.1, # cRFStatusUnitId 113 | 1.2, # cRFStatusUnitState 114 | 1.3, # cRFStatusPeerUnitId 115 | 1.4, # cRFStatusPeerUnitState 116 | 1.6, # cRFStatusDuplexMode 117 | 1.7, # cRFStatusManualSwactInhibit 118 | 1.8, # cRFStatusLastSwactReasonCode 119 | 2.11, # cRFCfgAdminAction 120 | ]), 121 | 'snmp_scan_function' : lambda oid: "cisco" in oid(".1.3.6.1.2.1.1.1.0").lower() and oid(".1.3.6.1.4.1.9.9.176.*"), 122 | 'includes' : ['cisco_sensor_item.include'], 123 | } 124 | 125 | 126 | -------------------------------------------------------------------------------- /f5_bigip_x/checks/f5_bigip_pool: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | # -*- encoding: utf-8; py-indent-offset: 4 -*- 3 | # +------------------------------------------------------------------+ 4 | # | ____ _ _ __ __ _ __ | 5 | # | / ___| |__ ___ ___| | __ | \/ | |/ / | 6 | # | | | | '_ \ / _ \/ __| |/ / | |\/| | ' / | 7 | # | | |___| | | | __/ (__| < | | | | . \ | 8 | # | \____|_| |_|\___|\___|_|\_\___|_| |_|_|\_\ | 9 | # | | 10 | # | Copyright Mathias Kettner 2014 mk@mathias-kettner.de | 11 | # +------------------------------------------------------------------+ 12 | # 13 | # This file is part of Check_MK. 14 | # The official homepage is at http://mathias-kettner.de/check_mk. 15 | # 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 | # ails. 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. 26 | 27 | 28 | # Agent / MIB output 29 | # see: 1.3.6.1.4.1.3375.2.2.5.1.2.1 30 | # F5-BIGIP-LOCAL-MIB::ltmPoolName. 8.80.111.111.108.asci_encoded_str = Pool_NMA 31 | # F5-BIGIP-LOCAL-MIB::ltmPoolMemberCnt. 8.80.111.111.108.95.78.77.65 = 2 32 | # F5-BIGIP-LOCAL-MIB::ltmPoolActiveMemberCnt. 8.80.111.111.108.95.78.77.65 = 0 33 | 34 | 35 | # warn, crit numbers of pool members 36 | #f5_bigip_pool_default_levels = (2, 1) 37 | 38 | ltmPoolMemberSessionStatus_dict = {"1":"enabled", "2":"addrdisabled", "3":"servdisabled", "4":"disabled", "5":"forceddisabled"} 39 | 40 | def inventory_f5_bigip_pool(checkname,info): 41 | # inventorize all pools and their member count 42 | inventory = [] 43 | for line in info[0]: 44 | if line[0] != "": 45 | inventory.append((line[0], None)) 46 | return inventory 47 | 48 | def f5_bigip_pool_get_down_members(info, item): 49 | host_down = [] 50 | host_disabled = [] 51 | if len(info) < 2: # no data for pool members 52 | return 53 | for line in info[1]: 54 | if line[0] == item and (line[2] != '4' or line[3] != '4' or line[4] in ('2', '3', '4', '5' )): 55 | if re.match("\/\S*\/\S*", line[5]): 56 | host = line[5].split("/")[2] 57 | else: 58 | host = line[5] 59 | 60 | ltmPoolMemberSessionStatus = line[4] 61 | if ltmPoolMemberSessionStatus in ('1'): 62 | host_down.append(host+":"+line[1]) 63 | elif ltmPoolMemberSessionStatus in ('2', '3', '4', '5' ): 64 | host_disabled.append(host+":"+line[1] + " --> " + ltmPoolMemberSessionStatus_dict[ltmPoolMemberSessionStatus]) 65 | return (host_down, host_disabled) 66 | 67 | def check_f5_bigip_pool(item, params, info): 68 | for line in info[0]: 69 | if line[0] == item: 70 | 71 | pool_act_members = int(line[1]) 72 | pool_def_members = int(line[2]) 73 | (host_down, host_disabled) = f5_bigip_pool_get_down_members(info, item) 74 | msg = "%d of %d members are up" % ( pool_act_members, pool_def_members ) 75 | return_status = 0 76 | if pool_act_members == pool_def_members: 77 | return_status = 0 78 | elif pool_act_members + len(host_disabled) == pool_def_members and len(host_down) == 0 and pool_act_members > 0: 79 | return_status = 0 80 | elif len(host_down) > 0 and pool_act_members > 0: 81 | return_status = 1 82 | msg += " (!)" 83 | elif pool_act_members == 0: 84 | return_status = 2 85 | msg += " (!!)" 86 | 87 | 88 | 89 | if len(host_down) > 0: 90 | msg += ", down_nodes: %s" % ", ".join(host_down) 91 | if len(host_disabled) > 0: 92 | msg += ", disabled_nodes: %s" % ", ".join(host_disabled) 93 | 94 | sysCmFailoverStatusStatus = info[2][0][0] 95 | if sysCmFailoverStatusStatus == "STANDBY" and return_status != 0: 96 | msg += " ---- Cluster-Status is STANDBY, ignore Pool status" 97 | return_status = 0 98 | 99 | 100 | (return_status, msg) = wato_return_state_lb(params, item, return_status, msg, "Load Balancing Pool ") 101 | return return_status, msg 102 | return 3, "unexpected Output from SNMP Agent" 103 | 104 | check_info["f5_bigip_pool"] = { 105 | 'check_function' : check_f5_bigip_pool, 106 | # 'group' : 'f5_pools', 107 | 'inventory_function' : inventory_f5_bigip_pool, 108 | 'group' : "cisco_ace_serverfarm", 109 | 'includes' : [ 'lb.include' ], 110 | 'service_description' : 'Load Balancing Pool %s', 111 | 'snmp_info' : [ 112 | ('.1.3.6.1.4.1.3375.2.2.5.1.2.1', [ 113 | 1, # ltmPoolEntry 114 | 8, # ltmPoolActiveMemberCnt 115 | 23, # ltmPoolMemberCnt 116 | ]), 117 | ('.1.3.6.1.4.1.3375.2.2.5.3.2.1', [ 118 | 1, # ltmPoolMemberPoolName 119 | 4, # ltmPoolMemberPort 120 | 10, # ltmPoolMemberMonitorState 121 | 11, # ltmPoolMemberMonitorStatus 122 | 13, # ltmPoolMemberSessionStatus 123 | 19, # ltmPoolMemberNodeName 124 | ]), 125 | ('.1.3.6.1.4.1.3375.2.1.14.3', ['2']), # sysCmFailoverStatusStatus 126 | ], 127 | 'snmp_scan_function': \ 128 | lambda oid: '.1.3.6.1.4.1.3375.2' in oid(".1.3.6.1.2.1.1.2.0") \ 129 | and "big-ip" in oid(".1.3.6.1.4.1.3375.2.1.4.1.0").lower(), 130 | } 131 | -------------------------------------------------------------------------------- /if64_xx/inventory/switch_ipRoute: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | # -*- encoding: utf-8; py-indent-offset: 4 -*- 3 | # +------------------------------------------------------------------+ 4 | # | ____ _ _ __ __ _ __ | 5 | # | / ___| |__ ___ ___| | __ | \/ | |/ / | 6 | # | | | | '_ \ / _ \/ __| |/ / | |\/| | ' / | 7 | # | | |___| | | | __/ (__| < | | | | . \ | 8 | # | \____|_| |_|\___|\___|_|\_\___|_| |_|_|\_\ | 9 | # | | 10 | # | Copyright Mathias Kettner 2013 mk@mathias-kettner.de | 11 | # +------------------------------------------------------------------+ 12 | # 13 | # This file is part of Check_MK. 14 | # The official homepage is at http://mathias-kettner.de/check_mk. 15 | # 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 | # ails. 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. 26 | 27 | # Author: Christian Burmeister 28 | 29 | #inetCidrRouteTable ipCidrRouteTable ipRouteTable 30 | 31 | def get_ipRouteTable(ipRouteTable): 32 | ipRouteTable_decode = { 33 | "1":"ipRouteDest", 34 | "2":"ipRouteIfIndex", 35 | "3":"ipRouteMetric1", 36 | "4":"ipRouteMetric2", 37 | "5":"ipRouteMetric3", 38 | "6":"ipRouteMetric4", 39 | "7":"ipRouteNextHop", 40 | "8":"ipRouteType", 41 | "9":"ipRouteProto", 42 | "10":"ipRouteAge", 43 | "11":"ipRouteMask", 44 | "12":"ipRouteMetric5", 45 | "13":"ipRouteInfo"} 46 | ipRouteProto_decode = { 47 | "1":"other", 48 | "2":"local", 49 | "3":"netmgmt", 50 | "4":"icmp", 51 | "5":"egp", 52 | "6":"ggp", 53 | "7":"hello", 54 | "8":"rip", 55 | "9":"is-is", 56 | "10":"es-is", 57 | "11":"ciscoIgrp", 58 | "12":"bbnSpfIgp", 59 | "13":"ospf", 60 | "14":"bgp"} 61 | ipRouteType_decode = { 62 | "1":"other", 63 | "2":"invalid", 64 | "3":"direct", 65 | "4":"indirect"} 66 | 67 | ipRouteTable_dict = {} 68 | for oid, value in ipRouteTable: 69 | oid_type = oid.split(".")[0] 70 | oid_ip = ".".join(oid.split(".")[1:]) 71 | 72 | if oid_ip not in ipRouteTable_dict.keys(): 73 | ipRouteTable_dict[oid_ip] = {} 74 | 75 | if ipRouteTable_decode[oid_type] == "ipRouteMask": 76 | mask_cidr = str(sum([bin(int(x)).count('1') for x in value.split('.')])) 77 | ipRouteTable_dict[oid_ip].update( {"ipRouteMask_cidr": mask_cidr} ) 78 | ipRouteTable_dict[oid_ip].update( {ipRouteTable_decode[oid_type]:value} ) 79 | 80 | elif ipRouteTable_decode[oid_type] == "ipRouteProto": 81 | ipRouteProto_desc = ipRouteProto_decode[value] 82 | ipRouteTable_dict[oid_ip].update( {ipRouteTable_decode[oid_type]:ipRouteProto_desc} ) 83 | 84 | elif ipRouteTable_decode[oid_type] == "ipRouteType": 85 | ipRouteType_desc = ipRouteType_decode[value] 86 | ipRouteTable_dict[oid_ip].update( {ipRouteTable_decode[oid_type]:ipRouteType_desc} ) 87 | else: 88 | ipRouteTable_dict[oid_ip].update( {ipRouteTable_decode[oid_type]:value} ) 89 | 90 | return ipRouteTable_dict 91 | 92 | 93 | def get_if_desc(port_info): 94 | ifDesc_dict = {} 95 | 96 | for interface in port_info: 97 | if_index = str(interface[0]) 98 | if_desc = interface[1] 99 | ifDesc_dict[if_index] = if_desc 100 | 101 | return ifDesc_dict 102 | 103 | 104 | 105 | 106 | def inv_switch_ipRoute(info, params): 107 | 108 | port_info, ipRouteTable = info 109 | ipRouteTable_dict = get_ipRouteTable(ipRouteTable) 110 | ifDesc_dict = get_if_desc(port_info) 111 | 112 | routes = inv_tree("networking.switch_ipRoute:") 113 | for route in ipRouteTable_dict: 114 | routes.append({ 115 | "ipRouteDest" : ipRouteTable_dict[route]["ipRouteDest"], 116 | "ipRouteMask_cidr" : ipRouteTable_dict[route]["ipRouteMask_cidr"], 117 | "ipRouteMask" : ipRouteTable_dict[route]["ipRouteMask"], 118 | "ipRouteIfIndex" : ifDesc_dict.get(ipRouteTable_dict[route]["ipRouteIfIndex"], ""), 119 | "ipRouteProto" : ipRouteTable_dict[route]["ipRouteProto"], 120 | "ipRouteNextHop" : ipRouteTable_dict[route]["ipRouteNextHop"], 121 | "ipRouteType" : ipRouteTable_dict[route]["ipRouteType"], 122 | }) 123 | 124 | inv_info['switch_ipRoute'] = { 125 | "inv_function" : inv_switch_ipRoute, 126 | # 'includes': [ 'if_network.include' ], 127 | 'snmp_info': [ 128 | ( ".1.3.6.1.2.1", [ 129 | "2.2.1.1", # ifIndex 130 | "2.2.1.2", # ifDescr 131 | "31.1.1.1.18", # ifAlias 132 | "2.2.1.3", # ifType 133 | ]), 134 | (".1.3.6.1.2.1.4.21", [OID_END, "1"]), 135 | ], 136 | 'snmp_scan_function': lambda oid: oid(".1.3.6.1.2.1.4.21.1.*") != None and oid(".1.3.6.1.2.1.4.24.4.*") == None, 137 | } 138 | -------------------------------------------------------------------------------- /if64_xx/web/plugins/views/switch_x.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | 3 | inventory_displayhints.update({ 4 | 5 | ".networking.switch_ipRoute:" : { "title" : _("Switch Routes (ipRoute)"), "render" : render_inv_dicttable, 6 | "keyorder" : [ "ipRouteDest", "ipRouteMask_cidr", "ipRouteMask", "ipRouteIfIndex", 7 | "ipRouteProto", "ipRouteNextHop", "ipRouteType"] }, 8 | ".networking.switch_ipRoute:*.ipRouteDest" : { "title" : _("ipRouteDest") }, 9 | ".networking.switch_ipRoute:*.ipRouteMask_cidr" : { "title" : _("ipRouteMask_cidr") }, 10 | ".networking.switch_ipRoute:*.ipRouteMask" : { "title" : _("ipRouteMask") }, 11 | ".networking.switch_ipRoute:*.ipRouteIfIndex" : { "title" : _("ipRouteIfIndex") }, 12 | ".networking.switch_ipRoute:*.ipRouteProto" : { "title" : _("ipRouteProto") }, 13 | ".networking.switch_ipRoute:*.ipRouteNextHop" : { "title" : _("ipRouteNextHop") }, 14 | ".networking.switch_ipRoute:*.ipRouteType" : { "title" : _("ipRouteType") }, 15 | 16 | 17 | ".networking.switch_ipCidrRoute:" : { "title" : _("Switch Routes (ipCidrRoute)"), "render" : render_inv_dicttable, 18 | "keyorder" : [ "ipCidrRouteDest", "ipCidrRouteMask_cidr", "ipCidrRouteMask", "ipCidrRouteIfIndex", 19 | "ipCidrRouteProto", "ipCidrRouteNextHop", "ipCidrRouteType"] }, 20 | ".networking.switch_ipCidrRoute:*.ipCidrRouteDest" : { "title" : _("ipCidrRouteDest") }, 21 | ".networking.switch_ipCidrRoute:*.ipCidrRouteMask_cidr" : { "title" : _("ipCidrRouteMask_cidr") }, 22 | ".networking.switch_ipCidrRoute:*.ipCidrRouteMask" : { "title" : _("ipCidrRouteMask") }, 23 | ".networking.switch_ipCidrRoute:*.ipCidrRouteIfIndex" : { "title" : _("ipCidrRouteIfIndex") }, 24 | ".networking.switch_ipCidrRoute:*.ipCidrRouteProto" : { "title" : _("ipCidrRouteProto") }, 25 | ".networking.switch_ipCidrRoute:*.ipCidrRouteNextHop" : { "title" : _("ipCidrRouteNextHop") }, 26 | ".networking.switch_ipCidrRoute:*.ipCidrRouteType" : { "title" : _("ipCidrRouteType") }, 27 | 28 | ".networking.switch_addresses:" : { "title" : _("Switch IP-Addresses"), "render" : render_inv_dicttable, 29 | "keyorder" : [ "index", "description", "alias", "address" ], }, 30 | ".networking.switch_addresses:*.index" : { "title" : _("if_Index") }, 31 | ".networking.switch_addresses:*.description" : { "title" : _("If_Description")}, 32 | ".networking.switch_addresses:*.alias" : { "title" : _("If_Alias") }, 33 | ".networking.switch_addresses:*.address" : { "title" : _("IP-Address") }, 34 | 35 | 36 | ".networking.switch_interfaces:" : { "title" : _("Switch Interfaces"), "render" : render_inv_dicttable, 37 | "keyorder" : [ "index", "description", "alias", "oper_status", "speed", "dulpex_status", 38 | "neighbor", "vlan", "vlan_voice", "vlan_trunk", "trunk" ], }, 39 | ".networking.switch_interfaces:*.index" : { "title" : _("If_Index") }, 40 | ".networking.switch_interfaces:*.description" : { "title" : _("If_Description") }, 41 | ".networking.switch_interfaces:*.alias" : { "title" : _("If_Alias") }, 42 | ".networking.switch_interfaces:*.oper_status" : { "title" : _("Oper_Status") }, 43 | ".networking.switch_interfaces:*.speed" : { "title" : _("Speed"), "paint" : "nic_speed", }, 44 | ".networking.switch_interfaces:*.dulpex_status" : { "title" : _("Duplex Status") }, 45 | ".networking.switch_interfaces:*.neighbor" : { "title" : _("Neighbor (CDP/LLDP)") }, 46 | ".networking.switch_interfaces:*.vlan" : { "title" : _("VLAN") }, 47 | ".networking.switch_interfaces:*.vlan_voice" : { "title" : _("Voice VLAN") }, 48 | ".networking.switch_interfaces:*.vlan_trunk" : { "title" : _("Trunk VLAN") }, 49 | ".networking.switch_interfaces:*.trunk" : { "title" : _("Trunk/Access") }, 50 | 51 | 52 | ".networking.switch_mac:" : { "title" : _("Switch MAC-Adressen"), "render" : render_inv_dicttable, 53 | "keyorder" : [ "index", "description", "trunk","vlan", "mac" ], }, 54 | ".networking.switch_mac:*.index" : { "title" : _("if_Index") }, 55 | ".networking.switch_mac:*.description" : { "title" : _("If_Description")}, 56 | ".networking.switch_mac:*.trunk" : { "title" : _("Trunk/Access") }, 57 | ".networking.switch_mac:*.vlan" : { "title" : _("Vlan")}, 58 | ".networking.switch_mac:*.mac" : { "title" : _("MAC-Address/Vendor") }, 59 | 60 | 61 | 62 | ".networking.switch_mac_count:" : { "title" : _("Switch MAC-Adressen Count"), "render" : render_inv_dicttable, 63 | "keyorder" : [ "vendor", "counter" ], }, 64 | ".networking.switch_mac_count:*.vendor" : { "title" : _("MAc-Address Vendor") }, 65 | ".networking.switch_mac_count:*.counter" : { "title" : _("Counter")}, 66 | }) 67 | 68 | 69 | declare_invtable_view("invswitch_interface", ".networking.switch_interfaces:", _("Switch Interface"), _("Switch Interfaces")) 70 | declare_invtable_view("invswitch_addresses", ".networking.switch_addresses:", _("Switch Ip-Addresses"), _("Switch IP-Addresses")) 71 | declare_invtable_view("invswitch_ipRoute", ".networking.switch_ipRoute:", _("Switch Routes (ipRoute)"), _("Switch Routes (ipRoute)")) 72 | declare_invtable_view("invswitch_ipCidrRoute", ".networking.switch_ipCidrRoute:", _("Switch Routes (ipCidrRoute)"), _("Switch Routes (ipCidrRoute)")) 73 | declare_invtable_view("invswitch_mac", ".networking.switch_mac:", _("Switch MAC-Adressen"), _("Switch Mac-Adressen")) 74 | declare_invtable_view("invswitch_mac_count", ".networking.switch_mac_count:", _("Switch MAC-Adressen Count"), _("Switch Mac-Adressen Count")) 75 | -------------------------------------------------------------------------------- /if64_xx/checks/if64_trunk: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | # -*- encoding: utf-8; py-indent-offset: 4 -*- 3 | # +------------------------------------------------------------------+ 4 | # | ____ _ _ __ __ _ __ | 5 | # | / ___| |__ ___ ___| | __ | \/ | |/ / | 6 | # | | | | '_ \ / _ \/ __| |/ / | |\/| | ' / | 7 | # | | |___| | | | __/ (__| < | | | | . \ | 8 | # | \____|_| |_|\___|\___|_|\_\___|_| |_|_|\_\ | 9 | # | | 10 | # | Copyright Mathias Kettner 2014 mk@mathias-kettner.de | 11 | # +------------------------------------------------------------------+ 12 | # 13 | # This file is part of Check_MK. 14 | # The official homepage is at http://mathias-kettner.de/check_mk. 15 | # 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 | # ails. 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. 26 | 27 | # Author: Christian Burmeister 28 | 29 | neighbor_search = ["cisco ", "ProCurve ", "HP ", "Switch", "N7K", "N5K"] 30 | neighbor_ignore = ["IP Phone", " ATA "] 31 | 32 | def get_trunks(if_all, info_neighbor_parsed, info_trunk): 33 | 34 | (neighbor_lldp, neighbor_lldp_ignore, neighbor_cdp, neighbor_cdp_ignore) = info_neighbor_parsed 35 | (vlanTrunkPortDynamicStatus, dot3adAggPortSelectedAggID, dot1qVlanCurrentEntry) = info_trunk 36 | 37 | 38 | index_trunk_cisco = get_index_trunk_cisco(vlanTrunkPortDynamicStatus) 39 | index_portchannel_cisco = get_index_portchannel_cisco(dot3adAggPortSelectedAggID) 40 | index_trunk_hp = get_index_trunk_hp(dot1qVlanCurrentEntry) 41 | 42 | index_neighbor = neighbor_lldp.keys() + neighbor_cdp.keys() 43 | 44 | # Ignore LLDP and CDP if interfaceType "propVirtual(53)" 45 | if len(index_neighbor) > 0: 46 | ignore_ifType = ['53'] 47 | new_index_neighbor = [] 48 | 49 | for interface in if_all: 50 | if interface == None: 51 | continue 52 | if interface[0] in index_neighbor: 53 | if interface[2] not in ignore_ifType: 54 | new_index_neighbor.append(interface[0]) 55 | 56 | index_neighbor = new_index_neighbor 57 | 58 | # return Trunk Interfaces (hp or cisco) 59 | if_trunks = [] 60 | for interface in if_all: 61 | if interface == None: 62 | continue 63 | elif interface[0] in index_trunk_cisco + index_trunk_hp: 64 | interface[1] = "If_Trunk " + interface[1] 65 | if_trunks.append([None] + interface) 66 | elif interface[0] in index_portchannel_cisco: 67 | interface[1] = "If_Po " + interface[1] 68 | if_trunks.append([None] + interface) 69 | elif interface[0] in index_neighbor: 70 | interface[1] = "If_CDP/LLDP " + interface[1] 71 | if_trunks.append([None] + interface) 72 | 73 | return if_trunks 74 | 75 | def parse_if64_trunk(info): 76 | 77 | if_all, vlanTrunkPortDynamicStatus, dot3adAggPortSelectedAggID, dot1qVlanCurrentEntry, \ 78 | lldpRemSysName, lldpLocPortDesc, cdpCacheDeviceId, dot3StatsDuplexStatus = info 79 | 80 | info_neighbor = (if_all,lldpRemSysName, lldpLocPortDesc, cdpCacheDeviceId, neighbor_ignore, neighbor_search) 81 | info_trunk = (vlanTrunkPortDynamicStatus, dot3adAggPortSelectedAggID, dot1qVlanCurrentEntry) 82 | info_duplex = dot3StatsDuplexStatus 83 | 84 | info_neighbor_parsed = parse_neighbor_info(info_neighbor) 85 | 86 | parsed = (if_all, info_neighbor_parsed, info_trunk, info_duplex) 87 | 88 | return parsed 89 | 90 | 91 | 92 | def inventory_if64_trunk(parsed): 93 | 94 | (if_all, info_neighbor_parsed, info_trunk, info_duplex) = parsed 95 | 96 | if_trunk = get_trunks(if_all, info_neighbor_parsed, info_trunk) 97 | 98 | return inventory_if64_params_neighbor(if_trunk, info_neighbor_parsed) 99 | 100 | 101 | def check_if64_trunk(item, params, parsed): 102 | info_if64_check = [] 103 | item = replace_if64_trunk_ifdescr(item) 104 | 105 | (if_all, info_neighbor_parsed, info_trunk, info_duplex) = parsed 106 | 107 | 108 | for interface in if_all: 109 | if interface == None: 110 | continue 111 | 112 | interface[1] = replace_if64_trunk_ifdescr(interface[1]) 113 | info_if64_check.append([None] + interface) 114 | 115 | if interface[1] == item: 116 | return check_if64_neighbor_interface(interface, if_all, info_neighbor_parsed, params, item, info_duplex) 117 | 118 | return check_if64_original(item, params, info_if64_check) 119 | 120 | 121 | 122 | 123 | check_info["if64_trunk"] = { 124 | # 'parse_function' : parse_if64, 125 | 'check_function' : check_if64_trunk, 126 | 'inventory_function' : inventory_if64_trunk, 127 | 'parse_function' : parse_if64_trunk, 128 | 'service_description' : "%s", 129 | 'has_perfdata' : True, 130 | 'includes' : [ 'if.include', 'if64.include', 'if_network.include' ], 131 | 'snmp_info' : [( ".1.3.6.1.2.1", if64_snmp_end_oids), 132 | oid_vlanTrunkPortDynamicStatus, 133 | oid_dot3adAggPortSelectedAggID, 134 | oid_dot1qVlanCurrentEntry, 135 | oid_lldpRemSysName, 136 | oid_lldpLocPortDesc, 137 | oid_cdpCacheDeviceId, 138 | oid_dot3StatsDuplexStatus, 139 | ], 140 | 'snmp_scan_function' : lambda oid: if64_scan_function(oid, False), 141 | 'group' : 'if', 142 | # 'node_info' : True, 143 | 'default_levels_variable' : 'if_default_levels', 144 | } 145 | -------------------------------------------------------------------------------- /if64_xx/inventory/switch_ipCidrRoute: -------------------------------------------------------------------------------- 1 | #!/usr/bpRouteProto_decode = {in/python 2 | # -*- encoding: utf-8; py-indent-offset: 4 -*- 3 | # +------------------------------------------------------------------+ 4 | # | ____ _ _ __ __ _ __ | 5 | # | / ___| |__ ___ ___| | __ | \/ | |/ / | 6 | # | | | | '_ \ / _ \/ __| |/ / | |\/| | ' / | 7 | # | | |___| | | | __/ (__| < | | | | . \ | 8 | # | \____|_| |_|\___|\___|_|\_\___|_| |_|_|\_\ | 9 | # | | 10 | # | Copyright Mathias Kettner 2013 mk@mathias-kettner.de | 11 | # +------------------------------------------------------------------+ 12 | # 13 | # This file is part of Check_MK. 14 | # The official homepage is at http://mathias-kettner.de/check_mk. 15 | # 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 | # ails. 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. 26 | 27 | 28 | # Author: Christian Burmeister 29 | 30 | def get_ipCidrRouteTable(ipCidrRouteTable): 31 | ipCidrRouteTable_decode = { 32 | "1":"ipCidrRouteDest", 33 | "2":"ipCidrRouteMask", 34 | "3":"ipCidrRouteTos", 35 | "4":"ipCidrRouteNextHop", 36 | "5":"ipCidrRouteIfIndex", 37 | "6":"ipCidrRouteType", 38 | "7":"ipCidrRouteProto", 39 | "8":"ipCidrRouteAge", 40 | "9":"ipCidrRouteInfo", 41 | "10":"ipCidrRouteNextHopAS", 42 | "11":"ipCidrRouteMetric1", 43 | "12":"ipCidrRouteMetric2", 44 | "13":"ipCidrRouteMetric3", 45 | "14":"ipCidrRouteMetric4", 46 | "15":"ipCidrRouteMetric5", 47 | "16":"ipCidrRouteStatus"} 48 | 49 | ipCidrRouteProto_decode = { 50 | "1":"other", 51 | "2":"local", 52 | "3":"netmgmt", 53 | "4":"icmp", 54 | "5":"egp", 55 | "6":"ggp", 56 | "7":"hello", 57 | "8":"rip", 58 | "9":"is-is", 59 | "10":"es-is", 60 | "11":"ciscoIgrp", 61 | "12":"bbnSpfIgp", 62 | "13":"ospf", 63 | "14":"bgp"} 64 | 65 | ipCidrRouteType_decode = { 66 | "1":"other", 67 | "2":"reject", 68 | "3":"local", 69 | "4":"remote"} 70 | 71 | 72 | 73 | ipCidrRouteTable_dict = {} 74 | for oid, value in ipCidrRouteTable: 75 | oid_type = oid.split(".")[0] 76 | oid_ip = ".".join(oid.split(".")[1:]) 77 | 78 | if oid_ip not in ipCidrRouteTable_dict.keys(): 79 | ipCidrRouteTable_dict[oid_ip] = {} 80 | 81 | if ipCidrRouteTable_decode[oid_type] == "ipCidrRouteMask": 82 | mask_cidr = str(sum([bin(int(x)).count('1') for x in value.split('.')])) 83 | ipCidrRouteTable_dict[oid_ip].update( {"ipCidrRouteMask_cidr": mask_cidr} ) 84 | ipCidrRouteTable_dict[oid_ip].update( {ipCidrRouteTable_decode[oid_type]:value} ) 85 | 86 | elif ipCidrRouteTable_decode[oid_type] == "ipCidrRouteProto": 87 | ipCidrRouteProto_desc = ipCidrRouteProto_decode[value] 88 | ipCidrRouteTable_dict[oid_ip].update( {ipCidrRouteTable_decode[oid_type]:ipCidrRouteProto_desc} ) 89 | elif ipCidrRouteTable_decode[oid_type] == "ipCidrRouteType": 90 | ipCidrRouteType_desc = ipCidrRouteType_decode[value] 91 | ipCidrRouteTable_dict[oid_ip].update( {ipCidrRouteTable_decode[oid_type]:ipCidrRouteType_desc} ) 92 | 93 | else: 94 | ipCidrRouteTable_dict[oid_ip].update( {ipCidrRouteTable_decode[oid_type]:value} ) 95 | 96 | return ipCidrRouteTable_dict 97 | 98 | 99 | def get_if_desc(port_info): 100 | ifDesc_dict = {} 101 | 102 | for interface in port_info: 103 | if_index = str(interface[0]) 104 | if_desc = interface[1] 105 | ifDesc_dict[if_index] = if_desc 106 | 107 | return ifDesc_dict 108 | 109 | 110 | 111 | 112 | def inv_switch_ipCidrRoute(info, params): 113 | port_info, ipCidrRouteTable = info 114 | ipCidrRouteTable_dict = get_ipCidrRouteTable(ipCidrRouteTable) 115 | ifDesc_dict = get_if_desc(port_info) 116 | 117 | 118 | routes = inv_tree("networking.switch_ipCidrRoute:") 119 | for route in ipCidrRouteTable_dict: 120 | routes.append({ 121 | "ipCidrRouteDest" : ipCidrRouteTable_dict[route]["ipCidrRouteDest"], 122 | "ipCidrRouteMask_cidr" : ipCidrRouteTable_dict[route]["ipCidrRouteMask_cidr"], 123 | "ipCidrRouteMask" : ipCidrRouteTable_dict[route]["ipCidrRouteMask"], 124 | "ipCidrRouteIfIndex" : ifDesc_dict.get(ipCidrRouteTable_dict[route]["ipCidrRouteIfIndex"], ""), 125 | "ipCidrRouteProto" : ipCidrRouteTable_dict[route]["ipCidrRouteProto"], 126 | "ipCidrRouteNextHop" : ipCidrRouteTable_dict[route]["ipCidrRouteNextHop"], 127 | "ipCidrRouteType" : ipCidrRouteTable_dict[route]["ipCidrRouteType"], 128 | }) 129 | 130 | 131 | 132 | inv_info['switch_ipCidrRoute'] = { 133 | "inv_function" : inv_switch_ipCidrRoute, 134 | # 'includes': [ 'if_network.include' ], 135 | 'snmp_info': [ 136 | ( ".1.3.6.1.2.1", [ 137 | "2.2.1.1", # ifIndex 138 | "2.2.1.2", # ifDescr 139 | "31.1.1.1.18", # ifAlias 140 | "2.2.1.3", # ifType 141 | ]), 142 | (".1.3.6.1.2.1.4.24", [OID_END, "4.1"]) 143 | ], 144 | 'snmp_scan_function': lambda oid: oid(".1.3.6.1.2.1.4.24.4.*") != None, 145 | } 146 | -------------------------------------------------------------------------------- /if64_xx/checks/if64_router: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | # -*- encoding: utf-8; py-indent-offset: 4 -*- 3 | # +------------------------------------------------------------------+ 4 | # | ____ _ _ __ __ _ __ | 5 | # | / ___| |__ ___ ___| | __ | \/ | |/ / | 6 | # | | | | '_ \ / _ \/ __| |/ / | |\/| | ' / | 7 | # | | |___| | | | __/ (__| < | | | | . \ | 8 | # | \____|_| |_|\___|\___|_|\_\___|_| |_|_|\_\ | 9 | # | | 10 | # | Copyright Mathias Kettner 2014 mk@mathias-kettner.de | 11 | # +------------------------------------------------------------------+ 12 | # 13 | # This file is part of Check_MK. 14 | # The official homepage is at http://mathias-kettner.de/check_mk. 15 | # 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 | # ails. 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. 26 | 27 | # Author: Christian Burmeister 28 | 29 | #-------------------------------------------------------------------------------------------- 30 | 31 | # Debug: cmk -vn --debug --checks if64_router -II Router 32 | 33 | 34 | 35 | def get_ifSpeed(interface, ifSpeed_list): 36 | 37 | ifIndex = interface[0] 38 | ifHighSpeed = interface[3] 39 | 40 | ifSpeed = None 41 | for interface in ifSpeed_list: 42 | if interface == None: continue 43 | if str(interface[0]) == str(ifIndex): 44 | ifSpeed = saveint(interface[1]) 45 | 46 | 47 | ninty_nine_mbits = 99 48 | if saveint(ifHighSpeed) > ninty_nine_mbits: 49 | return saveint(ifHighSpeed) * 1000000 50 | else: 51 | return ifSpeed 52 | 53 | 54 | def parse_if64_router(info): 55 | 56 | if_all, ipAdEntAddr, ipAdEntNetMask, ifSpeed_list = info 57 | ipAddress_dict = get_ip_address_raw(ipAdEntAddr, ipAdEntNetMask) 58 | 59 | parsed = (if_all, ipAddress_dict, ifSpeed_list) 60 | 61 | return parsed 62 | 63 | 64 | def check_if64_router(item, params, parsed): 65 | info_tmp = [] 66 | 67 | (if_all, ipAddress_dict, ifSpeed_list) = parsed 68 | 69 | 70 | for interface in if_all: 71 | if interface == None: continue 72 | if interface[1] == item: 73 | ips = ipAddress_dict.get(interface[0],[]) 74 | 75 | 76 | interface[3] = get_ifSpeed(interface, ifSpeed_list) 77 | 78 | if len(ips) > 0: 79 | 80 | wan_cross_ips = ["10.x."] 81 | lan_ips = ["10.x.", "10.x.", "10.x.", "10.x."] 82 | voip_ips = ["172.x", "172.x", "172.x"] 83 | 84 | 85 | 86 | desc = "UNKOWN-IP: " 87 | if list_find(ips[0], wan_cross_ips): 88 | desc = "WAN: " 89 | if list_find(ips[0], voip_ips): 90 | desc = "VoIP: " 91 | if list_find(ips[0], lan_ips): 92 | desc = "LAN: " 93 | 94 | if len(interface[18]) > 0: 95 | interface[18] = desc + str(ips) + " -- ifAlias: " + interface[18] 96 | else: 97 | interface[18] = desc + str(ips) 98 | 99 | 100 | info_tmp.append([None] + interface) 101 | 102 | 103 | # change crit traffic value, when set to 101% 104 | if "traffic" in params.keys(): 105 | if 101.0 == params.get("traffic")[1]: 106 | (warn, crit) = params.get("traffic") 107 | crit = 150.0 108 | params["traffic"] = (warn, crit) 109 | 110 | 111 | return check_if64_original_speed32(item, params, info_tmp) 112 | 113 | def inventory_if64_router(parsed): 114 | 115 | interface_wan_index = [] 116 | interface_lan_index = [] 117 | 118 | (if_all, ipAddress_dict, ifSpeed_list) = parsed 119 | 120 | 121 | for if_index in ipAddress_dict: 122 | if "10.x." in ipAddress_dict[if_index]: 123 | interface_wan_index.append(if_index) 124 | if not ("10.x." in ipAddress_dict[if_index] or "10.x." in ipAddress_dict[if_index]): 125 | interface_lan_index.append(if_index) 126 | 127 | 128 | 129 | info_temp = [] 130 | for interface in if_all: 131 | if interface == None: 132 | continue 133 | 134 | interface[3] = get_ifSpeed(interface, ifSpeed_list) 135 | 136 | if interface[0] in interface_wan_index: 137 | if interface[3] != "100000000" and interface[3] != "1000000000" and interface[18].find("Crosslink") == -1: 138 | info_temp.append([None] + interface) 139 | if interface[0] in interface_lan_index: 140 | if not interface[1].startswith("Loopback") and interface[18].find("Crosslink") == -1: 141 | info_temp.append([None] + interface) 142 | # if interface[2] in ["6", "62", "117"] and interface[4] == "1" and not interface[1].startswith("Backplane-") and not interface[1].startswith("Vlan"): 143 | # print interface[1], interface[2], interface[4], interface[18] 144 | # info_temp.append([None] + interface) 145 | 146 | 147 | 148 | 149 | return inventory_if64_original(info_temp) 150 | 151 | 152 | 153 | 154 | check_info["if64_router"] = { 155 | # 'parse_function' : parse_if64, 156 | 'check_function' : check_if64_router, 157 | 'inventory_function' : inventory_if64_router, 158 | 'parse_function' : parse_if64_router, 159 | 'service_description' : 'If_Router %s', 160 | 'has_perfdata' : True, 161 | 'includes' : [ 'if.include', 'if64.include', 'if_network.include' ], 162 | 'snmp_info' : [( ".1.3.6.1.2.1", if64_snmp_end_oids), 163 | oid_ipAdEntAddr, 164 | oid_ipAdEntNetMask, 165 | (".1.3.6.1.2.1.2.2.1", [OID_END,"5"]),#ifSpeed 166 | ], 167 | 'snmp_scan_function' : lambda oid: if64_scan_function(oid, False), 168 | 'group' : 'if', 169 | # 'node_info' : True, 170 | 'default_levels_variable' : 'if_default_levels', 171 | } 172 | --------------------------------------------------------------------------------