|
| 1 | +############################################################################## |
| 2 | +# |
| 3 | +# Copyright (C) Zenoss, Inc. 2013-2014, all rights reserved. |
| 4 | +# |
| 5 | +# This content is made available according to terms specified in |
| 6 | +# License.zenoss under the directory where your Zenoss product is installed. |
| 7 | +# |
| 8 | +############################################################################## |
| 9 | + |
| 10 | +"""ZenPacks.zenoss.Cisco.APIC - Cisco APIC monitoring for Zenoss. |
| 11 | +
|
| 12 | +This module contains initialization code for the ZenPack. Everything in |
| 13 | +the module scope will be executed at startup by all Zenoss Python |
| 14 | +processes. |
| 15 | +
|
| 16 | +The initialization order for ZenPacks is defined by |
| 17 | +$ZENHOME/ZenPacks/easy-install.pth. |
| 18 | +
|
| 19 | +""" |
| 20 | + |
| 21 | +from . import zenpacklib |
| 22 | + |
| 23 | + |
| 24 | +RELATIONSHIPS_YUML = """ |
| 25 | +[APIC]++-[FabricPod] |
| 26 | +[APIC]++-[FvTenant] |
| 27 | +[FabricPod]++-[FabricNode] |
| 28 | +[FabricNode]++-[CnwAggrIf] |
| 29 | +[FabricNode]++-[CnwPhysIf] |
| 30 | +[FabricNode]++-[EqptCPU] |
| 31 | +[FabricNode]++-[EqptLC] |
| 32 | +[EqptCPU]++-[EqptCore] |
| 33 | +[EqptLC]++-[EqptFabP] |
| 34 | +[FvTenant]++-[FvBD] |
| 35 | +[FvTenant]++-[VzBrCP] |
| 36 | +[FvTenant]++-[FvAp] |
| 37 | +[FvAp]++-[FvAEPg] |
| 38 | +[FvAEPg]++-[FvRsProv] |
| 39 | +[FvAEPg]++-[FvRsCons] |
| 40 | +// non-containing |
| 41 | +[FvBD]1-.-*[FvAEPg] |
| 42 | +[VzBrCP]1-.-*[FvRsProv] |
| 43 | +[VzBrCP]1-.-*[FvRsCons] |
| 44 | +""" |
| 45 | + |
| 46 | +CFG = zenpacklib.ZenPackSpec( |
| 47 | + name=__name__, |
| 48 | + |
| 49 | + zProperties={ |
| 50 | + 'DEFAULTS': {'category': 'Cisco APIC'}, |
| 51 | + |
| 52 | + 'zCiscoAPICHost': {}, |
| 53 | + 'zCiscoAPICPort': {'type': 'int', 'default': 80}, |
| 54 | + 'zCiscoAPICUser': {'default': 'admin'}, |
| 55 | + 'zCiscoAPICPassword': {'default': 'password'}, |
| 56 | + 'zCiscoAPICHealthInterval': {'type': 'int', 'default': 300}, |
| 57 | + }, |
| 58 | + |
| 59 | + classes={ |
| 60 | + 'DEFAULTS': {'base': 'ManagedObject'}, |
| 61 | + |
| 62 | + ## Device Types ############################################### |
| 63 | + |
| 64 | + 'APIC': { |
| 65 | + 'base': zenpacklib.Device, |
| 66 | + 'meta_type': 'CiscoAPIC', |
| 67 | + }, |
| 68 | + |
| 69 | + ## Component Base Types ####################################### |
| 70 | + |
| 71 | + 'ManagedObjectBase': { |
| 72 | + 'base': object, |
| 73 | + |
| 74 | + 'properties': { |
| 75 | + 'apic_classname': { |
| 76 | + 'label': 'ACI Object Class', |
| 77 | + }, |
| 78 | + 'apic_dn': { |
| 79 | + 'label': 'ACI Distinguished Name (DN)', |
| 80 | + 'index_type': 'field', |
| 81 | + }, |
| 82 | + 'apic_health_dn': { |
| 83 | + 'label': 'ACI Health Distinguished Name (DN)', |
| 84 | + }, |
| 85 | + }, |
| 86 | + }, |
| 87 | + |
| 88 | + 'ManagedObject': { |
| 89 | + 'base': ('ManagedObjectBase', zenpacklib.Component), |
| 90 | + }, |
| 91 | + |
| 92 | + 'ManagedHardwareObject': { |
| 93 | + 'base': ('ManagedObjectBase', zenpacklib.HardwareComponent), |
| 94 | + }, |
| 95 | + |
| 96 | + ## Component Types ############################################ |
| 97 | + |
| 98 | + ### uni/... ################################################### |
| 99 | + |
| 100 | + 'FvTenant': { |
| 101 | + 'meta_type': 'CiscoAPICTenant', |
| 102 | + 'label': 'Tenant', |
| 103 | + 'order': 11, |
| 104 | + 'impacted_by': ['fvAps'], |
| 105 | + }, |
| 106 | + |
| 107 | + 'FvAp': { |
| 108 | + 'meta_type': 'CiscoAPICApplication', |
| 109 | + 'label': 'Application', |
| 110 | + 'order': 12, |
| 111 | + 'impacted_by': ['fvAEPgs'], |
| 112 | + }, |
| 113 | + |
| 114 | + 'FvAEPg': { |
| 115 | + 'meta_type': 'CiscoAPICApplicationEndpointGroup', |
| 116 | + 'label': 'Application Endpoint Group', |
| 117 | + 'short_label': 'Endpoint Group', |
| 118 | + 'label_width': 80, |
| 119 | + 'order': 13, |
| 120 | + 'impacted_by': ['fvBD', 'fvRsConss'], |
| 121 | + }, |
| 122 | + |
| 123 | + 'VzBrCP': { |
| 124 | + 'meta_type': 'CiscoAPICContract', |
| 125 | + 'label': 'Contract', |
| 126 | + 'order': 14, |
| 127 | + 'impacted_by': ['fvRsProvs'], |
| 128 | + }, |
| 129 | + |
| 130 | + 'FvRsProv': { |
| 131 | + 'meta_type': 'CiscoAPICContractProvided', |
| 132 | + 'label': 'Contract Provided', |
| 133 | + 'plural_label': 'Contracts Provided', |
| 134 | + 'short_label': 'Provides', |
| 135 | + 'plural_short_label': 'Provides', |
| 136 | + 'order': 14.1, |
| 137 | + 'impacted_by': ['fvAEPg'], |
| 138 | + }, |
| 139 | + |
| 140 | + 'FvRsCons': { |
| 141 | + 'meta_type': 'CiscoAPICContractConsumed', |
| 142 | + 'label': 'Contract Consumed', |
| 143 | + 'plural_label': 'Contracts Consumed', |
| 144 | + 'short_label': 'Consumes', |
| 145 | + 'plural_short_label': 'Consumes', |
| 146 | + 'order': 14.2, |
| 147 | + 'impacted_by': ['vzBrCP'], |
| 148 | + }, |
| 149 | + |
| 150 | + 'FvBD': { |
| 151 | + 'meta_type': 'CiscoAPICBridgeDomain', |
| 152 | + 'label': 'Bridge Domain', |
| 153 | + 'order': 15, |
| 154 | + 'impacted_by': ['fabricPods'], # TODO: Only for demo. |
| 155 | + }, |
| 156 | + |
| 157 | + ### topology/... ############################################## |
| 158 | + |
| 159 | + 'FabricPod': { |
| 160 | + 'meta_type': 'CiscoAPICFabricPod', |
| 161 | + 'label': 'Fabric Pod', |
| 162 | + 'order': 20, |
| 163 | + 'impacted_by': ['fabricNodes'], |
| 164 | + }, |
| 165 | + |
| 166 | + 'FabricNode': { |
| 167 | + 'meta_type': 'CiscoAPICFabricNode', |
| 168 | + 'label': 'Fabric Node', |
| 169 | + 'label_width': 65, |
| 170 | + 'content_width': 100, |
| 171 | + 'order': 21, |
| 172 | + 'properties': { |
| 173 | + 'role': { |
| 174 | + 'label': 'Role', |
| 175 | + }, |
| 176 | + }, |
| 177 | + 'impacted_by': ['eqptCPUs'], |
| 178 | + 'monitoring_templates': ['Health', 'FabricNode'], |
| 179 | + }, |
| 180 | + |
| 181 | + 'EqptLC': { |
| 182 | + 'base': 'ManagedHardwareObject', |
| 183 | + 'meta_type': 'CiscoAPICEqptLC', |
| 184 | + 'label': 'Line Card', |
| 185 | + 'order': 22, |
| 186 | + 'impacted_by': ['fabricNode'], |
| 187 | + 'monitoring_templates': ['Health', 'LineCard'], |
| 188 | + }, |
| 189 | + |
| 190 | + 'EqptFabP': { |
| 191 | + 'base': 'ManagedHardwareObject', |
| 192 | + 'meta_type': 'CiscoAPICEqptFabP', |
| 193 | + 'label': 'Fabric Port', |
| 194 | + 'order': 23, |
| 195 | + 'impacted_by': ['eqptLC'], |
| 196 | + 'monitoring_templates': ['Health', 'FabricPort'], |
| 197 | + }, |
| 198 | + |
| 199 | + 'CnwAggrIf': { |
| 200 | + 'meta_type': 'CiscoAPICAggregateInterface', |
| 201 | + 'label': 'Aggregate Interface', |
| 202 | + 'short_label': 'Agg. Interface', |
| 203 | + 'order': 24, |
| 204 | + 'impacted_by': ['fabricNode'], |
| 205 | + }, |
| 206 | + |
| 207 | + 'CnwPhysIf': { |
| 208 | + 'meta_type': 'CiscoAPICPhysicalInterface', |
| 209 | + 'label': 'Physical Interface', |
| 210 | + 'short_label': 'Phys. Interface', |
| 211 | + 'order': 25, |
| 212 | + 'impacted_by': ['fabricNode'], |
| 213 | + }, |
| 214 | + |
| 215 | + 'EqptCPU': { |
| 216 | + 'meta_type': 'CiscoAPICCPU', |
| 217 | + 'label': 'CPU', |
| 218 | + 'order': 26, |
| 219 | + 'impacted_by': ['eqptCores'], |
| 220 | + }, |
| 221 | + |
| 222 | + 'EqptCore': { |
| 223 | + 'meta_type': 'CiscoAPICCPUCore', |
| 224 | + 'label': 'CPU Core', |
| 225 | + 'order': 27, |
| 226 | + }, |
| 227 | + }, |
| 228 | + |
| 229 | + class_relationships=zenpacklib.relationships_from_yuml(RELATIONSHIPS_YUML), |
| 230 | +) |
| 231 | + |
| 232 | +CFG.create() |
0 commit comments