apiVersion: v1
kind: ConfigMap
metadata:
  name: vrops-exporter-collector-config
data:
  collector_config.yaml: |
    default_collectors:
    #    - 'NSXTMgmtClusterStatsCollector'
        - 'ClusterStatsCollector'
        - 'ClusterPropertiesCollector'
        - 'DatastoreStatsCollector'
        - 'DatastorePropertiesCollector'
    #    - 'HostSystemStatsCollector'
    #    - 'HostSystemPropertiesCollector'
        - 'VCenterStatsCollector'
        - 'VCenterPropertiesCollector'
    #    - 'VMPropertiesCollector'
    #    - 'VMStatsCPUCollector'
    #    - 'VMStatsNetworkCollector'
    #    - 'VMStatsVirtualDiskCollector'
    #    - 'VMStatsMemoryCollector'
    #    - 'VMStatsDefaultCollector'
    #  INFO - Alerts
    #    - 'NSXTAdapterAlertCollector'
    #    - 'NSXTMgmtClusterAlertCollector'
    #    - 'NSXTMgmtServiceAlertCollector'
    #    - 'NSXTMgmtNodeAlertCollector'
    #    - 'ClusterAlertCollector'
    #    - 'DatastoreAlertCollector'
    #    - 'HostSystemAlertCollector'
    #    - 'VCenterAlertCollector'
    #    - 'VMAlertCollector'

    alerts:
      alertCriticality:
        - 'CRITICAL'
        - 'WARNING'
        - 'IMMEDIATE'
      activeOnly: True

    ClusterPropertiesCollector:
    # INFO - Prefix: vrops_cluster_
      - metric_suffix: "configuration_dasConfig_enabled"
        expected: "true"
        key: "configuration|dasConfig|enabled"
      - metric_suffix: "configuration_dasConfig_admissionControlEnabled"
        expected: "true"
        key: "configuration|dasConfig|admissionControlEnabled"
      - metric_suffix: "configuration_dasConfig_admissionControlPolicyId"
        key: "configuration|dasConfig|admissionControlPolicyId"
      - metric_suffix: "configuration_drsconfig_enabled"
        expected: "true"
        key: "configuration|drsConfig|enabled"
      - metric_suffix: "configuration_drsconfig_defaultVmBehavior"
        expected: "fullyAutomated"
        key: "configuration|drsConfig|defaultVmBehavior"
      - metric_suffix: "configuration_drsConfig_targetBalance"
        key: "configuration|drsConfig|targetBalance"
      - metric_suffix: "custom_attributes_info"
        key: "summary|customTag:INFO|customTagValue"
      - metric_suffix: "configuration_drsconfiguration_affinity_rules"
        key: "configuration|drsconfig|affinityRules"

    ClusterStatsCollector:
    # INFO - Prefix: vrops_cluster_
      - metric_suffix: "cpu_capacity_usage_percentage"
        key: "cpu|capacity_usagepct_average"
      - metric_suffix: "cpu_usage_mhz"
        key: "cpu|usagemhz_average"
      - metric_suffix: "cpu_capacity_mhz"
        key: "cpu|haTotalCapacity_average"
      - metric_suffix: "memory_usage_percentage"
        key: "mem|host_usagePct"
      - metric_suffix: "memory_usage_kilobytes"
        key: "mem|host_usage"
      - metric_suffix: "memory_capacity_kilobytes"
        key: "mem|totalCapacity_average"
      - metric_suffix: "cluster_running_hosts"
        key: "summary|number_running_hosts"
      - metric_suffix: "services_totalImbalance"
        key: "clusterServices|total_imbalance"
      - metric_suffix: "summary_total_number_vms"
        key: "summary|total_number_vms"
      - metric_suffix: "cpu_contention_percentage"
        key: "cpu|capacity_contentionPct"

    DatastoreStatsCollector:
    # INFO - Prefix: vrops_datastore_
      - metric_suffix: "diskspace_total_usage_gigabytes"
        key: "diskspace|disktotal"
      - metric_suffix: "diskspace_freespace_gigabytes"
        key: "diskspace|freespace"
      - metric_suffix: "diskspace_capacity_gigabytes"
        key: "diskspace|capacity"
      - metric_suffix: "summary_total_number_vms"
        key: "summary|total_number_vms"

    DatastorePropertiesCollector:
    # INFO - Prefix: vrops_datastore_
      - metric_suffix: "summary_datastore_accessible"
        expected: "PoweredOn"
        key: "summary|accessible"
      - metric_suffix: "hostcount"
        key: "datastore|hostcount"

    HostSystemStatsCollector:
    # INFO - Prefix: vrops_hostsystem_
      - metric_suffix: "hardware_number_of_cpu_cores_info"
        key: "hardware|cpuInfo|num_CpuCores"
      - metric_suffix: "configuration_dasConfig_admissionControlPolicy_failoverHost"
        key: "configuration|dasConfig|admissionControlPolicy|failoverHost"
      - metric_suffix: "cpu_sockets_number"
        key: "cpu|numpackages"
      - metric_suffix:  "cpu_usage_megahertz"
        key: "cpu|usagemhz_average"
      - metric_suffix: "cpu_demand_percentage"
        key: "cpu|demandPct"
      - metric_suffix: "cpu_demand_megahertz"
        key: "cpu|demandmhz"
      - metric_suffix: "cpu_usage_average_percentage"
        key: "cpu|usage_average"
      - metric_suffix: "cpu_co_stop_miliseconds"
        key: "cpu|costop_summation"
      - metric_suffix: "cpu_contention_percentage"
        key: "cpu|capacity_contentionPct"
      - metric_suffix: "cpu_io_wait_miliseconds"
        key: "cpu|iowait"
      - metric_suffix: "cpu_ready_miliseconds"
        key: "cpu|ready_summation"
      - metric_suffix: "cpu_swap_wait_miliseconds"
        key: "cpu|swapwait_summation"
      - metric_suffix: "memory_host_usage_kilobytes"
        key: "mem|host_usage"
      - metric_suffix: "memory_useable_kilobytes"
        key: "mem|host_usable"
      - metric_suffix: "memory_usage_percentage"
        key: "mem|usage_average"
      - metric_suffix: "memory_utilization"
        key: "mem|total_need"
      - metric_suffix: "memory_contention_percentage"
        key: "mem|host_contentionPct"
      - metric_suffix: "memory_ballooning_kilobytes"
        key: "mem|vmmemctl_average"
      - metric_suffix: "memory_compressed_kilobytes"
        key: "mem|compressed_average"
      - metric_suffix: "memory_activly_used_by_vms_kilobytes"
        key: "mem|active_average"
      - metric_suffix: "memory_consumed_by_vms_kilobytes"
        key: "mem|consumed_average"
      - metric_suffix: "memory_capacity_available_to_vms_kilobytes"
        key: "mem|host_provisioned"
      - metric_suffix: "memory_swap_in_rate_kbps"
        key: "mem|swapinRate_average"
      - metric_suffix: "memory_swap_out_rate_kbps"
        key: "mem|swapoutRate_average"
      - metric_suffix: "memory_swap_used_rate_kbps"
        key: "mem|swapused_average"
      - metric_suffix: "network_packets_dropped_rx_number"
        key: "net|droppedRx_summation"
      - metric_suffix: "network_packets_dropped_tx_number"
        key: "net|droppedTx_summation"
      - metric_suffix: "network_packets_dropped_percentage"
        key: "net:Aggregate of all instances|droppedPct"
      - metric_suffix: "summary_number_VMs_total"
        key: "summary|total_number_vms"
      - metric_suffix: "summary_running_VMs_number"
        key: "summary|number_running_vms"
      - metric_suffix: "summary_number_running_vcpus_total"
        key: "summary|number_running_vcpus"
      - metric_suffix: "summary_number_vmotion_total"
        key: "summary|number_vmotion"
      - metric_suffix: "system_uptime_seconds"
        key: "sys|uptime_latest"
      - metric_suffix: "diskspace_capacity_gigabytes"
        key: "diskspace|total_capacity"
      - metric_suffix: "diskspace_usage_gigabytes"
        key: "diskspace|total_usage"

    HostSystemPropertiesCollector:
    # INFO - Prefix: vrops_hostsystem_
      - metric_suffix: "runtime_powerState"
        key: "runtime|powerState"
        expected: "Powered On"
      - metric_suffix: "runtime_connectionState"
        key: "runtime|connectionState"
        expected: "connected"
      - metric_suffix: "runtime_maintenanceState"
        key: "runtime|maintenanceState"
        expected: "notInMaintenance"
      - metric_suffix: "summary_version_info"
        key: "summary|version"
      - metric_suffix: "custom_attributes_hw_info"
        key: "summary|customTag:HW|customTagValue"
      - metric_suffix: "sys_build_info"
        key: "sys|build"
      - metric_suffix: "config_diskSpace_bytes"
        key: "config|diskSpace"
      - metric_suffix: "cpu_model"
        key: "cpu|cpuModel"
      - metric_suffix: "hardware_model"
        key: "hardware|vendorModel"
      - metric_suffix: "hardware_bios_version"
        key: "hardware|biosVersion"

    VCenterStatsCollector:
    # INFO - Prefix: vrops_virtualmachine_
      - metric_suffix: "cpu_used_percent"
        key: "cpu|capacity_usagepct_average"
      - metric_suffix: "memory_used_percent"
        key: "mem|host_usagePct"
      - metric_suffix: "diskspace_total_gigabytes"
        key: "diskspace|total_capacity"
      - metric_suffix: "diskspace_usage_gigabytes"
        key: "diskspace|total_usage"
      - metric_suffix: "vcsa_certificate_remaining_days"
        key: "summary|CPO vCSA Certificate Remaining Days"

    VCenterPropertiesCollector:
    # INFO - Prefix: vrops_virtualmachine_
      - metric_suffix: "summary_version_info"
        key: "summary|version"
      - metric_suffix: "vc_fullname_info"
        key: "summary|vcfullname"

    VMPropertiesCollector:
    # INFO - Prefix: vrops_virtualmachine_
      - metric_suffix: "runtime_powerState"
        expected: "Powered On"
        key: "summary|runtime|powerState"
      - metric_suffix: "runtime_connectionState"
        expected: "connected"
        key: "summary|runtime|connectionState"
      - metric_suffix: "guest_tools_version"
        key: "summary|guest|toolsVersion"
      - metric_suffix: "summary_ethernetCards"
        key: "summary|config|numEthernetCards"
      - metric_suffix: "virtualdisk_scsi0_0_datastore"
        key: "virtualDisk:scsi0:0|datastore"
      - metric_suffix: "virtualdisk_scsi0_1_datastore"
        key: "virtualDisk:scsi0:1|datastore"
      - metric_suffix: "guest_os_full_name"
        key: "config|guestFullName"
      - metric_suffix: "config_hardware_memory_kilobytes"
        key: "config|hardware|memoryKB"
      - metric_suffix: "disk_space_snapshot_age_days"
        key: "diskspace|snapshot|snapshotAge"
      - metric_suffix: "guest_tools_running_status"
        key: "summary|guest|toolsRunningStatus"
      - metric_suffix: "guest_tools_version_status"
        key: "summary|guest|toolsVersionStatus2"

    VMStatsMemoryCollector:
    # INFO - Prefix: vrops_virtualmachine_
      - metric_suffix: "memory_usage_average"
        key: "mem|usage_average"
      - metric_suffix: "memory_kilobytes"
        key: "mem|guest_provisioned"
      - metric_suffix: "memory_consumed_kilobytes"
        key: "mem|consumed_average"
      - metric_suffix: "memory_activewrite_kilobytes"
        key: "mem|activewrite_average"
      - metric_suffix: "memory_active_ratio"
        key: "mem|guest_activePct"
      - metric_suffix: "memory_ballooning_ratio"
        key: "mem|balloonPct"
      - metric_suffix: "memory_contention_ratio"
        key: "mem|host_contentionPct"
      - metric_suffix: "swapped_memory_kilobytes"
        key: "mem|swapped_average"
      - metric_suffix: "swapin_memory_kilobytes"
        key: "mem|swapinRate_average"

    VMStatsCPUCollector:
    # INFO - Prefix: vrops_virtualmachine_
      - metric_suffix: "number_vcpus_total"
        key: "config|hardware|num_Cpu"
      - metric_suffix: "cpu_demand_ratio"
        key: "cpu|demandPct"
      - metric_suffix: "cpu_usage_ratio"
        key: "cpu|usage_average"
      - metric_suffix: "cpu_usage_average_mhz"
        key: "cpu|usagemhz_average"
      - metric_suffix: "cpu_workload_percentage"
        key: "cpu|workload"
      - metric_suffix: "cpu_contention_ratio"
        key: "cpu|capacity_contentionPct"
      - metric_suffix: "cpu_ready_ratio"
        key: "cpu|readyPct"
      - metric_suffix: "cpu_latency_average"
        key: "cpu|latency_average"
      - metric_suffix: "cpu_wait_summation_miliseconds"
        key: "cpu|wait_summation"
      - metric_suffix: "cpu_io_wait_percentage"
        key: "cpu|iowaitPct"

    VMStatsNetworkCollector:
    # INFO - Prefix: vrops_virtualmachine_
      - metric_suffix: "network_packets_dropped_rx_number"
        key: "net|droppedRx_summation"
      - metric_suffix: "network_packets_dropped_tx_number"
        key: "net|droppedTx_summation"
      - metric_suffix: "network_packets_rx_number"
        key: "net|packetsRx_summation"
      - metric_suffix: "network_packets_tx_number"
        key: "net|packetsTx_summation"
      - metric_suffix: "network_usage_average_kilobytes_per_second"
        key: "net|usage_average"
      - metric_suffix: "network_data_received_kilobytes_per_second"
        key: "net|bytesRx_average"
      - metric_suffix: "network_data_transmitted_kilobytes_per_second"
        key: "net|bytesTx_average"

    VMStatsVirtualDiskCollector:
    # INFO - Prefix: vrops_virtualmachine_
      - metric_suffix: "virtual_disk_outstanding_io"
        key: "virtualDisk|vDiskOIO"
      - metric_suffix: "virtual_disk_read_kilobytes_per_second"
        key: "virtualDisk|read_average"
      - metric_suffix: "virtual_disk_write_kilobytes_per_second"
        key: "virtualDisk|write_average"
      - metric_suffix: "virtual_disk_outstanding_read_number"
        key: "virtualDisk|readOIO_latest"
      - metric_suffix: "virtual_disk_outstanding_write_number"
        key: "virtualDisk|writeOIO_latest"
      - metric_suffix: "virtual_disk_average_read_miliseconds"
        key: "virtualDisk|totalReadLatency_average"
      - metric_suffix: "virtual_disk_average_write_miliseconds"
        key: "virtualDisk|totalWriteLatency_average"

    VMStatsDefaultCollector:
    # INFO - Prefix: vrops_virtualmachine_
      - metric_suffix: "health"
        key: "badge|health"
      - metric_suffix: "disk_usage_average_kilobytes_per_second"
        key: "disk|usage_average"
      - metric_suffix: "diskspace_virtual_machine_used_gigabytes"
        key: "diskspace|perDsUsed"
      - metric_suffix: "diskspace_gigabytes"
        key: "config|hardware|disk_Space"
      - metric_suffix: "datastore_total"
        key: "summary|number_datastore"
      - metric_suffix: "datastore_outstanding_io_requests"
        key: "datastore|demand_oio"
      - metric_suffix: "database_disk_usage_gigabytes"
        key: "guestfilesystem:/storage/db|usage"
      - metric_suffix: "database_disk_capacity_gigabytes"
        key: "guestfilesystem:/storage/db|capacity"
      - metric_suffix: "database_disk_usage_percent"
        key: "guestfilesystem:/storage/db|percentage"
      - metric_suffix: "guestfilesystem_storage_log_usage"
        key: "guestfilesystem:/storage/log|usage"
      - metric_suffix: "guestfilesystem_storage_log_capacity"
        key: "guestfilesystem:/storage/log|capacity"
      - metric_suffix: "guestfilesystem_storage_log_percentage"
        key: "guestfilesystem:/storage/log|percentage"
      - metric_suffix: "guestfilesystem_storage_autodeploy_usage"
        key: "guestfilesystem:/storage/autodeploy|usage"
      - metric_suffix: "guestfilesystem_storage_autodeploy_capacity"
        key: "guestfilesystem:/storage/autodeploy|capacity"
      - metric_suffix: "guestfilesystem_storage_autodeploy_percentage"
        key: "guestfilesystem:/storage/autodeploy|percentage"
      - metric_suffix: "guestfilesystem_storage_core_usage"
        key: "guestfilesystem:/storage/core|usage"
      - metric_suffix: "guestfilesystem_storage_core_capacity"
        key: "guestfilesystem:/storage/core|capacity"
      - metric_suffix: "guestfilesystem_storage_core_percentage"
        key: "guestfilesystem:/storage/core|percentage"
      - metric_suffix: "guestfilesystem_storage_dblog_usage"
        key: "guestfilesystem:/storage/dblog|usage"
      - metric_suffix: "guestfilesystem_storage_dblog_capacity"
        key: "guestfilesystem:/storage/dblog|capacity"
      - metric_suffix: "guestfilesystem_storage_dblog_percentage"
        key: "guestfilesystem:/storage/dblog|percentage"
      - metric_suffix: "guestfilesystem_storage_imagebuilder_usage"
        key: "guestfilesystem:/storage/imagebuilder|usage"
      - metric_suffix: "guestfilesystem_storage_imagebuilder_capacity"
        key: "guestfilesystem:/storage/imagebuilder|capacity"
      - metric_suffix: "guestfilesystem_storage_imagebuilder_percentage"
        key: "guestfilesystem:/storage/imagebuilder|percentage"
      - metric_suffix: "guestfilesystem_storage_netdump_usage"
        key: "guestfilesystem:/storage/netdump|usage"
      - metric_suffix: "guestfilesystem_storage_netdump_capacity"
        key: "guestfilesystem:/storage/netdump|capacity"
      - metric_suffix: "guestfilesystem_storage_netdump_percentage"
        key: "guestfilesystem:/storage/netdump|percentage"
      - metric_suffix: "guestfilesystem_storage_seat_usage"
        key: "guestfilesystem:/storage/seat|usage"
      - metric_suffix: "guestfilesystem_storage_seat_capacity"
        key: "guestfilesystem:/storage/seat|capacity"
      - metric_suffix: "guestfilesystem_storage_seat_percentage"
        key: "guestfilesystem:/storage/seat|percentage"
      - metric_suffix: "guestfilesystem_storage_updatemgr_usage"
        key: "guestfilesystem:/storage/updatemgr|usage"
      - metric_suffix: "guestfilesystem_storage_updatemgr_capacity"
        key: "guestfilesystem:/storage/updatemgr|capacity"
      - metric_suffix: "guestfilesystem_storage_updatemgr_percentage"
        key: "guestfilesystem:/storage/updatemgr|percentage"
      - metric_suffix: "guestfilesystem_boot_usage"
        key: "guestfilesystem:/boot|usage"
      - metric_suffix: "guestfilesystem_boot_capacity"
        key: "guestfilesystem:/boot|capacity"
      - metric_suffix: "guestfilesystem_boot_percentage"
        key: "guestfilesystem:/boot|percentage"
      - metric_suffix: "guestfilesystem_usage"
        key: "guestfilesystem:/|usage"
      - metric_suffix: "guestfilesystem_capacity"
        key: "guestfilesystem:/|capacity"
      - metric_suffix: "guestfilesystem_percentage"
        key: "guestfilesystem:/|percentage"

    NSXTMgmtClusterStatsCollector:
    # INFO - Prefix: vrops_nsxt_mgmt_cluster_
      - metric_suffix: "sys_capacity_distributed_firewall_rules_usage_count"
        key: "System Capacity|Distributed Firewall Rules|UsageCount"
      - metric_suffix: "sys_capacity_distributed_firewall_rules_max_supported_count"
        key: "System Capacity|Distributed Firewall Rules|MaxSupportedCount"
      - metric_suffix: "sys_capacity_distributed_firewall_section_max_supported_count"
        key: "System Capacity|Distributed Firewall Sections|MaxSupportedCount"
      - metric_suffix: "sys_capacity_distributed_firewall_section_usage_count"
        key: "System Capacity|Distributed Firewall Sections|UsageCount"
      - metric_suffix: "sys_capacity_logical_switches_max_supported_count"
        key: "System Capacity|Logical Switches|MaxSupportedCount"
      - metric_suffix: "sys_capacity_logical_switches_usage_count"
        key: "System Capacity|Logical Switches|UsageCount"
      - metric_suffix: "sys_capacity_logical_switch_ports_max_supported_count"
        key: "System Capacity|System-wide Logical Switch Ports|MaxSupportedCount"
      - metric_suffix: "sys_capacity_logical_switch_ports_usage_count"
        key: "System Capacity|System-wide Logical Switch Ports|UsageCount"
      - metric_suffix: "sys_capacity_nsgroups_max_supported_count"
        key: "System Capacity|Groups|MaxSupportedCount"
      - metric_suffix: "sys_capacity_nsgroups_usage_count"
        key: "System Capacity|Groups|UsageCount"
      - metric_suffix: "sys_capacity_ip_sets_max_supported_count"
        key: "System Capacity|IP Sets|MaxSupportedCount"
      - metric_suffix: "sys_capacity_ip_sets_usage_count"
        key: "System Capacity|IP Sets|UsageCount"
      - metric_suffix: "sys_capacity_groups_based_in_ip_max_supported_count"
        key: "System Capacity|Groups Based on IP Sets|MaxSupportedCount"
      - metric_suffix: "sys_capacity_groups_based_in_ip_usage_count"
        key: "System Capacity|Groups Based on IP Sets|UsageCount"

    NSXTMgmtClusterPropertiesCollector:
    # INFO - Prefix: vrops_nsxt_mgmt_cluster_
      - metric_suffix: "product_version"
        key: "NSXTProductVersion"
      - metric_suffix: "management_cluster_connectivity_status"
        expected: "STABLE"
        key: "ConnectivityStatus|ClusterStatus|ManagementClusterStatusProperty"
      - metric_suffix: "controller_cluster_connectivity_status"
        expected: "STABLE"
        key: "ConnectivityStatus|ClusterStatus|ControllerClusterStatusProperty"

    NSXTMgmtNodeStatsCollector:
    # INFO - Prefix: vrops_nsxt_mgmt_node_
      - metric_suffix: "memory_used"
        key: "Memory|Used"
      - metric_suffix: "memory_total"
        key: "Memory|Total"
      - metric_suffix: "filesystems_var_log_usedpercentage"
        key: "FileSystems|/var/log|usedPercentage"
      - metric_suffix: "filesystems_image_usedpercentage"
        key: "FileSystems|/image|usedPercentage"

    NSXTMgmtNodePropertiesCollector:
    # INFO - Prefix: vrops_nsxt_mgmt_node_
      - metric_suffix: "version"
        key: "NSXTManagerNodeVersion"
      - metric_suffix: "connectivity_status"
        expected: "CONNECTED"
        key: "ConnectivityStatus|ManagerConnectivityProperty"
        
    NSXTTransportNodePropertiesCollector:
    # INFO - Prefix: vrops_nsxt_transport_node_
      - metric_suffix: "connectivity_status"
        expected: "SUCCESS"
        key: "ConnectivityStatus|TransportNodeState"
      - metric_suffix: "summary_version"
        key: "summary|SoftwareVersion"
