From 50f7e378fe02689b6d9f9142940900145da926c1 Mon Sep 17 00:00:00 2001 From: George Pochiscan Date: Thu, 27 Dec 2018 12:24:34 +0200 Subject: [PATCH] Added NSX and SRM Checks --- Check_NSX-1.4.mkp | Bin 0 -> 14646 bytes SRM-1.0.mkp | Bin 0 -> 4161 bytes local/share/check_mk/agents/special/agent_nsx | 1440 +++++++++++++++++ local/share/check_mk/agents/special/agent_srm | 173 ++ local/share/check_mk/checkman/nsx_backup | 14 + local/share/check_mk/checkman/nsx_components | 15 + local/share/check_mk/checkman/nsx_controllers | 19 + local/share/check_mk/checkman/nsx_cpu | 15 + local/share/check_mk/checkman/nsx_edges | 15 + local/share/check_mk/checkman/nsx_mem | 15 + local/share/check_mk/checkman/nsx_memory | 14 + local/share/check_mk/checkman/nsx_storage | 15 + .../check_mk/checkman/nsx_vcenter_connection | 14 + local/share/check_mk/checks/agent_nsx | 41 + local/share/check_mk/checks/agent_srm | 36 + local/share/check_mk/checks/check_nsx | 431 +++++ local/share/check_mk/checks/check_srm | 59 + 17 files changed, 2316 insertions(+) create mode 100644 Check_NSX-1.4.mkp create mode 100644 SRM-1.0.mkp create mode 100644 local/share/check_mk/agents/special/agent_nsx create mode 100644 local/share/check_mk/agents/special/agent_srm create mode 100644 local/share/check_mk/checkman/nsx_backup create mode 100644 local/share/check_mk/checkman/nsx_components create mode 100644 local/share/check_mk/checkman/nsx_controllers create mode 100644 local/share/check_mk/checkman/nsx_cpu create mode 100644 local/share/check_mk/checkman/nsx_edges create mode 100644 local/share/check_mk/checkman/nsx_mem create mode 100644 local/share/check_mk/checkman/nsx_memory create mode 100644 local/share/check_mk/checkman/nsx_storage create mode 100644 local/share/check_mk/checkman/nsx_vcenter_connection create mode 100644 local/share/check_mk/checks/agent_nsx create mode 100644 local/share/check_mk/checks/agent_srm create mode 100644 local/share/check_mk/checks/check_nsx create mode 100644 local/share/check_mk/checks/check_srm diff --git a/Check_NSX-1.4.mkp b/Check_NSX-1.4.mkp new file mode 100644 index 0000000000000000000000000000000000000000..cc1d149602d33513e36c846c92bd55538a352258 GIT binary patch literal 14646 zcmb7rV{j%wyJc+KoY9dXas=(uBR?b1N+SShPA(_MCR|Mhjg>~S zz&O@PDewF4`lWqXzDV1vd6+;;DIn07huO1=7tzH~=j+1jE893VCW z@MUH$_l6uJI+~RklHyR^BH~#d5H^j4_!fE^<#dPXs zp#mk&@aH?^LpFHh#ItAIq48lsoENQcR}{zmjS-yLTe%5OEWvqSxcg2cQpcP^BySx>|KDo(KHLp=oazW1AHwPl4GNXkM1R4XZw zdIQqm_fCz-;TF4dCl1}-^$fiNiou9i-61avIha1)AGI31J+uic7(72MmF-arVR+i~CGr zL@q3U7j}@Zxjw->d=T!uDU0W)Ok0F8=pRv%bX&fSkRTV^9d^cMmjO&2M z8euQw`&r-|DV#>??tb{oCU(z5C&z`}d@W(hcumc0NQMXz0!_ zg{h1gIq(VC5@*-R&QZMNgOGBy*$=@L{@Xnsz3eSO4>pO2p z^WV#x-7e1VZvO7xPD)hRDU5b`EH);VA*jO(o*hOVZudw$!+^COZZh;QENU)SsW=^K z-1%`79Ip9Cnhhb!{F>|*x4}OXAPG;3b4NAQSO+`}0p8Eor-z75PpC`F4c)X&aVDM^ zvL;NIRkYj<;ZL+yl^}&Wd2*-8@I!*^BZ&tER+|c#V_gmX%3!Al{Dqc(iC33O3zI8j zy1gsd3r*0@?}DzkUR55`Xs2+UD(AXuA`~Q2aoGIWoy#xm?dxH20^P=u*4H9?{MSg2 zwB-Y@x?H6*yAWuK`vWC&K*CR+dt#lA60F8DuRAdzHE`cj z$Zf+OB-YNzeg5F9r@RY9Jv-5{Ok&W<6VOwmQej~kN)a-pvBV!SW2ZeQU0x=NZo68g z$n(K>h8zCmc$dly;#ztjj1f+i8Au?!%^mc@;rMC?b$#$|RDE}T25MjRs!LjlKL~0| z8a)SSBt7Rf0gJz05H|w&t$@-WiW>p57C_;c&AvyWL~ke@t0@w8`csry_v<&lPmraY zlTOSgw$QtX>5*xXP-clwrid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QKK`X`{q>f{0N{qh=M*7daNfsv;EkUK zx#A$Tl7!E=OnvgugaF8(x(jL8lWwKja?AcQxmoiHIDzJ zP}yYV+bk&ZR?d<%F4sT{@? zLU2Y!znJlB5*nKw?L9@Jpuz^iG(>gmIfJE&1c~XM_XkiC28Z_9quxg{dkuM$7mEJ+ z$#Aev{3oFf8g;b+K$G8a2|X$Zi`VgUAJZu$>p*n1HC(~JVAb^IvOKo{|Jig6H0aP| zX^z8KJZ66Ivp&+3l2g>-crJ4$0TtE%l*TfdrspZDi;sf<`%vDh@saCmwpwrs5kcg< zP4N(d`D-_`5|}M7ehRd2U9>CscJOG5UjojeiXi4)`%nhx0kh6Nf&>n3EWpt_MBW}I z&2>rnopkrRF=~uJFAmg*Lct-Xyw7H*GT>t4UWYy5rvu4R>^PUk&!cg?P(ZMd8d@LI zvTP5%WZ9-Bz6(`Z?@3tFkU$iUWRk0Qq=T}8}n!GS2S)E^Pg|*qTe)PO?f}wSr)nF!jNviQ;LcF xG&Q2|eF}Tf(!YIWzYa^IKTZAALT^JpWEBqoXS$c$bT}Zf$cPmm2s0SSe*xVg_M-p* literal 0 HcmV?d00001 diff --git a/SRM-1.0.mkp b/SRM-1.0.mkp new file mode 100644 index 0000000000000000000000000000000000000000..804c32b7e34c178552db3f002118b8f734686572 GIT binary patch literal 4161 zcma);Ra6rI!-io>BY6q#j)*Hy`yq{9 z9=mUkH8e$?dPVp_i7TIfTJZ^)P#R+SKV$;QA!JX!fSIjgUSRzFx&d+(x{3cnz2yM8 zOj7h$7nQyC2RFL<2&C(H$v2;Tt9*=ZDXh$iNow}|u9a-wm#1utqvb@|8twPem>4XW zn>G$9;wq5*Ryuov(SORwYb0+}9l;kV3V3RX68(l(ph%yn-dv0>jIY>9&obo>8P2*X z7~4bB5zSZn*P@!+c{k`zq=U?R%-QEaxN&27)Id2) za!1Y901~XfHoB9daPv}ACLl?uF8xhWc^BgE`(gox=1Th%O$3Eoo9?i`_TV2V**)s{ zaEWTW+HxR#>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0;&ls*4j3oqT6I`JJE+)wL{9CFZlhkHn#%6%Q+ik|n`m7~O z(nG~>f7F zYcld@`=XcQue%kvO1B(f2T{!qx?<~*;@e@zgrFBRRz4C5N;WSkKET_s?AY|g!L`${ zhHlxW0lYoXdj-vn!^2JVC%S>K>>") + xml_instance = query_edges() + if xml_instance.iter('edgeSummary'): + tbody = xml_instance.iter('edgeSummary') + for child in tbody: + name=child.find('name').text + edgeid=child.find('id').text + edgestatus=child.find('edgeStatus').text + edgestate=child.find('state').text + edgetype=child.find('edgeType').text + output("%s\t%s\t%s\t%s\t%s" % (name, edgeid, edgestatus, edgestate, edgetype)) + +def process_controller_info(): + output("<<>>") + xml_instance = query_controllers() + if xml_instance.iter('controller'): + tbody = xml_instance.iter('controller') + for child in tbody: + name=child.find('name').text + controllerid=child.find('id').text + controllerstatus=child.find('status').text + output("%s\t%s\t%s" % (name, controllerid, controllerstatus)) + +def process_nsx_components_info(): + output("<<>>") + xml_instance = query_nsx_components() + if xml_instance.iter('component'): + tbody = xml_instance.iter('component') + for child in tbody: + component_name=child.find('name').text + component_id=child.find('componentId').text + component_status=child.find('status').text + output("%s\t%s\t%s" % (component_name, component_id, component_status)) + +def process_nsx_backup_info(): + output("<<>>") + xml_instance = query_nsx_backup() + if xml_instance.iter('backupFileProperties'): + tbody = xml_instance.iter('backupFileProperties') + for child in tbody: + backup_file = child.find('fileName').text + backup_size = child.find('fileSize').text + backup_creationtime=child.find('creationTime').text + output("%s\t%s\t%s" % (backup_file, backup_size, backup_creationtime)) + +def process_nsx_cpu(): + output("<<>>") + xml_instance = query_nsx_cpu() + if xml_instance.iter('cpuinfo'): + tbody = xml_instance.iter('cpuInfo') + for child in tbody: + totalNoOfCPUs = child.find('totalNoOfCPUs').text + capacity = child.find('capacity').text + usedCapacity=child.find('usedCapacity').text + freeCapacity = child.find('freeCapacity').text + usedPercentage = child.find('usedPercentage').text + output("totalNoOfCPUs %s\ncapacity %s\nusedCapacity %s\nfreeCapacity %s\nusedPercentage %s" % (totalNoOfCPUs, capacity, usedCapacity, usedCapacity, usedPercentage )) + +def process_nsx_memory(): + output("<<>>") + xml_instance = query_nsx_memory() + if xml_instance.iter('memInfo'): + tbody = xml_instance.iter('memInfo') + for child in tbody: + totalMemory = child.find('totalMemory').text + usedMemory = child.find('usedMemory').text + freeMemory=child.find('freeMemory').text + usedPercentage = child.find('usedPercentage').text + output("TotalMem %s\nUsedMemory %s\nFreeMemory %s\nUsedPercentage %s" % (totalMemory, usedMemory, freeMemory, usedPercentage)) + +def process_nsx_uptime(): + output("<<>>") + seconds = 0 + uptime=query_nsx_uptime() + raw_text=uptime.split() + uptime=[] + for word in raw_text: + element = re.sub(',','',word,count =1) + uptime.append(element) + if "year" in uptime: + seconds = int(31536000) * int(uptime[int(uptime.index("year"))-1]) + if "days" in uptime: + seconds += int(86400) * int(uptime[int(uptime.index("days"))-1]) + if "hours" in uptime: + seconds += int(3600) * int(uptime[int(uptime.index("hours"))-1]) + if "minutes" in uptime: + seconds += int(60) * int(uptime[int(uptime.index("minutes"))-1]) + output(str(seconds)) + +def process_nsx_vcenter_connection(): + output("<<>>") + xml_instance = query_nsx_vcenter_connection() + if xml_instance.iter('vcConfigStatus'): + tbody = xml_instance.iter('vcConfigStatus') + for child in tbody: + connected = child.find('connected').text + output("vCenterConnection %s" % (connected)) + +def process_nsx_storage_info(): + output("<<>>") + xml_instance = query_nsx_storage_info() + if xml_instance.iter('storageInfo'): + tbody = xml_instance.iter('storageInfo') + for child in tbody: + totalStorage = child.find('totalStorage').text + usedStorage = child.find('usedStorage').text + freeStorage=child.find('freeStorage').text + usedPercentage = child.find('usedPercentage').text + output("TotalStorage %s\nUsedStorage %s\nFreeStorage %s\nUsedPercentage %s" % (totalStorage, usedStorage, freeStorage, usedPercentage)) + +def process_nsx_resource_info(): + output("<<>>") + for i in range(len(resources)): + xml_instance = query_nsx_resources(resources[i]) + if xml_instance.iter('resourceStatuses'): + tbody = xml_instance.iter('resourceStatus') + for child in tbody: + hostRebootRequired = child.find('hostRebootRequired').text + output("%s\thostRebootRequired\t%s" % ( resources[i], hostRebootRequired) ) + feature_statuses = child.iter('nwFabricFeatureStatus') + for feature in feature_statuses: + featureId = feature.find('featureId').text + featurestatus = feature.find('status').text + output("%s\t%s\t%s" % (resources[i], featureId, featurestatus)) + +def query_edges(): + if opt_demo: + raw_xml = re.sub(' xml="[^"]+"', '', edge_status, count=1) + return ET.fromstring(edge_status) + url = "https://%(address)s/api/4.0/edges" % args_dict + return query(url) + +def query_controllers(): + if opt_demo: + raw_xml = re.sub(' xml="[^"]+"', '', controllers, count=1) + return ET.fromstring(controllers) + url = "https://%(address)s/api/2.0/vdn/controller" % args_dict + return query(url) + +def query_nsx_components(): + if opt_demo: + raw_xml = re.sub(' xml="[^"]+"', '', nsx_components, count=1) + return ET.fromstring(nsx_components) + url = "https://%(address)s/api/1.0/appliance-management/summary/components" % args_dict + return query(url) + +def query_nsx_backup(): + if opt_demo: + raw_xml = re.sub(' xml="[^"]+"', '', backup, count=1) + return ET.fromstring(backup) + url = "https://%(address)s/api/1.0/appliance-management/backuprestore/backups" % args_dict + return query(url) + +def query_nsx_memory(): + if opt_demo: + raw_xml = re.sub(' xml="[^"]+"', '', nsx_memory, count=1) + return ET.fromstring(nsx_memory) + url = "https://%(address)s/api/1.0/appliance-management/system/meminfo" % args_dict + return query(url) + +def query_nsx_cpu(): + if opt_demo: + raw_xml = re.sub(' xml="[^"]+"', '', nsx_cpu, count=1) + return ET.fromstring(nsx_cpu) + url = "https://%(address)s/api/1.0/appliance-management/system/cpuinfo" % args_dict + return query(url) + +def query_nsx_uptime(): + if opt_demo: + return nsx_uptime + url = "https://%(address)s/api/1.0/appliance-management/system/uptime" % args_dict + return query(url) + +def query_nsx_vcenter_connection(): + if opt_demo: + raw_xml = re.sub(' xml="[^"]+"', '', nsx_vcenter_connection, count=1) + return ET.fromstring(nsx_vcenter_connection) + url = "https://%(address)s/api/2.0/services/vcconfig/status" % args_dict + return query(url) + +def query_nsx_storage_info(): + if opt_demo: + raw_xml = re.sub(' xml="[^"]+"', '', nsx_storage_info, count=1) + return ET.fromstring(nsx_storage_info) + url = "https://%(address)s/api/1.0/appliance-management/system/storageinfo" % args_dict + return query(url) + +def query_nsx_resources(resource): + if opt_demo: + raw_xml = re.sub(' xml="[^"]+"', '', nsx_resource_domain_c7, count=1) + return ET.fromstring(nsx_resource_domain_c7) + uri = "api/2.0/nwfabric/status?resource=%s" % resource + url_1 = "https://%(address)s/" % args_dict + url = "%s%s" % (url_1, uri) + return query(url) + +def main(): + try: + # Get edges info + process_edge_info() + # Get Controllers info + process_controller_info() + # Get NSX Components + process_nsx_components_info() + # Get NSX Backup + process_nsx_backup_info() + # Get NSX Memory Usage + process_nsx_memory() + # Get NSX CPU Usage + process_nsx_cpu() + # Get Uptime + process_nsx_uptime() + # Get vCenter Conneciton + process_nsx_vcenter_connection() + # Get Storage info + process_nsx_storage_info() + # get Resources info + process_nsx_resource_info() + sys.stdout.write("\n".join(output_lines) + "\n") + except Exception, e: + sys.stderr.write("Connection error: %s" % e) + sys.exit(1) + +edge_status = \ +""" + + + + 256 + 0 + 5 + true + id + + + edge-1 + Edge + 42224242-869B-7AA0-5855-FD2C6ADF7451 + feec058e-c396-4c37-96d2-a7169e92622a + 17 + + Edge + + clj01psc01 + + + false + 0 + false + edge-1 + deployed + gatewayServices + datacenter-2 + clj01-m01dc + default + 4.0 + GREEN + 1 + + 6.3.4 + 6.3.4-6795877 + large + clj01psc01.test + 2 + 0 + vm-42 + clj01psc01-0 + host-21 + clj01m01esx03.test + resgroup-8 + Resources + datastore-12 + clj01-m01-ds01 + 1528198369821 + msgbus-msgbus + false + + false + + Change Log Level + Add Edge Appliance + Delete Edge Appliance + Edit Edge Appliance + Edit CLI Credentials + Change FIPS mode + Change edge appliance size + Force Sync + Redeploy Edge + Change Edge Appliance Core Dump Configuration + Enable hypervisorAssist + Edit Highavailability + Edit Dns + Edit Syslog + Edit Automatic Rule Generation Settings + Disable SSH + Download Edge TechSupport Logs + + + + edge-70c025e2-aae0-4801-b0dd-27c07cb6d9ae + Edge + 42220EB5-0574-A0A4-031B-1DA658998F9E + 8a3ecfae-a3dd-4558-91b6-7430419e174b + 8 + + Edge + + uni01w01dlrbuc01-X_DMZA + + + true + 0 + false + edge-70c025e2-aae0-4801-b0dd-27c07cb6d9ae + active + distributedRouter + default + 4.0 + + jobdata-63834 + SUCCESS + + GREY + 2 + + 6.3.4 + compact + NSX-edge-70c025e2-aae0-4801-b0dd-27c07cb6d9ae + 0 + true + + + + edge-2 + Edge + 42224242-869B-7AA0-5855-FD2C6ADF7451 + feec058e-c396-4c37-96d2-a7169e92622a + 21 + + Edge + + clj01m01esg01 + + + false + 0 + false + edge-2 + deployed + gatewayServices + datacenter-2 + clj01-m01dc + default + 4.0 + GREEN + 3 + + 6.3.4 + 6.3.4-6795877 + large + clj01m01esg01.test + 1 + 0 + vm-46 + clj01m01esg01-0 + host-10 + clj01m01esx01.test + resgroup-8 + Resources + datastore-12 + clj01-m01-ds01 + 1528198355972 + msgbus + false + + false + + Change Log Level + Add Edge Appliance + Delete Edge Appliance + Edit Edge Appliance + Edit CLI Credentials + Change FIPS mode + Change edge appliance size + Force Sync + Redeploy Edge + Change Edge Appliance Core Dump Configuration + Enable hypervisorAssist + Edit Highavailability + Edit Dns + Edit Syslog + Edit Automatic Rule Generation Settings + Disable SSH + Download Edge TechSupport Logs + + + + edge-3 + Edge + 42224242-869B-7AA0-5855-FD2C6ADF7451 + feec058e-c396-4c37-96d2-a7169e92622a + 15 + + Edge + + clj01m01esg02 + + + false + 0 + false + edge-3 + deployed + gatewayServices + datacenter-2 + clj01-m01dc + default + 4.0 + GREEN + 3 + + 6.3.4 + 6.3.4-6795877 + large + clj01m01esg02.test + 1 + 0 + vm-47 + clj01m01esg02-0 + host-20 + clj01m01esx02.test + resgroup-8 + Resources + datastore-12 + clj01-m01-ds01 + 1528198356967 + msgbus + false + + false + + Change Log Level + Add Edge Appliance + Delete Edge Appliance + Edit Edge Appliance + Edit CLI Credentials + Change FIPS mode + Change edge appliance size + Force Sync + Redeploy Edge + Change Edge Appliance Core Dump Configuration + Enable hypervisorAssist + Edit Highavailability + Edit Dns + Edit Syslog + Edit Automatic Rule Generation Settings + Disable SSH + Download Edge TechSupport Logs + + + + edge-4 + Edge + 42224242-869B-7AA0-5855-FD2C6ADF7451 + feec058e-c396-4c37-96d2-a7169e92622a + 21 + + Edge + + clj01m01lb01 + + + false + 0 + false + edge-4 + deployed + gatewayServices + datacenter-2 + clj01-m01dc + default + 4.0 + + jobdata-25970 + SUCCESS + + GREEN + 2 + + 6.3.4 + 6.3.4-6795877 + large + clj01m01lb01.test + 2 + 1 + vm-68 + clj01m01lb01-1 + host-20 + clj01m01esx02.test + resgroup-8 + Resources + datastore-11 + clj01-m01-ds03 + 1528198325165 + msgbus-msgbus + false + + false + + Change Log Level + Add Edge Appliance + Delete Edge Appliance + Edit Edge Appliance + Edit CLI Credentials + Change FIPS mode + Change edge appliance size + Force Sync + Redeploy Edge + Change Edge Appliance Core Dump Configuration + Enable hypervisorAssist + Edit Highavailability + Edit Dns + Edit Syslog + Edit Automatic Rule Generation Settings + Disable SSH + Download Edge TechSupport Logs + + + + edge-2c8970e8-14f4-40f1-a684-9971976b730e + Edge + 42224242-869B-7AA0-5855-FD2C6ADF7451 + feec058e-c396-4c37-96d2-a7169e92622a + 13 + + Edge + + buc01m01udlr01 + + + true + 0 + false + edge-2c8970e8-14f4-40f1-a684-9971976b730e + deployed + distributedRouter + default + 4.0 + + jobdata-25968 + SUCCESS + + GREEN + 4 + + 6.3.4 + 6.3.4-6795877 + compact + NSX-edge-2c8970e8-14f4-40f1-a684-9971976b730e + 2 + 0 + vm-303 + edge-2c8970e8-14f4-40f1-a684-9971976b730e-0-buc01m01udlr01 + host-21 + clj01m01esx03.test + resgroup-8 + Resources + datastore-12 + clj01-m01-ds01 + 1528198329144 + msgbus-msgbus + false + + false + + Change Log Level + Add Edge Appliance + Delete Edge Appliance + Edit Edge Appliance + Edit CLI Credentials + Change FIPS mode + Force Sync + Redeploy Edge + Change Edge Appliance Core Dump Configuration + Edit Highavailability + Edit Dns + Edit Syslog + Disable SSH + Download Edge TechSupport Logs + + 30000 + default+edge-2c8970e8-14f4-40f1-a684-9971976b730e + ffcbdd18-6397-489c-a94f-19761b811d81 + + + TransportZone + universalvdnscope + + + + +""" + + +controllers = \ +""" + + + Controller + 0 + clj01m01nsxc01 + clj01m01nsxc01 + + false + 0 + controller-47 + 172.19.133.51 + RUNNING + NOT_STARTED + 6.3.7087288 + true + + vm-301 + VirtualMachine + 42224242-869B-7AA0-5855-FD2C6ADF7451 + feec058e-c396-4c37-96d2-a7169e92622a + 7 + + VirtualMachine + + NSX_Controller_70ef8503-f49b-478f-96bb-08cd01bd3558 + + domain-c7 + ClusterComputeResource + clj01-m01-mgmt01 + + + + false + 0 + + + host-21 + HostSystem + 42224242-869B-7AA0-5855-FD2C6ADF7451 + feec058e-c396-4c37-96d2-a7169e92622a + 3016 + + HostSystem + + clj01m01esx03.test + + domain-c7 + ClusterComputeResource + clj01-m01-mgmt01 + + + + false + 0 + + + resgroup-8 + ResourcePool + 42224242-869B-7AA0-5855-FD2C6ADF7451 + feec058e-c396-4c37-96d2-a7169e92622a + 153 + + ResourcePool + + Resources + + domain-c7 + ClusterComputeResource + clj01-m01-mgmt01 + + + + false + 0 + + + domain-c7 + ClusterComputeResource + 42224242-869B-7AA0-5855-FD2C6ADF7451 + feec058e-c396-4c37-96d2-a7169e92622a + 9 + + ClusterComputeResource + + clj01-m01-mgmt01 + + datacenter-2 + Datacenter + clj01-m01dc + + + + false + 0 + + 42224242-869B-7AA0-5855-FD2C6ADF7451 + false + + datastore-12 + Datastore + 42224242-869B-7AA0-5855-FD2C6ADF7451 + feec058e-c396-4c37-96d2-a7169e92622a + 2 + + Datastore + + clj01-m01-ds01 + + + false + 0 + + + + controller-47 + 172.19.133.51 + 172.19.133.52 + true + SUCCESS + 1528198790434 + + + FALSE + POWERED_ON + + + Controller + 0 + clj01m01nsxc01 + clj01m01nsxc01 + + false + 0 + controller-48 + 172.19.133.52 + RUNNING + NOT_STARTED + 6.3.7087288 + true + + vm-302 + VirtualMachine + 42224242-869B-7AA0-5855-FD2C6ADF7451 + feec058e-c396-4c37-96d2-a7169e92622a + 7 + + VirtualMachine + + NSX_Controller_cdecc3f5-11c5-461f-b6a8-e980dcc83cc4 + + domain-c7 + ClusterComputeResource + clj01-m01-mgmt01 + + + + false + 0 + + + host-21 + HostSystem + 42224242-869B-7AA0-5855-FD2C6ADF7451 + feec058e-c396-4c37-96d2-a7169e92622a + 3016 + + HostSystem + + clj01m01esx03.test + + domain-c7 + ClusterComputeResource + clj01-m01-mgmt01 + + + + false + 0 + + + resgroup-8 + ResourcePool + 42224242-869B-7AA0-5855-FD2C6ADF7451 + feec058e-c396-4c37-96d2-a7169e92622a + 153 + + ResourcePool + + Resources + + domain-c7 + ClusterComputeResource + clj01-m01-mgmt01 + + + + false + 0 + + + domain-c7 + ClusterComputeResource + 42224242-869B-7AA0-5855-FD2C6ADF7451 + feec058e-c396-4c37-96d2-a7169e92622a + 9 + + ClusterComputeResource + + clj01-m01-mgmt01 + + datacenter-2 + Datacenter + clj01-m01dc + + + + false + 0 + + 42224242-869B-7AA0-5855-FD2C6ADF7451 + false + + datastore-12 + Datastore + 42224242-869B-7AA0-5855-FD2C6ADF7451 + feec058e-c396-4c37-96d2-a7169e92622a + 2 + + Datastore + + clj01-m01-ds01 + + + false + 0 + + + + controller-48 + 172.19.133.52 + 172.19.133.51 + true + SUCCESS + 1528198790484 + + + FALSE + POWERED_ON + +""" + +nsx_components = \ +""" + + + + COMMON + + + VPOSTGRES + vPostgres + vPostgres - Database service + RUNNING + true + false + + NSX + + COMMON + + + RABBITMQ + RabbitMQ + RabbitMQ - Messaging service + RUNNING + true + false + + NSX + + COMMON + + + + + NSXGRP + + + NSXREPLICATOR + NSX Replicator + NSX Replicator + RUNNING + true + false + + NSX + + + NSXGRP + + + NSX + NSX Manager + NSX Manager + RUNNING + true + true + + VPOSTGRES + RABBITMQ + + + NSXREPLICATOR + + NSXGRP + + 6 + 3 + 4 + 7087695 + + + + + + SYSTEM + + + SSH + SSH Service + Secure Shell + RUNNING + true + false + + SYSTEM + + + + +""" + + +backup = \ +""" + + + clj01m01nsx01_00_00_00_Tue05Jun2018 + 3614752 + 1528156800000 + + + clj01m01nsx01_00_00_00_Sun03Jun2018 + 3553312 + 1527984000000 + + + clj01m01nsx01_00_00_00_Sat02Jun2018 + 3532832 + 1527897600000 + + + clj01m01nsx01_00_00_00_Thu31May2018 + 3491872 + 1527724800000 + + + clj01m01nsx01_00_00_00_Wed30May2018 + 3471392 + 1527638400000 + + + clj01m01nsx01_00_00_00_Tue29May2018 + 3450912 + 1527552000000 + + + clj01m01nsx01_00_00_00_Mon28May2018 + 3430432 + 1527465600000 + + + clj01m01nsx01_00_00_00_Sun27May2018 + 3420192 + 1527379200000 + + + clj01m01nsx01_00_00_00_Sat26May2018 + 3399712 + 1527292800000 + + + clj01m01nsx01_00_00_00_Fri25May2018 + 3389472 + 1527206400000 + + + clj01m01nsx01_00_00_00_Thu24May2018 + 3328032 + 1527120000000 + + + clj01m01nsx01_00_00_00_Tue22May2018 + 3266592 + 1526947200000 + + + clj01m01nsx01_00_00_00_Mon21May2018 + 3246112 + 1526860800000 + + + clj01m01nsx01_00_00_00_Sun20May2018 + 3225632 + 1526774400000 + + + clj01m01nsx01_00_00_00_Sat19May2018 + 3205152 + 1526688000000 + + + clj01m01nsx01_00_00_00_Fri30Mar2018 + 2109472 + 1522368000000 + + + clj01m01nsx01_00_00_00_Fri18May2018 + 3184672 + 1526601600000 + + + clj01m01nsx01_00_00_00_Thu29Mar2018 + 2088992 + 1522281600000 + + + clj01m01nsx01_00_00_00_Thu17May2018 + 3153952 + 1526515200000 + + + clj01m01nsx01_00_00_00_Wed28Mar2018 + 2058272 + 1522195200000 + + + clj01m01nsx01_00_00_00_Wed16May2018 + 3143712 + 1526428800000 + + + clj01m01nsx01_00_00_00_Tue27Mar2018 + 2037792 + 1522108800000 + + + clj01m01nsx01_23_59_58_Mon14May2018 + 3143712 + 1526342398000 + + + clj01m01nsx01_00_00_00_Mon26Mar2018 + 2017312 + 1522022400000 + + + clj01m01nsx01_00_00_00_Mon14May2018 + 3143712 + 1526256000000 + + + clj01m01nsx01_00_00_00_Sun25Mar2018 + 1996832 + 1521936000000 + + + clj01m01nsx01_00_00_00_Sun13May2018 + 3112992 + 1526169600000 + + + clj01m01nsx01_00_00_00_Sat24Mar2018 + 1976352 + 1521849600000 + + + clj01m01nsx01_00_00_00_Sat12May2018 + 3133472 + 1526083200000 + + + clj01m01nsx01_00_00_00_Fri23Mar2018 + 1996832 + 1521763200000 + + + clj01m01nsx01_00_00_00_Thu22Mar2018 + 1914912 + 1521676800000 + + + clj01m01nsx01_00_00_00_Thu10May2018 + 3072032 + 1525910400000 + + + clj01m01nsx01_00_00_00_Wed21Mar2018 + 1822752 + 1521590400000 + + + clj01m01nsx01_00_00_00_Wed09May2018 + 3051552 + 1525824000000 + + + clj01m01nsx01_00_00_00_Tue20Mar2018 + 1740832 + 1521504000000 + + + clj01m01nsx01_00_00_00_Tue08May2018 + 2990112 + 1525737600000 + + + clj01m01nsx01_00_00_00_Mon19Mar2018 + 1658912 + 1521417600000 + + + clj01m01nsx01_00_00_00_Mon07May2018 + 2928672 + 1525651200000 + + + clj01m01nsx01_00_00_00_Sun18Mar2018 + 1576992 + 1521331200000 + + + clj01m01nsx01_00_00_00_Sun06May2018 + 2908192 + 1525564800000 + + + clj01m01nsx01_00_00_00_Sat17Mar2018 + 1495072 + 1521244800000 + + + clj01m01nsx01_00_00_00_Sat05May2018 + 2887712 + 1525478400000 + + + clj01m01nsx01_00_00_00_Fri16Mar2018 + 1402912 + 1521158400000 + + + clj01m01nsx01_00_00_00_Fri04May2018 + 2867232 + 1525392000000 + + + clj01m01nsx01_00_00_00_Thu15Mar2018 + 1320992 + 1521072000000 + + + clj01m01nsx01_00_00_00_Wed14Mar2018 + 1228832 + 1520985600000 + + + clj01m01nsx01_00_00_00_Tue13Mar2018 + 1146912 + 1520899200000 + + + clj01m01nsx01_00_00_00_Mon12Mar2018 + 1064992 + 1520812800000 + + + clj01m01nsx01_00_00_00_Sun11Mar2018 + 993312 + 1520726400000 + + + clj01m01nsx01_23_59_58_Fri09Mar2018 + 911392 + 1520639998000 + + + clj01m01nsx01_23_59_58_Thu08Mar2018 + 778272 + 1520553598000 + + + clj01m01nsx01_00_00_00_Thu08Mar2018 + 665632 + 1520467200000 + + + clj01m01nsx01_08_21_01_Wed07Mar2018 + 532512 + 1520410861000 + + + clj01m01nsx01_00_00_00_Mon04Jun2018 + 3573792 + 1528070400000 + + + clj01m01nsx01_00_00_00_Fri01Jun2018 + 3512352 + 1527811200000 + +""" + +nsx_memory = \ +""" + + 16025 MB + 5233 MB + 10792 MB + 33 +""" + +nsx_cpu = \ +""" + + 4 + 2196 MHZ + 17 MHZ + 2179 MHZ + 1 +""" + +nsx_vcenter_connection = \ +""" + + true + 1528202184756 +""" + + +nsx_storage_info = \ +""" + + 81G + 4.1G + 77G + 5 +""" + + +nsx_uptime = "7 days, 7 minutes" + +nsx_resource_domain_c7 = \ +""" + + + + domain-c7 + ClusterComputeResource + 4220F930-D7C1-D623-88EC-FB40297018CF + b473ae67-65db-48cb-ac8d-069e43df1c52 + 12 + + ClusterComputeResource + + buc01-m01-mgmt01 + + datacenter-2 + Datacenter + buc01-m01dc + + + + false + 0 + + false + + com.vmware.vshield.vsm.nwfabric.hostPrep + 6.3.4.7087695 + false + GREEN + true + true + false + + + com.vmware.vshield.vsm.vdr_mon + 5.5 + false + UNKNOWN + false + true + false + + + com.vmware.vshield.vsm.vxlan + 5.5 + false + GREEN + true + true + false + + + com.vmware.vshield.vsm.messagingInfra + false + GREEN + true + true + false + + + com.vmware.vshield.firewall + 5.5 + false + GREEN + + true + true + false + + +""" + +if __name__ == "__main__": + main() + diff --git a/local/share/check_mk/agents/special/agent_srm b/local/share/check_mk/agents/special/agent_srm new file mode 100644 index 0000000..054be00 --- /dev/null +++ b/local/share/check_mk/agents/special/agent_srm @@ -0,0 +1,173 @@ +#!/usr/bin/env python +# -*- encoding: utf-8; py-indent-offset: 4 -*- +# +------------------------------------------------------------------+ +# | ____ _ _ __ __ _ __ | +# | / ___| |__ ___ ___| | __ | \/ | |/ / | +# | | | | '_ \ / _ \/ __| |/ / | |\/| | ' / | +# | | |___| | | | __/ (__| < | | | | . \ | +# | \____|_| |_|\___|\___|_|\_\___|_| |_|_|\_\ | +# | | +# | Copyright Mathias Kettner 2018 mk@mathias-kettner.de | +# +------------------------------------------------------------------+ +# +# This file is part of Check_MK. +# The official homepage is at http://mathias-kettner.de/check_mk. +# +# check_mk is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by +# the Free Software Foundation in version 2. check_mk is distributed +# in the hope that it will be useful, but WITHOUT ANY WARRANTY; with- +# out even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. See the GNU General Public License for more de- +# tails. You should have received a copy of the GNU General Public +# License along with GNU Make; see the file COPYING. If not, write +# to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, +# Boston, MA 02110-1301 USA. + +import re +import sys, getopt +import requests +from requests.packages.urllib3.exceptions import InsecureRequestWarning # pylint: disable=import-error +from HTMLParser import HTMLParser + +def usage(): + sys.stderr.write("""Check_MK VMWare SRM + +USAGE: agent_srm [OPTIONS] HOST + +OPTIONS: + -h, --help Show this help message and exit + --address Host address + --no-cert-check Disable certificate check +""") + sys.exit(1) + +short_options = "h" +long_options = ["help", "address=", "demo", "no-cert-check"] + +try: + opts, args = getopt.getopt(sys.argv[1:], short_options, long_options) +except getopt.GetoptError, err: + sys.stderr.write("%s\n" % err) + sys.exit(1) + + +opt_demo = False +opt_cert = True +args_dict = {} +resources = [] + +for o,a in opts: + if o in [ "--address" ]: + args_dict["address"] = a + elif o in [ "--demo" ]: + opt_demo = True + elif o in [ "--no-cert-check" ]: + opt_cert = False + elif o in [ "-h", "--help" ]: + usage() + +class HTMLTableParser(HTMLParser): + def __init__( + self, + decode_html_entities=False, + data_separator=' ', + ): + + HTMLParser.__init__(self) + + self._parse_html_entities = decode_html_entities + self._data_separator = data_separator + + self._in_td = False + self._in_th = False + self._current_table = [] + self._current_row = [] + self._current_cell = [] + self.tables = [] + + def handle_starttag(self, tag, attrs): + if tag == 'td': + self._in_td = True + if tag == 'th': + self._in_th = True + + def handle_data(self, data): + if self._in_td or self._in_th: + self._current_cell.append(data.strip()) + + def handle_charref(self, name): + + if self._parse_html_entities: + self.handle_data(self.unescape('&#{};'.format(name))) + + def handle_endtag(self, tag): + if tag == 'td': + self._in_td = False + elif tag == 'th': + self._in_th = False + + if tag in ['td', 'th']: + final_cell = self._data_separator.join(self._current_cell).strip() + self._current_row.append(final_cell) + self._current_cell = [] + elif tag == 'tr': + self._current_table.append(self._current_row) + self._current_row = [] + elif tag == 'table': + self.tables.append(self._current_table) + self._current_table = [] + +parser=HTMLTableParser() + +def query(url): + if opt_cert == False: + requests.packages.urllib3.disable_warnings(InsecureRequestWarning) # pylint: disable=no-member + response = requests.get(url, verify=opt_cert) + raw_html = response.text + return raw_html +output_lines = [] +def output(line): + output_lines.append(line) + +def query_srm(): + if opt_demo: + return parser.feed(srm_status) + url = "https://%(address)s:9086/" % args_dict + return parser.feed(query(url)) + +def process_srm_info(): + output("<<>>") + query_srm() + local_connection = parser.tables[0] + remote_connection = parser.tables[1] + i=2 + for row in local_connection: + if str(row[0]) == "Service": + output("LocalConnection %s\t%s\t%s" % (row[1],local_connection[i][1],local_connection[i+2][1])) + i+=5 + + i=2 + for row in remote_connection: + if str(row[0]) == "Service": + output("RemoteConnection %s\t%s\t%s" % (row[1],local_connection[i][1],remote_connection[i+2][1])) + i+=5 + +def main(): + try: + process_srm_info() + sys.stdout.write("\n".join(output_lines) + "\n") + except Exception, e: + sys.stderr.write("Connection error: %s" % e) + sys.exit(1) + + +srm_status = \ +""" + + +

VMware vCenter Site Recovery Manager 6.5.1.6014840

Name: buc01m01vc01.test, UUID: d8fd8aea-a3ed-46e9-857e-509b80784c53, Extension key: com.vmware.vcDr

VMware vCenter Server 6.5.0 build-7515524


Supported VMODL versions

Inherent VMODL version


Local Connections

----------------------------------------------------------------------------------------------------
Servicecom.vmware.cis.vcenterserver
URLhttps://buc01m01vc01.test:443/sdk
Thumbprintunknown
StatusConnected
----------------------------------------------------------------------------------------------------
Servicecom.vmware.cis.cs.inventory
URLhttps://buc01m01vc01.test:443/invsvc/vmomi/sdk
Thumbprintunknown
StatusConnected
----------------------------------------------------------------------------------------------------
Servicecom.vmware.cis.cs.lookup
URLhttps://buc01psc01.test:443/lookupservice/sdk
Thumbprintunknown
StatusConnected
----------------------------------------------------------------------------------------------------
Servicecom.vmware.cis.cs.identity
URLhttps://buc01psc01.test/sso-adminserver/sdk/vsphere.local
Thumbprintunknown
StatusConnected
----------------------------------------------------------------------------------------------------
Servicecom.vmware.cis.cs.authorization
URLhttps://buc01m01vc01.test:443/invsvc/vmomi/sdk
Thumbprintunknown
StatusConnected
----------------------------------------------------------------------------------------------------
Servicecom.vmware.cis.cs.license
URLhttps://buc01psc01.test:443/ls/sdk
Thumbprintunknown
StatusConnected
----------------------------------------------------------------------------------------------------

Paired with remote SRM with name 'clj01m01vc01.test' and uuid 'acf7df22-01bb-439a-b27e-9f8b83e23233'

Remote Connections

----------------------------------------------------------------------------------------------------
Servicecom.vmware.cis.vcenterserver
URLhttps://clj01m01vc01.test:443/sdk
Thumbprintunknown
StatusConnected
----------------------------------------------------------------------------------------------------
Servicecom.vmware.dr.vcDr
URLhttps://clj01m01srm01.test:9086/vcdr/vmomi/sdk
Thumbprintunknown
StatusConnected
----------------------------------------------------------------------------------------------------
Servicecom.vmware.cis.cs.lookup
URLhttps://clj01psc01.test:443/lookupservice/sdk
Thumbprintunknown
StatusConnected
----------------------------------------------------------------------------------------------------
Servicecom.vmware.cis.cs.identity
URLhttps://clj01psc01.test/sso-adminserver/sdk/vsphere.local
Thumbprintunknown
StatusConnected
----------------------------------------------------------------------------------------------------
""" + +if __name__ == "__main__": + main() + diff --git a/local/share/check_mk/checkman/nsx_backup b/local/share/check_mk/checkman/nsx_backup new file mode 100644 index 0000000..8c4dfdc --- /dev/null +++ b/local/share/check_mk/checkman/nsx_backup @@ -0,0 +1,14 @@ +title: VMWare NSX: Backup time +agents: agent_nsx +catalog: Miscellaneous +license: GPL +distribution: check_mk +description: + This check monitors the date of last backup. +item: + Backup service. + +perfdata: + none +inventory: + One service called "NSX Backups". diff --git a/local/share/check_mk/checkman/nsx_components b/local/share/check_mk/checkman/nsx_components new file mode 100644 index 0000000..6232707 --- /dev/null +++ b/local/share/check_mk/checkman/nsx_components @@ -0,0 +1,15 @@ +title: VMWare NSX: Components status +agents: agent_nsx +catalog: Miscellaneous +license: GPL +distribution: check_mk +description: + This check monitors the status of VMWare NSX Components +item: + The item is composed from the Component Type. + +perfdata: + none +inventory: + All NSX Components defined will be inventorized. + diff --git a/local/share/check_mk/checkman/nsx_controllers b/local/share/check_mk/checkman/nsx_controllers new file mode 100644 index 0000000..78bb4fe --- /dev/null +++ b/local/share/check_mk/checkman/nsx_controllers @@ -0,0 +1,19 @@ +title: VMWare NSX: Controllers status +agents: agent_nsx +catalog: Miscellaneous +license: GPL +distribution: check_mk +description: + This check monitors the status of VMWare NSX Constrollers +• Deploying - controller is being deployed and the procedure has not completed yet. +• Removing - controller is being removed and the procedure has not completed yet. +• Running - controller has been deployed and can respond to API invocation. +• Unknown - controller has been deployed but fails to respond to API invocation. +item: + The item is composed from the Controller-id. + +perfdata: + none +inventory: + All NSX Controllers defined will be inventorized. + diff --git a/local/share/check_mk/checkman/nsx_cpu b/local/share/check_mk/checkman/nsx_cpu new file mode 100644 index 0000000..bdbc6ff --- /dev/null +++ b/local/share/check_mk/checkman/nsx_cpu @@ -0,0 +1,15 @@ +title: VMWare NSX: CPU usage of NSX +agents: agent_nsx +catalog: Miscellaneous +license: GPL +distribution: check_mk +description: + This check monitors the CPU usage. +item: + Memory used + +perfdata: + One graph for CPU used in percentage +inventory: + One service called "CPU Utilization". + diff --git a/local/share/check_mk/checkman/nsx_edges b/local/share/check_mk/checkman/nsx_edges new file mode 100644 index 0000000..1a3caff --- /dev/null +++ b/local/share/check_mk/checkman/nsx_edges @@ -0,0 +1,15 @@ +title: VMWare NSX: Edges status +agents: agent_nsx +catalog: Miscellaneous +license: GPL +distribution: check_mk +description: + This check monitors the status of VMWare NSX Edges +item: + The item is composed from the edge-id. + +perfdata: + none +inventory: + All NSX edges defined will be inventorized. + diff --git a/local/share/check_mk/checkman/nsx_mem b/local/share/check_mk/checkman/nsx_mem new file mode 100644 index 0000000..33f64c2 --- /dev/null +++ b/local/share/check_mk/checkman/nsx_mem @@ -0,0 +1,15 @@ +title: VMWare NSX: Memory usage of NSX +agents: agent_nsx +catalog: Miscellaneous +license: GPL +distribution: check_mk +description: + This check monitors the memory usage. +item: + Memory used + +perfdata: + Two graphs for memory used and all memory +inventory: + One service called "Memory Usage". + diff --git a/local/share/check_mk/checkman/nsx_memory b/local/share/check_mk/checkman/nsx_memory new file mode 100644 index 0000000..e785410 --- /dev/null +++ b/local/share/check_mk/checkman/nsx_memory @@ -0,0 +1,14 @@ +title: VMWare NSX: Memory usage of NSX +agents: agent_nsx +catalog: Miscellaneous +license: GPL +distribution: check_mk +description: + This check monitors the memory usage. +item: + Memory used + +perfdata: + Two graphs for memory used and all memory +inventory: + One service called "Memory Usage". diff --git a/local/share/check_mk/checkman/nsx_storage b/local/share/check_mk/checkman/nsx_storage new file mode 100644 index 0000000..ffec152 --- /dev/null +++ b/local/share/check_mk/checkman/nsx_storage @@ -0,0 +1,15 @@ +title: VMWare NSX: Storage usage of NSX +agents: agent_nsx +catalog: Miscellaneous +license: GPL +distribution: check_mk +description: + This check monitors the storage usage. +item: + Memory used + +perfdata: + One graph for storage used in bytes, autoscaled +inventory: + One service called "Storage used". + diff --git a/local/share/check_mk/checkman/nsx_vcenter_connection b/local/share/check_mk/checkman/nsx_vcenter_connection new file mode 100644 index 0000000..752bd82 --- /dev/null +++ b/local/share/check_mk/checkman/nsx_vcenter_connection @@ -0,0 +1,14 @@ +title: VMWare NSX: vCenter Connection +agents: agent_nsx +catalog: Miscellaneous +license: GPL +distribution: check_mk +description: + This check monitors the state of vCenter Connection. +item: + vCenter Connection + +perfdata: + none +inventory: + One service called "vCenter Connection". diff --git a/local/share/check_mk/checks/agent_nsx b/local/share/check_mk/checks/agent_nsx new file mode 100644 index 0000000..1f6bbf6 --- /dev/null +++ b/local/share/check_mk/checks/agent_nsx @@ -0,0 +1,41 @@ +#!/usr/bin/python +# -*- encoding: utf-8; py-indent-offset: 4 -*- +# +------------------------------------------------------------------+ +# | ____ _ _ __ __ _ __ | +# | / ___| |__ ___ ___| | __ | \/ | |/ / | +# | | | | '_ \ / _ \/ __| |/ / | |\/| | ' / | +# | | |___| | | | __/ (__| < | | | | . \ | +# | \____|_| |_|\___|\___|_|\_\___|_| |_|_|\_\ | +# | | +# | Copyright Mathias Kettner 2017 mk@mathias-kettner.de | +# +------------------------------------------------------------------+ +# +# This file is part of Check_MK. +# The official homepage is at http://mathias-kettner.de/check_mk. +# +# check_mk is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by +# the Free Software Foundation in version 2. check_mk is distributed +# in the hope that it will be useful, but WITHOUT ANY WARRANTY; with- +# out even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. See the GNU General Public License for more de- +# tails. You should have received a copy of the GNU General Public +# License along with GNU Make; see the file COPYING. If not, write +# to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, +# Boston, MA 02110-1301 USA. + +def agent_nsx_arguments(params, hostname, ipaddress): + args = '' + args += "--address=%s " % hostname + args += "--user=%s " % params["user"] + args += "--password=%s " % params["password"] + + if "nsx_resource" in params: + for domain in params["nsx_resource"]: + args += "--nsx_resource=%s " % domain + if "cert" in params and params["cert"] == False: + args += "--no-cert-check " + return args + +special_agent_info['nsx'] = agent_nsx_arguments + diff --git a/local/share/check_mk/checks/agent_srm b/local/share/check_mk/checks/agent_srm new file mode 100644 index 0000000..21c5ce0 --- /dev/null +++ b/local/share/check_mk/checks/agent_srm @@ -0,0 +1,36 @@ +#!/usr/bin/python +# -*- encoding: utf-8; py-indent-offset: 4 -*- +# +------------------------------------------------------------------+ +# | ____ _ _ __ __ _ __ | +# | / ___| |__ ___ ___| | __ | \/ | |/ / | +# | | | | '_ \ / _ \/ __| |/ / | |\/| | ' / | +# | | |___| | | | __/ (__| < | | | | . \ | +# | \____|_| |_|\___|\___|_|\_\___|_| |_|_|\_\ | +# | | +# | Copyright Mathias Kettner 2017 mk@mathias-kettner.de | +# +------------------------------------------------------------------+ +# +# This file is part of Check_MK. +# The official homepage is at http://mathias-kettner.de/check_mk. +# +# check_mk is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by +# the Free Software Foundation in version 2. check_mk is distributed +# in the hope that it will be useful, but WITHOUT ANY WARRANTY; with- +# out even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. See the GNU General Public License for more de- +# tails. You should have received a copy of the GNU General Public +# License along with GNU Make; see the file COPYING. If not, write +# to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, +# Boston, MA 02110-1301 USA. + +def agent_srm_arguments(params, hostname, ipaddress): + args = '' + args += "--address=%s " % hostname + + if "cert" in params and params["cert"] == False: + args += "--no-cert-check " + return args + +special_agent_info['srm'] = agent_srm_arguments + diff --git a/local/share/check_mk/checks/check_nsx b/local/share/check_mk/checks/check_nsx new file mode 100644 index 0000000..e7a155c --- /dev/null +++ b/local/share/check_mk/checks/check_nsx @@ -0,0 +1,431 @@ +#!/usr/bin/python +# -*- encoding: utf-8; py-indent-offset: 4 -*- +# +------------------------------------------------------------------+ +# | ____ _ _ __ __ _ __ | +# | / ___| |__ ___ ___| | __ | \/ | |/ / | +# | | | | '_ \ / _ \/ __| |/ / | |\/| | ' / | +# | | |___| | | | __/ (__| < | | | | . \ | +# | \____|_| |_|\___|\___|_|\_\___|_| |_|_|\_\ | +# | | +# | Copyright Mathias Kettner 2018 mk@mathias-kettner.de | +# +------------------------------------------------------------------+ +# +# This file is part of Check_MK. +# The official homepage is at http://mathias-kettner.de/check_mk. +# +# check_mk is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by +# the Free Software Foundation in version 2. check_mk is distributed +# in the hope that it will be useful, but WITHOUT ANY WARRANTY; with- +# out even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. See the GNU General Public License for more de- +# tails. You should have received a copy of the GNU General Public +# License along with GNU Make; see the file COPYING. If not, write +# to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, +# Boston, MA 02110-1301 USA. + +import datetime + +def inventory_edges_status(info): + for name, edgeid, edgestatus, edgestate, edgetype in info: + yield ("Edge %s" % \ + (edgeid), {}) + + +def check_edges_status(item, params, info): + for line in info: + edge = "Edge" + " " + line[1] + if edge==item: + edgename = line[0] + edgestatus = line[2] + edgestate = line[3] + edgetype = line[4] + if edgetype == "distributedRouter": + if edgestate != "active": + return 2, "Edge %s state is %s and status %s" % (edgename, edgestate, edgestatus ) + elif edgestatus == "GREEN": + return 0, "Edge %s state is %s and status %s" % (edgename, edgestate, edgestatus ) + elif edgestatus == "GREY": + return 0, "Edge %s state is %s and status %s" % (edgename, edgestate, edgestatus ) + elif edgestatus == "YELLOW": + return 1, "Edge %s state is %s and status %s" % (edgename, edgestate, edgestatus ) + elif edgestatus == "RED": + return 2, "Edge %s state is %s and status %s" % (edgename, edgestate, edgestatus ) + return 3, "Edge %s state is %s and status %s" % (edgename, edgestate, edgestatus ) + else: + if edgestatus == "GREEN": + return 0, "Edge %s is %s" % (edgename, edgestatus) + elif edgestatus == "YELLOW": + return 1, "Edge %s is %s" % (edgename, edgestatus) + elif edgestatus == "RED": + return 2, "Edge %s is %s" % (edgename, edgestatus) + return 3, "Edge %s is %s" % (edgename, edgestatus) + + +check_info['nsx_edges'] = { + 'inventory_function' : inventory_edges_status, + 'check_function' : check_edges_status, + 'service_description' : '%s', + 'has_perfdata' : False, +} + +#. +# .--Controller Status---------------------------------------------------. +# | ____ _ _ _ | +# | / ___|___ _ __ | |_ _ __ ___ | | | ___ _ __ | +# | | | / _ \| '_ \| __| '__/ _ \| | |/ _ \ '__| | +# | | |__| (_) | | | | |_| | | (_) | | | __/ | | +# | \____\___/|_| |_|\__|_| \___/|_|_|\___|_| | +# | | +# | ____ _ _ | +# | / ___|| |_ __ _| |_ _ _ ___ | +# | \___ \| __/ _` | __| | | / __| | +# | ___) | || (_| | |_| |_| \__ \ | +# | |____/ \__\__,_|\__|\__,_|___/ | +# | | +# +----------------------------------------------------------------------+ +# | | +# '----------------------------------------------------------------------' + +def inventory_controller_status(info): + for name, id, status in info: + yield ("Controller %s" % \ + (id), {}) + + +def check_controller_status(item, params, info): + for line in info: + controller = "Controller" + " " + line[1] + if controller==item: + controllername = line[0] + controllerstatus = line[2] + if controllerstatus == "RUNNING": + return 0, "Controller %s is %s" % (controllername, controllerstatus) + elif controllerstatus == "DEPLOYING": + return 1, "Controller %s is %s" % (controllername, controllerstatus) + elif controllerstatus == "REMOVING": + return 1, "Controller %s is %s" % (controllername, controllerstatus) + elif controllerstatus == "UNKNOWN": + return 2, "Controller %s is %s" % (controllername, controllerstatus) + +check_info['nsx_controller'] = { + 'inventory_function' : inventory_controller_status, + 'check_function' : check_controller_status, + 'service_description' : '%s', + 'has_perfdata' : False, +} + + + +#. +# .--NSX Components------------------------------------------------------. +# | _ _ ______ __ | +# | | \ | / ___\ \/ / | +# | | \| \___ \\ / | +# | | |\ |___) / \ | +# | |_| \_|____/_/\_\ | +# | | +# | ____ _ | +# | / ___|___ _ __ ___ _ __ ___ _ __ ___ _ __ | |_ ___ | +# | | | / _ \| '_ ` _ \| '_ \ / _ \| '_ \ / _ \ '_ \| __/ __| | +# | | |__| (_) | | | | | | |_) | (_) | | | | __/ | | | |_\__ \ | +# | \____\___/|_| |_| |_| .__/ \___/|_| |_|\___|_| |_|\__|___/ | +# | |_| | +# +----------------------------------------------------------------------+ +# | | +# '----------------------------------------------------------------------' +def inventory_nsx_components(info): + for name, id, status in info: + yield ("Component %s" % \ + (id), {}) + + +def check_nsx_components(item, params, info): + for line in info: + component = "Component" + " " + line[1] + if component==item: + component_name = line[0] + component_status = line[2] + if component_status == "RUNNING": + return 0, "Component %s is %s" % (component_name, component_status) + else: + return 2, "Component %s is %s" % (component_name, component_status) + +check_info['nsx_components'] = { + 'inventory_function' : inventory_nsx_components, + 'check_function' : check_nsx_components, + 'service_description' : '%s', + 'has_perfdata' : False, +} + +#. +# .--NSX Backup----------------------------------------------------------. +# | _ _ ______ __ ____ _ | +# | | \ | / ___\ \/ / | __ ) __ _ ___| | ___ _ _ __ | +# | | \| \___ \\ / | _ \ / _` |/ __| |/ / | | | '_ \ | +# | | |\ |___) / \ | |_) | (_| | (__| <| |_| | |_) | | +# | |_| \_|____/_/\_\ |____/ \__,_|\___|_|\_\\__,_| .__/ | +# | |_| | +# +----------------------------------------------------------------------+ +# | | +# '----------------------------------------------------------------------' +def inventory_nsx_backups(info): + return [(None, {})] + + +def check_nsx_backup(item, params, info): + warn, crit = params + if info: + last_backup = sorted(info, key=lambda tup: tup[2])[-1] + last_backup_size = last_backup[1] + last_backup_time = datetime.datetime.fromtimestamp(float(last_backup[2])/1000) + elapsed = datetime.datetime.now() - last_backup_time + if elapsed >= datetime.timedelta(days=crit): + return 2, "Last backup was taken more than %s days ago. Last backup date is %s " \ + % (crit, last_backup_time) + elif elapsed >= datetime.timedelta(days=warn): + return 1, "Last backup was taken more than %s days ago. Last backup date is %s " \ + % (warn, last_backup_time) + else: + return 0, "Date of last backup is %s" % last_backup_time + else: + return 3, "Backup not available" + +check_info['nsx_backup'] = { + 'inventory_function' : inventory_nsx_backups, + 'check_function' : check_nsx_backup, + 'service_description' : 'NSX Backups', + 'has_perfdata' : False, + 'group' : "backups", +} + +#. +# .--Memory--------------------------------------------------------------. +# | __ __ | +# | | \/ | ___ _ __ ___ ___ _ __ _ _ | +# | | |\/| |/ _ \ '_ ` _ \ / _ \| '__| | | | | +# | | | | | __/ | | | | | (_) | | | |_| | | +# | |_| |_|\___|_| |_| |_|\___/|_| \__, | | +# | |___/ | +# +----------------------------------------------------------------------+ +nsx_memory_default_levels = ( 80.0, 90.0 ) + +def nsx_convert(info): + data = {} + for line in info: + data[line[0]] = line[1:] + return data + +def inventory_nsx_mem(info): + data = nsx_convert(info) + return [(None, 'nsx_mem_default_levels')] + +def check_nsx_mem(item, params, info): + data = nsx_convert(info) + warn, crit = params + memory_usage = savefloat(data['UsedMemory'][0]) * 1024 * 1024 + memory_size = savefloat(data['TotalMem'][0]) * 1024 * 1024 + level = savefloat(data['UsedPercentage'][0]) + state = 0 + label = '' + if level >= crit: + state = 2 + label = " (Levels at %d%%/%d%%)" % (warn, crit) + elif level >= warn: + state = 1 + label = " (Levels at %d%%/%d%%)" % (warn, crit) + message = "%d%%%s used - %s/%s" % \ + (level, label, get_bytes_human_readable(memory_usage), get_bytes_human_readable(memory_size)) + perf = [("mem_used", memory_usage, warn * memory_size / 100, crit * memory_size / 100, 0, memory_size), + ("mem_total", memory_size)] + return(state, message, perf) + + +check_info['nsx_memory'] = { + "inventory_function" : inventory_nsx_mem, + "check_function" : check_nsx_mem, + "service_description" : "Memory used", + "group" : "nsx_memory", + "has_perfdata" : True, + "default_levels_variable" : "nsx_mem_default_levels" +} + +#. +# .--CPU-----------------------------------------------------------------. +# | ____ ____ _ _ | +# | / ___| _ \| | | | | +# | | | | |_) | | | | | +# | | |___| __/| |_| | | +# | \____|_| \___/ | +# | | +# +----------------------------------------------------------------------+ + +nsx_host_cpu_default_levels = {} + +def inventory_nsx_cpu(info): + data = nsx_convert(info).keys() + if 'usedPercentage' in data \ + and 'totalNoOfCPUs' in data\ + and 'capacity' in data: + return [(None, {})] + +def check_nsx_cpu(item, params, info): + data = nsx_convert(info) + + if "usedPercentage" not in data: + return + #Asuming that there are 1 thread per core and one core per socket + #Asuming that capacity represents total capacity + + num_cpu = int(data['totalNoOfCPUs'][0]) + total_capacity = int(data['capacity'][0]) + used_capacity = float(data['usedCapacity'][0]) + mhz_per_core = float(data['capacity'][0]) / num_cpu + + + usage = used_capacity / total_capacity * 100 + per_core = num_cpu / 100.0 + + infotext = "%.1f%%" % usage + + # Convert legacy parameters + this_time = time.time() + state, infotext, perfdata = check_cpu_util(usage, params).next() + + infotext += ", %.2fGHz/%.2fGHz" % (used_capacity / 1000.0, total_capacity / 1000.0) + infotext += ", %d sockets, %d cores/socket, %d threads" % ( + num_cpu, 1 , 1) + return (state, infotext, perfdata) + + +check_info['nsx_cpu'] = { + "inventory_function" : inventory_nsx_cpu, + "check_function" : check_nsx_cpu, + "service_description" : "CPU utilization", + "group" : "cpu_utilization_os", + "has_perfdata" : True, + "default_levels_variable" : "nsx_host_cpu_default_levels", + "includes" : [ "cpu_util.include" ], +} + +#. +# .--NSX vCenter Connection----------------------------------------------. +# | _ _ ______ __ ____ _ | +# | | \ | / ___\ \/ / __ __/ ___|___ _ __ | |_ ___ _ __ | +# | | \| \___ \\ / \ \ / / | / _ \ '_ \| __/ _ \ '__| | +# | | |\ |___) / \ \ V /| |__| __/ | | | || __/ | | +# | |_| \_|____/_/\_\ \_/ \____\___|_| |_|\__\___|_| | +# | | +# | ____ _ _ | +# | / ___|___ _ __ _ __ ___ ___| |_(_) ___ _ __ | +# | | | / _ \| '_ \| '_ \ / _ \/ __| __| |/ _ \| '_ \ | +# | | |__| (_) | | | | | | | __/ (__| |_| | (_) | | | | | +# | \____\___/|_| |_|_| |_|\___|\___|\__|_|\___/|_| |_| | +# | | +# +----------------------------------------------------------------------+ +# | | +# '----------------------------------------------------------------------' +def inventory_nsx_vcenter_connection(info): + return [(None, {})] + + +def check_nsx_vcenter_connection(item, params, info): + if "true" in info[0]: + return 0, "vCenterConnection is true" + elif "false" in info[0]: + return 2, "vCenterConnection is false" + +check_info['nsx_vcenter_connection'] = { + 'inventory_function' : inventory_nsx_vcenter_connection, + 'check_function' : check_nsx_vcenter_connection, + 'service_description' : 'vCenter Connection', + 'has_perfdata' : False, +} + + +#. +# .--NSX Storage Info----------------------------------------------------. +# | _ _ ______ __ ____ _ | +# | | \ | / ___\ \/ / / ___|| |_ ___ _ __ __ _ __ _ ___ | +# | | \| \___ \\ / \___ \| __/ _ \| '__/ _` |/ _` |/ _ \ | +# | | |\ |___) / \ ___) | || (_) | | | (_| | (_| | __/ | +# | |_| \_|____/_/\_\ |____/ \__\___/|_| \__,_|\__, |\___| | +# | |___/ | +# | ___ __ | +# | |_ _|_ __ / _| ___ | +# | | || '_ \| |_ / _ \ | +# | | || | | | _| (_) | | +# | |___|_| |_|_| \___/ | +# | | +# +----------------------------------------------------------------------+ +# | | +# '----------------------------------------------------------------------' +nsx_storage_default_levels = ( 70.0, 80.0 ) + +def inventory_nsx_storage(info): + data = nsx_convert(info) + return [(None, 'nsx_storage_default_levels')] + +def check_nsx_storage(item, params, info): + warn,crit = params + data = nsx_convert(info) + used_storage = float(re.sub('G','', data['UsedStorage'][0],count =1)) + total_storage = float(re.sub('G','', data['TotalStorage'][0],count =1)) + free_storage = float(re.sub('G','', data['FreeStorage'][0],count =1)) + used_percentage = float(re.sub('G','', data['UsedPercentage'][0],count =1)) + perf = [("storage_used", used_storage * 1024 * 1024 * 1024, \ + warn * total_storage * 1024 * 1024 * 1024 / 100 , \ + crit * total_storage * 1024 * 1024 * 1024 / 100 , 0, total_storage * 1024 * 1024 * 1024)] + if used_percentage >= crit: + return 2, "Storage used is %sGB out of %sGB" % (used_storage, total_storage) , perf + elif used_percentage >= warn: + return 1, "Storage used is %sGB out of %sGB" % (used_storage, total_storage) , perf + else: + return 0, "Storage used is %sGB out of %sGB" % (used_storage, total_storage) , perf + +check_info['nsx_storage_info'] = { + "inventory_function" : inventory_nsx_storage, + "check_function" : check_nsx_storage, + "service_description" : "Storage used", + "group" : "nsx_storage", + "has_perfdata" : True, + "default_levels_variable" : "nsx_storage_default_levels", + +} + + + +####NSX_RESOURCES +def inventory_nsx_resources(info): + for domain_name, component, status in info: + component_sn = component.split(".")[-1] + yield ("%s %s" % \ + (domain_name, component_sn), {}) + + +def check_nsx_resources(item, params, info): + for line in info: + component = line[0] + " " + line[1].split(".")[-1] + if component==item: + domain_name = line[0] + component_name = line[1].split(".")[-1] + component_status = line[2] + if component_name == "hostRebootRequired": + if component_status == "false": + return 0, "Host reboot is not required. " + else: + return 1, "Host needs a reboot" + + if component_status == "GREEN": + return 0, "Component %s is %s" % (component_name, component_status) + elif component_status =="UNKNOWN": + return 3, "Status is unknown" + else: + return 2, "Component %s is %s" % (component_name, component_status) + +check_info['nsx_resources'] = { + 'inventory_function' : inventory_nsx_resources, + 'check_function' : check_nsx_resources, + 'service_description' : '%s', + 'has_perfdata' : False, +} diff --git a/local/share/check_mk/checks/check_srm b/local/share/check_mk/checks/check_srm new file mode 100644 index 0000000..429269a --- /dev/null +++ b/local/share/check_mk/checks/check_srm @@ -0,0 +1,59 @@ +#!/usr/bin/python +# -*- encoding: utf-8; py-indent-offset: 4 -*- +# +------------------------------------------------------------------+ +# | ____ _ _ __ __ _ __ | +# | / ___| |__ ___ ___| | __ | \/ | |/ / | +# | | | | '_ \ / _ \/ __| |/ / | |\/| | ' / | +# | | |___| | | | __/ (__| < | | | | . \ | +# | \____|_| |_|\___|\___|_|\_\___|_| |_|_|\_\ | +# | | +# | Copyright Mathias Kettner 2018 mk@mathias-kettner.de | +# +------------------------------------------------------------------+ +# +# This file is part of Check_MK. +# The official homepage is at http://mathias-kettner.de/check_mk. +# +# check_mk is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by +# the Free Software Foundation in version 2. check_mk is distributed +# in the hope that it will be useful, but WITHOUT ANY WARRANTY; with- +# out even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. See the GNU General Public License for more de- +# tails. You should have received a copy of the GNU General Public +# License along with GNU Make; see the file COPYING. If not, write +# to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, +# Boston, MA 02110-1301 USA. + +#<<>> +#LocalConnection com.vmware.cis.vcenterserver https://buc01m01vc01.test:443/sdk Connected +#LocalConnection com.vmware.cis.cs.inventory https://buc01m01vc01.test:443/invsvc/vmomi/sdk Connected +#LocalConnection com.vmware.cis.cs.lookup https://buc01psc01.test:443/lookupservice/sdk Connected +#LocalConnection com.vmware.cis.cs.identity https://buc01psc01.test/sso-adminserver/sdk/vsphere.local Connected +#LocalConnection com.vmware.cis.cs.authorization https://buc01m01vc01.test:443/invsvc/vmomi/sdk Connected +#LocalConnection com.vmware.cis.cs.license https://buc01psc01.test:443/ls/sdk Connected +#RemoteConnection com.vmware.cis.vcenterserver https://buc01m01vc01.test:443/sdk Connected +#RemoteConnection com.vmware.dr.vcDr https://buc01m01vc01.test:443/invsvc/vmomi/sdk Connected +#RemoteConnection com.vmware.cis.cs.lookup https://buc01psc01.test:443/lookupservice/sdk Connected +#RemoteConnection com.vmware.cis.cs.identity https://buc01psc01.test/sso-adminserver/sdk/vsphere.locaConnected + +import datetime + +def inventory_srm_status(info): + for servicename, url, state in info: + yield ("%s" % (servicename), {}) + + +def check_srm_status(item, params, info): + for line in info: + if line[0]==item: + if line[2]=="Connected": + return 0, "OK, %s is %s; %s" % (item,line[2],line[1]) + else: + return 1, "CRIT, %s is %s; %s" % (item,line[2],line[1]) + +check_info['vcenter_srm'] = { + 'inventory_function' : inventory_srm_status, + 'check_function' : check_srm_status, + 'service_description' : '%s', + 'has_perfdata' : False, +}