0
0
Fork 0
mirror of https://github.com/netdata/netdata.git synced 2025-04-14 01:29:11 +00:00

remove go.d/windows ()

This commit is contained in:
Ilya Mashchenko 2024-12-27 20:27:02 +02:00 committed by GitHub
parent 3f1a1bd55e
commit 9069ef33af
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
35 changed files with 0 additions and 13191 deletions

View file

@ -144,7 +144,6 @@ All capabilities are set automatically during Netdata installation using the [of
| [web_log](https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/collector/weblog) | Apache/NGINX |
| [wireguard](https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/collector/wireguard) | WireGuard |
| [whoisquery](https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/collector/whoisquery) | Domain Expiry |
| [windows](https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/collector/windows) | Windows |
| [x509check](https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/collector/x509check) | Digital Certificates |
| [zfspool](https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/collector/zfspool) | ZFS Pools |
| [zookeeper](https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/collector/zookeeper) | ZooKeeper |

View file

@ -121,7 +121,6 @@ import (
_ "github.com/netdata/netdata/go/plugins/plugin/go.d/collector/w1sensor"
_ "github.com/netdata/netdata/go/plugins/plugin/go.d/collector/weblog"
_ "github.com/netdata/netdata/go/plugins/plugin/go.d/collector/whoisquery"
_ "github.com/netdata/netdata/go/plugins/plugin/go.d/collector/windows"
_ "github.com/netdata/netdata/go/plugins/plugin/go.d/collector/wireguard"
_ "github.com/netdata/netdata/go/plugins/plugin/go.d/collector/x509check"
_ "github.com/netdata/netdata/go/plugins/plugin/go.d/collector/zfspool"

View file

@ -1,837 +0,0 @@
# Windows
<img src="https://netdata.cloud/img/windows.svg" width="150"/>
Plugin: go.d.plugin
Module: windows
<img src="https://img.shields.io/badge/maintained%20by-Netdata-%2300ab44" />
## Overview
**Deprecation Notice**: This collector is no longer the recommended method for Windows monitoring and will be removed in a future release.
The official Netdata Agent for Windows now provides a robust and user-friendly solution for real-time system and application performance monitoring. By installing Netdata on your Windows host, you'll gain access to a wide range of metrics and visualizations without the need for additional collectors or complex configurations.
To get started with Netdata on Windows, see the [Netdata Windows Installer](https://github.com/netdata/netdata/blob/master/packaging/windows/WINDOWS_INSTALLER.md).
---
This collector monitors the performance of Windows machines, collects both host metrics and metrics from various Windows applications (e.g. Active Directory, MSSQL).
It collect metrics by periodically sending HTTP requests to [Prometheus exporter for Windows machines](https://github.com/prometheus-community/windows_exporter), a native Windows Agent running on each host.
This collector is supported on all platforms.
This collector supports collecting metrics from multiple instances of this integration, including remote instances.
### Default Behavior
#### Auto-Detection
This integration doesn't support auto-detection.
#### Limits
The default configuration for this integration does not impose any limits on data collection.
#### Performance Impact
Data collection affects the CPU usage of the Windows host. CPU usage depends on the frequency of data collection and the [enabled collectors](https://github.com/prometheus-community/windows_exporter#collectors).
## Metrics
Metrics grouped by *scope*.
The scope defines the instance that the metric belongs to. An instance is uniquely identified by a set of labels.
The collected set of metrics depends on the [enabled collectors](https://github.com/prometheus-community/windows_exporter#collectors).
Supported collectors:
- [cpu](https://github.com/prometheus-community/windows_exporter/blob/master/docs/collector.cpu.md)
- [iis](https://github.com/prometheus-community/windows_exporter/blob/master/docs/collector.iis.md)
- [memory](https://github.com/prometheus-community/windows_exporter/blob/master/docs/collector.memory.md)
- [net](https://github.com/prometheus-community/windows_exporter/blob/master/docs/collector.net.md)
- [logical_disk](https://github.com/prometheus-community/windows_exporter/blob/master/docs/collector.logical_disk.md)
- [os](https://github.com/prometheus-community/windows_exporter/blob/master/docs/collector.os.md)
- [system](https://github.com/prometheus-community/windows_exporter/blob/master/docs/collector.system.md)
- [logon](https://github.com/prometheus-community/windows_exporter/blob/master/docs/collector.logon.md)
- [tcp](https://github.com/prometheus-community/windows_exporter/blob/master/docs/collector.tcp.md)
- [thermalzone](https://github.com/prometheus-community/windows_exporter/blob/master/docs/collector.thermalzone.md)
- [process](https://github.com/prometheus-community/windows_exporter/blob/master/docs/collector.process.md)
- [service](https://github.com/prometheus-community/windows_exporter/blob/master/docs/collector.service.md)
- [mssql](https://github.com/prometheus-community/windows_exporter/blob/master/docs/collector.mssql.md)
- [ad](https://github.com/prometheus-community/windows_exporter/blob/master/docs/collector.ad.md)
- [adcs](https://github.com/prometheus-community/windows_exporter/blob/master/docs/collector.adcs.md)
- [adfs](https://github.com/prometheus-community/windows_exporter/blob/master/docs/collector.adfs.md)
- [netframework_clrexceptions](https://github.com/prometheus-community/windows_exporter/blob/master/docs/collector.netframework.md#clr-exceptions)
- [netframework_clrinterop](https://github.com/prometheus-community/windows_exporter/blob/master/docs/collector.netframework.md#clr-interop)
- [netframework_clrjit](https://github.com/prometheus-community/windows_exporter/blob/master/docs/collector.netframework.md#clr-jit)
- [netframework_clrloading](https://github.com/prometheus-community/windows_exporter/blob/master/docs/collector.netframework.md#clr-loading)
- [netframework_clrlocksandthreads](https://github.com/prometheus-community/windows_exporter/blob/master/docs/collector.netframework.md#clr-locks-and-threads)
- [netframework_clrmemory](https://github.com/prometheus-community/windows_exporter/blob/master/docs/collector.netframework.md#clr-memory)
- [netframework_clrremoting](https://github.com/prometheus-community/windows_exporter/blob/master/docs/collector.netframework.md#clr-remoting)
- [exchange](https://github.com/prometheus-community/windows_exporter/blob/master/docs/collector.exchange.md)
- [hyperv](https://github.com/prometheus-community/windows_exporter/blob/master/docs/collector.hyperv.md)
### Per Active Directory instance
These metrics refer to the entire monitored host.
This scope has no labels.
Metrics:
| Metric | Dimensions | Unit |
|:------|:----------|:----|
| windows.cpu_utilization_total | dpc, user, privileged, interrupt | percentage |
| windows.memory_utilization | available, used | bytes |
| windows.memory_page_faults | page_faults | events/s |
| windows.memory_swap_utilization | available, used | bytes |
| windows.memory_swap_operations | read, write | operations/s |
| windows.memory_swap_pages | read, written | pages/s |
| windows.memory_cached | cached | KiB |
| windows.memory_cache_faults | cache_faults | events/s |
| windows.memory_system_pool | paged, non-paged | bytes |
| windows.tcp_conns_established | ipv4, ipv6 | connections |
| windows.tcp_conns_active | ipv4, ipv6 | connections/s |
| windows.tcp_conns_passive | ipv4, ipv6 | connections/s |
| windows.tcp_conns_failures | ipv4, ipv6 | failures/s |
| windows.tcp_conns_resets | ipv4, ipv6 | resets/s |
| windows.tcp_segments_received | ipv4, ipv6 | segments/s |
| windows.tcp_segments_sent | ipv4, ipv6 | segments/s |
| windows.tcp_segments_retransmitted | ipv4, ipv6 | segments/s |
| windows.os_processes | processes | number |
| windows.os_users | users | users |
| windows.os_visible_memory_usage | free, used | bytes |
| windows.os_paging_files_usage | free, used | bytes |
| windows.system_threads | threads | number |
| windows.system_uptime | time | seconds |
| windows.logon_type_sessions | system, interactive, network, batch, service, proxy, unlock, network_clear_text, new_credentials, remote_interactive, cached_interactive, cached_remote_interactive, cached_unlock | seconds |
| windows.processes_cpu_utilization | a dimension per process | percentage |
| windows.processes_handles | a dimension per process | handles |
| windows.processes_io_bytes | a dimension per process | bytes/s |
| windows.processes_io_operations | a dimension per process | operations/s |
| windows.processes_page_faults | a dimension per process | pgfaults/s |
| windows.processes_page_file_bytes | a dimension per process | bytes |
| windows.processes_pool_bytes | a dimension per process | bytes |
| windows.processes_threads | a dimension per process | threads |
| ad.database_operations | add, delete, modify, recycle | operations/s |
| ad.directory_operations | read, write, search | operations/s |
| ad.name_cache_lookups | lookups | lookups/s |
| ad.name_cache_hits | hits | hits/s |
| ad.atq_average_request_latency | time | seconds |
| ad.atq_outstanding_requests | outstanding | requests |
| ad.dra_replication_intersite_compressed_traffic | inbound, outbound | bytes/s |
| ad.dra_replication_intrasite_compressed_traffic | inbound, outbound | bytes/s |
| ad.dra_replication_sync_objects_remaining | inbound, outbound | objects |
| ad.dra_replication_objects_filtered | inbound, outbound | objects/s |
| ad.dra_replication_properties_updated | inbound, outbound | properties/s |
| ad.dra_replication_properties_filtered | inbound, outbound | properties/s |
| ad.dra_replication_pending_syncs | pending | syncs |
| ad.dra_replication_sync_requests | requests | requests/s |
| ad.ds_threads | in_use | threads |
| ad.ldap_last_bind_time | last_bind | seconds |
| ad.binds | binds | binds/s |
| ad.ldap_searches | searches | searches/s |
| adfs.ad_login_connection_failures | connection | failures/s |
| adfs.certificate_authentications | authentications | authentications/s |
| adfs.db_artifact_failures | connection | failures/s |
| adfs.db_artifact_query_time_seconds | query_time | seconds/s |
| adfs.db_config_failures | connection | failures/s |
| adfs.db_config_query_time_seconds | query_time | seconds/s |
| adfs.device_authentications | authentications | authentications/s |
| adfs.external_authentications | success, failure | authentications/s |
| adfs.federated_authentications | authentications | authentications/s |
| adfs.federation_metadata_requests | requests | requests/s |
| adfs.oauth_authorization_requests | requests | requests/s |
| adfs.oauth_client_authentications | success, failure | authentications/s |
| adfs.oauth_client_credentials_requests | success, failure | requests/s |
| adfs.oauth_client_privkey_jwt_authentications | success, failure | authentications/s |
| adfs.oauth_client_secret_basic_authentications | success, failure | authentications/s |
| adfs.oauth_client_secret_post_authentications | success, failure | authentications/s |
| adfs.oauth_client_windows_authentications | success, failure | authentications/s |
| adfs.oauth_logon_certificate_requests | success, failure | requests/s |
| adfs.oauth_password_grant_requests | success, failure | requests/s |
| adfs.oauth_token_requests_success | success | requests/s |
| adfs.passive_requests | passive | requests/s |
| adfs.passport_authentications | passport | authentications/s |
| adfs.password_change_requests | success, failure | requests/s |
| adfs.samlp_token_requests_success | success | requests/s |
| adfs.sso_authentications | success, failure | authentications/s |
| adfs.token_requests | requests | requests/s |
| adfs.userpassword_authentications | success, failure | authentications/s |
| adfs.windows_integrated_authentications | authentications | authentications/s |
| adfs.wsfed_token_requests_success | success | requests/s |
| adfs.wstrust_token_requests_success | success | requests/s |
| exchange.activesync_ping_cmds_pending | pending | commands |
| exchange.activesync_requests | received | requests/s |
| exchange.activesync_sync_cmds | processed | commands/s |
| exchange.autodiscover_requests | processed | requests/s |
| exchange.avail_service_requests | serviced | requests/s |
| exchange.owa_current_unique_users | logged-in | users |
| exchange.owa_requests_total | handled | requests/s |
| exchange.rpc_active_user_count | active | users |
| exchange.rpc_avg_latency | latency | seconds |
| exchange.rpc_connection_count | connections | connections |
| exchange.rpc_operations | operations | operations/s |
| exchange.rpc_requests | processed | requests |
| exchange.rpc_user_count | users | users |
| exchange.transport_queues_active_mail_box_delivery | low, high, none, normal | messages/s |
| exchange.transport_queues_external_active_remote_delivery | low, high, none, normal | messages/s |
| exchange.transport_queues_external_largest_delivery | low, high, none, normal | messages/s |
| exchange.transport_queues_internal_active_remote_delivery | low, high, none, normal | messages/s |
| exchange.transport_queues_internal_largest_delivery | low, high, none, normal | messages/s |
| exchange.transport_queues_retry_mailbox_delivery | low, high, none, normal | messages/s |
| exchange.transport_queues_poison | low, high, none, normal | messages/s |
| hyperv.vms_health | ok, critical | vms |
| hyperv.root_partition_device_space_pages | 4K, 2M, 1G | pages |
| hyperv.root_partition_gpa_space_pages | 4K, 2M, 1G | pages |
| hyperv.root_partition_gpa_space_modifications | gpa | modifications/s |
| hyperv.root_partition_attached_devices | attached | devices |
| hyperv.root_partition_deposited_pages | deposited | pages |
| hyperv.root_partition_skipped_interrupts | skipped | interrupts |
| hyperv.root_partition_device_dma_errors | illegal_dma | requests |
| hyperv.root_partition_device_interrupt_errors | illegal_interrupt | requests |
| hyperv.root_partition_device_interrupt_throttle_events | throttling | events |
| hyperv.root_partition_io_tlb_flush | flushes | flushes/s |
| hyperv.root_partition_address_space | address_spaces | address spaces |
| hyperv.root_partition_virtual_tlb_flush_entries | flushes | flushes/s |
| hyperv.root_partition_virtual_tlb_pages | used | pages |
### Per cpu core
TBD
Labels:
| Label | Description |
|:-----------|:----------------|
| core | TBD |
Metrics:
| Metric | Dimensions | Unit |
|:------|:----------|:----|
| windows.cpu_core_utilization | dpc, user, privileged, interrupt | percentage |
| windows.cpu_core_interrupts | interrupts | interrupts/s |
| windows.cpu_core_dpcs | dpcs | dpcs/s |
| windows.cpu_core_cstate | c1, c2, c3 | percentage |
### Per logical disk
TBD
Labels:
| Label | Description |
|:-----------|:----------------|
| disk | TBD |
Metrics:
| Metric | Dimensions | Unit |
|:------|:----------|:----|
| windows.logical_disk_utilization | free, used | bytes |
| windows.logical_disk_bandwidth | read, write | bytes/s |
| windows.logical_disk_operations | reads, writes | operations/s |
| windows.logical_disk_latency | read, write | seconds |
### Per network device
TBD
Labels:
| Label | Description |
|:-----------|:----------------|
| nic | TBD |
Metrics:
| Metric | Dimensions | Unit |
|:------|:----------|:----|
| windows.net_nic_bandwidth | received, sent | kilobits/s |
| windows.net_nic_packets | received, sent | packets/s |
| windows.net_nic_errors | inbound, outbound | errors/s |
| windows.net_nic_discarded | inbound, outbound | discards/s |
### Per thermalzone
TBD
Labels:
| Label | Description |
|:-----------|:----------------|
| thermalzone | TBD |
Metrics:
| Metric | Dimensions | Unit |
|:------|:----------|:----|
| windows.thermalzone_temperature | temperature | celsius |
### Per service
TBD
Labels:
| Label | Description |
|:-----------|:----------------|
| service | TBD |
Metrics:
| Metric | Dimensions | Unit |
|:------|:----------|:----|
| windows.service_state | running, stopped, start_pending, stop_pending, continue_pending, pause_pending, paused, unknown | state |
| windows.service_status | ok, error, unknown, degraded, pred_fail, starting, stopping, service, stressed, nonrecover, no_contact, lost_comm | status |
### Per website
TBD
Labels:
| Label | Description |
|:-----------|:----------------|
| website | TBD |
Metrics:
| Metric | Dimensions | Unit |
|:------|:----------|:----|
| iis.website_traffic | received, sent | bytes/s |
| iis.website_requests_rate | requests | requests/s |
| iis.website_active_connections_count | active | connections |
| iis.website_users_count | anonymous, non_anonymous | users |
| iis.website_connection_attempts_rate | connection | attempts/s |
| iis.website_isapi_extension_requests_count | isapi | requests |
| iis.website_isapi_extension_requests_rate | isapi | requests/s |
| iis.website_ftp_file_transfer_rate | received, sent | files/s |
| iis.website_logon_attempts_rate | logon | attempts/s |
| iis.website_errors_rate | document_locked, document_not_found | errors/s |
| iis.website_uptime | uptime | seconds |
### Per mssql instance
TBD
Labels:
| Label | Description |
|:-----------|:----------------|
| mssql_instance | TBD |
Metrics:
| Metric | Dimensions | Unit |
|:------|:----------|:----|
| mssql.instance_accessmethods_page_splits | page | splits/s |
| mssql.instance_cache_hit_ratio | hit_ratio | percentage |
| mssql.instance_bufman_checkpoint_pages | flushed | pages/s |
| mssql.instance_bufman_page_life_expectancy | life_expectancy | seconds |
| mssql.instance_bufman_iops | read, written | iops |
| mssql.instance_blocked_processes | blocked | processes |
| mssql.instance_user_connection | user | connections |
| mssql.instance_locks_lock_wait | alloc_unit, application, database, extent, file, hobt, key, metadata, oib, object, page, rid, row_group, xact | locks/s |
| mssql.instance_locks_deadlocks | alloc_unit, application, database, extent, file, hobt, key, metadata, oib, object, page, rid, row_group, xact | locks/s |
| mssql.instance_memmgr_connection_memory_bytes | memory | bytes |
| mssql.instance_memmgr_external_benefit_of_memory | benefit | bytes |
| mssql.instance_memmgr_pending_memory_grants | pending | processes |
| mssql.instance_memmgr_server_memory | memory | bytes |
| mssql.instance_sql_errors | db_offline, info, kill_connection, user | errors |
| mssql.instance_sqlstats_auto_parameterization_attempts | failed | attempts/s |
| mssql.instance_sqlstats_batch_requests | batch | requests/s |
| mssql.instance_sqlstats_safe_auto_parameterization_attempts | safe | attempts/s |
| mssql.instance_sqlstats_sql_compilations | compilations | compilations/s |
| mssql.instance_sqlstats_sql_recompilations | recompiles | recompiles/s |
### Per database
TBD
Labels:
| Label | Description |
|:-----------|:----------------|
| mssql_instance | TBD |
| database | TBD |
Metrics:
| Metric | Dimensions | Unit |
|:------|:----------|:----|
| mssql.database_active_transactions | active | transactions |
| mssql.database_backup_restore_operations | backup | operations/s |
| mssql.database_data_files_size | size | bytes |
| mssql.database_log_flushed | flushed | bytes/s |
| mssql.database_log_flushes | log | flushes/s |
| mssql.database_transactions | transactions | transactions/s |
| mssql.database_write_transactions | write | transactions/s |
### Per certificate template
TBD
Labels:
| Label | Description |
|:-----------|:----------------|
| cert_template | TBD |
Metrics:
| Metric | Dimensions | Unit |
|:------|:----------|:----|
| adcs.cert_template_requests | requests | requests/s |
| adcs.cert_template_failed_requests | failed | requests/s |
| adcs.cert_template_issued_requests | issued | requests/s |
| adcs.cert_template_pending_requests | pending | requests/s |
| adcs.cert_template_request_processing_time | processing_time | seconds |
| adcs.cert_template_retrievals | retrievals | retrievals/s |
| adcs.cert_template_retrieval_processing_time | processing_time | seconds |
| adcs.cert_template_request_cryptographic_signing_time | singing_time | seconds |
| adcs.cert_template_request_policy_module_processing | processing_time | seconds |
| adcs.cert_template_challenge_responses | challenge | responses/s |
| adcs.cert_template_challenge_response_processing_time | processing_time | seconds |
| adcs.cert_template_signed_certificate_timestamp_lists | processed | lists/s |
| adcs.cert_template_signed_certificate_timestamp_list_processing_time | processing_time | seconds |
### Per process
TBD
Labels:
| Label | Description |
|:-----------|:----------------|
| process | TBD |
Metrics:
| Metric | Dimensions | Unit |
|:------|:----------|:----|
| netframework.clrexception_thrown | exceptions | exceptions/s |
| netframework.clrexception_filters | filters | filters/s |
| netframework.clrexception_finallys | finallys | finallys/s |
| netframework.clrexception_throw_to_catch_depth | traversed | stack_frames/s |
| netframework.clrinterop_com_callable_wrappers | com_callable_wrappers | ccw/s |
| netframework.clrinterop_interop_marshallings | marshallings | marshallings/s |
| netframework.clrinterop_interop_stubs_created | created | stubs/s |
| netframework.clrjit_methods | jit-compiled | methods/s |
| netframework.clrjit_time | time | percentage |
| netframework.clrjit_standard_failures | failures | failures/s |
| netframework.clrjit_il_bytes | compiled_msil | bytes/s |
| netframework.clrloading_loader_heap_size | committed | bytes |
| netframework.clrloading_appdomains_loaded | loaded | domain/s |
| netframework.clrloading_appdomains_unloaded | unloaded | domain/s |
| netframework.clrloading_assemblies_loaded | loaded | assemblies/s |
| netframework.clrloading_classes_loaded | loaded | classes/s |
| netframework.clrloading_class_load_failures | class_load | failures/s |
| netframework.clrlocksandthreads_queue_length | threads | threads/s |
| netframework.clrlocksandthreads_current_logical_threads | logical | threads |
| netframework.clrlocksandthreads_current_physical_threads | physical | threads |
| netframework.clrlocksandthreads_recognized_threads | threads | threads/s |
| netframework.clrlocksandthreads_contentions | contentions | contentions/s |
| netframework.clrmemory_allocated_bytes | allocated | bytes/s |
| netframework.clrmemory_finalization_survivors | survived | objects |
| netframework.clrmemory_heap_size | heap | bytes |
| netframework.clrmemory_promoted | promoted | bytes |
| netframework.clrmemory_number_gc_handles | used | handles |
| netframework.clrmemory_collections | gc | gc/s |
| netframework.clrmemory_induced_gc | gc | gc/s |
| netframework.clrmemory_number_pinned_objects | pinned | objects |
| netframework.clrmemory_number_sink_blocks_in_use | used | blocks |
| netframework.clrmemory_committed | committed | bytes |
| netframework.clrmemory_reserved | reserved | bytes |
| netframework.clrmemory_gc_time | time | percentage |
| netframework.clrremoting_channels | registered | channels/s |
| netframework.clrremoting_context_bound_classes_loaded | loaded | classes |
| netframework.clrremoting_context_bound_objects | allocated | objects/s |
| netframework.clrremoting_context_proxies | objects | objects/s |
| netframework.clrremoting_contexts | contexts | contexts |
| netframework.clrremoting_remote_calls | rpc | calls/s |
| netframework.clrsecurity_link_time_checks | linktime | checks/s |
| netframework.clrsecurity_checks_time | time | percentage |
| netframework.clrsecurity_stack_walk_depth | stack | depth |
| netframework.clrsecurity_runtime_checks | runtime | checks/s |
### Per exchange workload
TBD
Labels:
| Label | Description |
|:-----------|:----------------|
| workload | TBD |
Metrics:
| Metric | Dimensions | Unit |
|:------|:----------|:----|
| exchange.workload_active_tasks | active | tasks |
| exchange.workload_completed_tasks | completed | tasks/s |
| exchange.workload_queued_tasks | queued | tasks/s |
| exchange.workload_yielded_tasks | yielded | tasks/s |
| exchange.workload_activity_status | active, paused | status |
### Per ldap process
TBD
Labels:
| Label | Description |
|:-----------|:----------------|
| workload | TBD |
Metrics:
| Metric | Dimensions | Unit |
|:------|:----------|:----|
| exchange.ldap_long_running_ops_per_sec | long-running | operations/s |
| exchange.ldap_read_time | read | seconds |
| exchange.ldap_search_time | search | seconds |
| exchange.ldap_write_time | write | seconds |
| exchange.ldap_timeout_errors | timeout | errors/s |
### Per http proxy
TBD
Labels:
| Label | Description |
|:-----------|:----------------|
| workload | TBD |
Metrics:
| Metric | Dimensions | Unit |
|:------|:----------|:----|
| exchange.http_proxy_avg_auth_latency | latency | seconds |
| exchange.http_proxy_avg_cas_processing_latency_sec | latency | seconds |
| exchange.http_proxy_mailbox_proxy_failure_rate | failures | percentage |
| exchange.http_proxy_mailbox_server_locator_avg_latency_sec | latency | seconds |
| exchange.http_proxy_outstanding_proxy_requests | outstanding | requests |
| exchange.http_proxy_requests | processed | requests/s |
### Per vm
TBD
Labels:
| Label | Description |
|:-----------|:----------------|
| vm_name | TBD |
Metrics:
| Metric | Dimensions | Unit |
|:------|:----------|:----|
| hyperv.vm_cpu_usage | gues, hypervisor, remote | percentage |
| hyperv.vm_memory_physical | assigned_memory | MiB |
| hyperv.vm_memory_physical_guest_visible | visible_memory | MiB |
| hyperv.vm_memory_pressure_current | pressure | percentage |
| hyperv.vm_vid_physical_pages_allocated | allocated | pages |
| hyperv.vm_vid_remote_physical_pages | remote_physical | pages |
### Per vm device
TBD
Labels:
| Label | Description |
|:-----------|:----------------|
| vm_device | TBD |
Metrics:
| Metric | Dimensions | Unit |
|:------|:----------|:----|
| hyperv.vm_device_bytes | read, written | bytes/s |
| hyperv.vm_device_operations | read, write | operations/s |
| hyperv.vm_device_errors | errors | errors/s |
### Per vm interface
TBD
Labels:
| Label | Description |
|:-----------|:----------------|
| vm_interface | TBD |
Metrics:
| Metric | Dimensions | Unit |
|:------|:----------|:----|
| hyperv.vm_interface_bytes | received, sent | bytes/s |
| hyperv.vm_interface_packets | received, sent | packets/s |
| hyperv.vm_interface_packets_dropped | incoming, outgoing | drops/s |
### Per vswitch
TBD
Labels:
| Label | Description |
|:-----------|:----------------|
| vswitch | TBD |
Metrics:
| Metric | Dimensions | Unit |
|:------|:----------|:----|
| hyperv.vswitch_bytes | received, sent | bytes/s |
| hyperv.vswitch_packets | received, sent | packets/s |
| hyperv.vswitch_directed_packets | received, sent | packets/s |
| hyperv.vswitch_broadcast_packets | received, sent | packets/s |
| hyperv.vswitch_multicast_packets | received, sent | packets/s |
| hyperv.vswitch_dropped_packets | incoming, outgoing | drops/s |
| hyperv.vswitch_extensions_dropped_packets | incoming, outgoing | drops/s |
| hyperv.vswitch_packets_flooded | flooded | packets/s |
| hyperv.vswitch_learned_mac_addresses | learned | mac addresses/s |
| hyperv.vswitch_purged_mac_addresses | purged | mac addresses/s |
## Alerts
The following alerts are available:
| Alert name | On metric | Description |
|:------------|:----------|:------------|
| [ windows_10min_cpu_usage ](https://github.com/netdata/netdata/blob/master/src/health/health.d/windows.conf) | windows.cpu_utilization_total | average CPU utilization over the last 10 minutes |
| [ windows_ram_in_use ](https://github.com/netdata/netdata/blob/master/src/health/health.d/windows.conf) | windows.memory_utilization | memory utilization |
| [ windows_inbound_packets_discarded ](https://github.com/netdata/netdata/blob/master/src/health/health.d/windows.conf) | windows.net_nic_discarded | number of inbound discarded packets for the network interface in the last 10 minutes |
| [ windows_outbound_packets_discarded ](https://github.com/netdata/netdata/blob/master/src/health/health.d/windows.conf) | windows.net_nic_discarded | number of outbound discarded packets for the network interface in the last 10 minutes |
| [ windows_inbound_packets_errors ](https://github.com/netdata/netdata/blob/master/src/health/health.d/windows.conf) | windows.net_nic_errors | number of inbound errors for the network interface in the last 10 minutes |
| [ windows_outbound_packets_errors ](https://github.com/netdata/netdata/blob/master/src/health/health.d/windows.conf) | windows.net_nic_errors | number of outbound errors for the network interface in the last 10 minutes |
| [ windows_disk_in_use ](https://github.com/netdata/netdata/blob/master/src/health/health.d/windows.conf) | windows.logical_disk_space_usage | disk space utilization |
## Setup
### Prerequisites
#### Install Windows exporter
To install the Windows exporter, follow the [official installation guide](https://github.com/prometheus-community/windows_exporter#installation).
### Configuration
#### File
The configuration file name for this integration is `go.d/windows.conf`.
You can edit the configuration file using the [`edit-config`](https://github.com/netdata/netdata/blob/master/docs/netdata-agent/configuration/README.md#edit-a-configuration-file-using-edit-config) script from the
Netdata [config directory](https://github.com/netdata/netdata/blob/master/docs/netdata-agent/configuration/README.md#the-netdata-config-directory).
```bash
cd /etc/netdata 2>/dev/null || cd /opt/netdata/etc/netdata
sudo ./edit-config go.d/windows.conf
```
#### Options
The following options can be defined globally: update_every, autodetection_retry.
<details open><summary>Config options</summary>
| Name | Description | Default | Required |
|:----|:-----------|:-------|:--------:|
| update_every | Data collection frequency. | 1 | no |
| autodetection_retry | Recheck interval in seconds. Zero means no recheck will be scheduled. | 0 | no |
| url | Server URL. | | yes |
| timeout | HTTP request timeout. | 1 | no |
| username | Username for basic HTTP authentication. | | no |
| password | Password for basic HTTP authentication. | | no |
| proxy_url | Proxy URL. | | no |
| proxy_username | Username for proxy basic HTTP authentication. | | no |
| proxy_password | Password for proxy basic HTTP authentication. | | no |
| method | HTTP request method. | GET | no |
| body | HTTP request body. | | no |
| headers | HTTP request headers. | | no |
| not_follow_redirects | Redirect handling policy. Controls whether the client follows redirects. | no | no |
| tls_skip_verify | Server certificate chain and hostname validation policy. Controls whether the client performs this check. | no | no |
| tls_ca | Certification authority that the client uses when verifying the server's certificates. | | no |
| tls_cert | Client TLS certificate. | | no |
| tls_key | Client TLS key. | | no |
</details>
#### Examples
##### Basic
A basic example configuration.
```yaml
jobs:
- name: win_server
url: http://192.0.2.1:9182/metrics
```
##### HTTP authentication
Basic HTTP authentication.
<details open><summary>Config</summary>
```yaml
jobs:
- name: win_server
url: http://192.0.2.1:9182/metrics
username: username
password: password
```
</details>
##### HTTPS with self-signed certificate
Do not validate server certificate chain and hostname.
<details open><summary>Config</summary>
```yaml
jobs:
- name: win_server
url: https://192.0.2.1:9182/metrics
tls_skip_verify: yes
```
</details>
##### Virtual Node
The Virtual Node functionality allows you to define nodes in configuration files and treat them as ordinary nodes in all interfaces, panels, tabs, filters, etc.
You can create a virtual node for all your Windows machines and control them as separate entities.
To make your Windows server a virtual node, you need to define virtual nodes in `/etc/netdata/vnodes/vnodes.conf`:
> **Note**: To create a valid guid, you can use the `uuidgen` command on Linux, or the `[guid]::NewGuid()` command in PowerShell on Windows.
```yaml
# /etc/netdata/vnodes/vnodes.conf
- hostname: win_server
guid: <value>
```
<details open><summary>Config</summary>
```yaml
jobs:
- name: win_server
vnode: win_server
url: http://192.0.2.1:9182/metrics
```
</details>
##### Multi-instance
> **Note**: When you define multiple jobs, their names must be unique.
Collecting metrics from multiple remote instances.
<details open><summary>Config</summary>
```yaml
jobs:
- name: win_server1
url: http://192.0.2.1:9182/metrics
- name: win_server2
url: http://192.0.2.2:9182/metrics
```
</details>
## Troubleshooting
### Debug Mode
**Important**: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature.
To troubleshoot issues with the `windows` collector, run the `go.d.plugin` with the debug option enabled. The output
should give you clues as to why the collector isn't working.
- Navigate to the `plugins.d` directory, usually at `/usr/libexec/netdata/plugins.d/`. If that's not the case on
your system, open `netdata.conf` and look for the `plugins` setting under `[directories]`.
```bash
cd /usr/libexec/netdata/plugins.d/
```
- Switch to the `netdata` user.
```bash
sudo -u netdata -s
```
- Run the `go.d.plugin` to debug the collector:
```bash
./go.d.plugin -d -m windows
```
### Getting Logs
If you're encountering problems with the `windows` collector, follow these steps to retrieve logs and identify potential issues:
- **Run the command** specific to your system (systemd, non-systemd, or Docker container).
- **Examine the output** for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem.
#### System with systemd
Use the following command to view logs generated since the last Netdata service restart:
```bash
journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep windows
```
#### System without systemd
Locate the collector log file, typically at `/var/log/netdata/collector.log`, and use `grep` to filter for collector's name:
```bash
grep windows /var/log/netdata/collector.log
```
**Note**: This method shows logs from all restarts. Focus on the **latest entries** for troubleshooting current issues.
#### Docker Container
If your Netdata runs in a Docker container named "netdata" (replace if different), use this command:
```bash
docker logs netdata 2>&1 | grep windows
```

File diff suppressed because it is too large Load diff

View file

@ -1,156 +0,0 @@
// SPDX-License-Identifier: GPL-3.0-or-later
package windows
import (
"github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/prometheus"
)
const precision = 1000
const (
collectorAD = "ad"
collectorADCS = "adcs"
collectorADFS = "adfs"
collectorCPU = "cpu"
collectorMemory = "memory"
collectorNet = "net"
collectorLogicalDisk = "logical_disk"
collectorOS = "os"
collectorSystem = "system"
collectorLogon = "logon"
collectorThermalZone = "thermalzone"
collectorTCP = "tcp"
collectorIIS = "iis"
collectorMSSQL = "mssql"
collectorProcess = "process"
collectorService = "service"
collectorNetFrameworkCLRExceptions = "netframework_clrexceptions"
collectorNetFrameworkCLRInterop = "netframework_clrinterop"
collectorNetFrameworkCLRJIT = "netframework_clrjit"
collectorNetFrameworkCLRLoading = "netframework_clrloading"
collectorNetFrameworkCLRLocksAndThreads = "netframework_clrlocksandthreads"
collectorNetFrameworkCLRMemory = "netframework_clrmemory"
collectorNetFrameworkCLRRemoting = "netframework_clrremoting"
collectorNetFrameworkCLRSecurity = "netframework_clrsecurity"
collectorExchange = "exchange"
collectorHyperv = "hyperv"
)
func (c *Collector) collect() (map[string]int64, error) {
pms, err := c.prom.ScrapeSeries()
if err != nil {
return nil, err
}
mx := make(map[string]int64)
c.collectMetrics(mx, pms)
if hasKey(mx, "os_visible_memory_bytes", "memory_available_bytes") {
mx["memory_used_bytes"] = 0 +
mx["os_visible_memory_bytes"] -
mx["memory_available_bytes"]
}
if hasKey(mx, "os_paging_limit_bytes", "os_paging_free_bytes") {
mx["os_paging_used_bytes"] = 0 +
mx["os_paging_limit_bytes"] -
mx["os_paging_free_bytes"]
}
if hasKey(mx, "os_visible_memory_bytes", "os_physical_memory_free_bytes") {
mx["os_visible_memory_used_bytes"] = 0 +
mx["os_visible_memory_bytes"] -
mx["os_physical_memory_free_bytes"]
}
if hasKey(mx, "memory_commit_limit", "memory_committed_bytes") {
mx["memory_not_committed_bytes"] = 0 +
mx["memory_commit_limit"] -
mx["memory_committed_bytes"]
}
if hasKey(mx, "memory_standby_cache_reserve_bytes", "memory_standby_cache_normal_priority_bytes", "memory_standby_cache_core_bytes") {
mx["memory_standby_cache_total"] = 0 +
mx["memory_standby_cache_reserve_bytes"] +
mx["memory_standby_cache_normal_priority_bytes"] +
mx["memory_standby_cache_core_bytes"]
}
if hasKey(mx, "memory_standby_cache_total", "memory_modified_page_list_bytes") {
mx["memory_cache_total"] = 0 +
mx["memory_standby_cache_total"] +
mx["memory_modified_page_list_bytes"]
}
return mx, nil
}
func (c *Collector) collectMetrics(mx map[string]int64, pms prometheus.Series) {
c.collectCollector(mx, pms)
for _, pm := range pms.FindByName(metricCollectorSuccess) {
if pm.Value == 0 {
continue
}
switch pm.Labels.Get("collector") {
case collectorCPU:
c.collectCPU(mx, pms)
case collectorMemory:
c.collectMemory(mx, pms)
case collectorNet:
c.collectNet(mx, pms)
case collectorLogicalDisk:
c.collectLogicalDisk(mx, pms)
case collectorOS:
c.collectOS(mx, pms)
case collectorSystem:
c.collectSystem(mx, pms)
case collectorLogon:
c.collectLogon(mx, pms)
case collectorThermalZone:
c.collectThermalzone(mx, pms)
case collectorTCP:
c.collectTCP(mx, pms)
case collectorProcess:
c.collectProcess(mx, pms)
case collectorService:
c.collectService(mx, pms)
case collectorIIS:
c.collectIIS(mx, pms)
case collectorMSSQL:
c.collectMSSQL(mx, pms)
case collectorAD:
c.collectAD(mx, pms)
case collectorADCS:
c.collectADCS(mx, pms)
case collectorADFS:
c.collectADFS(mx, pms)
case collectorNetFrameworkCLRExceptions:
c.collectNetFrameworkCLRExceptions(mx, pms)
case collectorNetFrameworkCLRInterop:
c.collectNetFrameworkCLRInterop(mx, pms)
case collectorNetFrameworkCLRJIT:
c.collectNetFrameworkCLRJIT(mx, pms)
case collectorNetFrameworkCLRLoading:
c.collectNetFrameworkCLRLoading(mx, pms)
case collectorNetFrameworkCLRLocksAndThreads:
c.collectNetFrameworkCLRLocksAndThreads(mx, pms)
case collectorNetFrameworkCLRMemory:
c.collectNetFrameworkCLRMemory(mx, pms)
case collectorNetFrameworkCLRRemoting:
c.collectNetFrameworkCLRRemoting(mx, pms)
case collectorNetFrameworkCLRSecurity:
c.collectNetFrameworkCLRSecurity(mx, pms)
case collectorExchange:
c.collectExchange(mx, pms)
case collectorHyperv:
c.collectHyperv(mx, pms)
}
}
}
func hasKey(mx map[string]int64, key string, keys ...string) bool {
_, ok := mx[key]
switch len(keys) {
case 0:
return ok
default:
return ok && hasKey(mx, keys[0], keys[1:]...)
}
}

View file

@ -1,100 +0,0 @@
// SPDX-License-Identifier: GPL-3.0-or-later
package windows
import "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/prometheus"
// Windows exporter:
// https://github.com/prometheus-community/windows_exporter/blob/master/docs/collector.ad.md
// Microsoft:
// https://learn.microsoft.com/en-us/previous-versions/ms803980(v=msdn.10)
const (
metricADATQAverageRequestLatency = "windows_ad_atq_average_request_latency"
metricADATQOutstandingRequests = "windows_ad_atq_outstanding_requests"
metricADDatabaseOperationsTotal = "windows_ad_database_operations_total"
metricADDirectoryOperationsTotal = "windows_ad_directory_operations_total"
metricADReplicationInboundObjectsFilteringTotal = "windows_ad_replication_inbound_objects_filtered_total"
metricADReplicationInboundPropertiesFilteredTotal = "windows_ad_replication_inbound_properties_filtered_total"
metricADReplicationInboundPropertiesUpdatedTotal = "windows_ad_replication_inbound_properties_updated_total"
metricADReplicationInboundSyncObjectsRemaining = "windows_ad_replication_inbound_sync_objects_remaining"
metricADReplicationDataInterSiteBytesTotal = "windows_ad_replication_data_intersite_bytes_total"
metricADReplicationDataIntraSiteBytesTotal = "windows_ad_replication_data_intrasite_bytes_total"
metricADReplicationPendingSyncs = "windows_ad_replication_pending_synchronizations"
metricADReplicationSyncRequestsTotal = "windows_ad_replication_sync_requests_total"
metricADDirectoryServiceThreads = "windows_ad_directory_service_threads"
metricADLDAPLastBindTimeSecondsTotal = "windows_ad_ldap_last_bind_time_seconds"
metricADBindsTotal = "windows_ad_binds_total"
metricADLDAPSearchesTotal = "windows_ad_ldap_searches_total"
metricADNameCacheLookupsTotal = "windows_ad_name_cache_lookups_total"
metricADNameCacheHitsTotal = "windows_ad_name_cache_hits_total"
)
func (c *Collector) collectAD(mx map[string]int64, pms prometheus.Series) {
if !c.cache.collection[collectorAD] {
c.cache.collection[collectorAD] = true
c.addADCharts()
}
if pm := pms.FindByName(metricADATQAverageRequestLatency); pm.Len() > 0 {
mx["ad_atq_average_request_latency"] = int64(pm.Max() * precision)
}
if pm := pms.FindByName(metricADATQOutstandingRequests); pm.Len() > 0 {
mx["ad_atq_outstanding_requests"] = int64(pm.Max())
}
for _, pm := range pms.FindByName(metricADDatabaseOperationsTotal) {
if op := pm.Labels.Get("operation"); op != "" {
mx["ad_database_operations_total_"+op] = int64(pm.Value)
}
}
for _, pm := range pms.FindByName(metricADDirectoryOperationsTotal) {
if op := pm.Labels.Get("operation"); op != "" {
mx["ad_directory_operations_total_"+op] += int64(pm.Value) // sum "origin"
}
}
if pm := pms.FindByName(metricADReplicationInboundObjectsFilteringTotal); pm.Len() > 0 {
mx["ad_replication_inbound_objects_filtered_total"] = int64(pm.Max())
}
if pm := pms.FindByName(metricADReplicationInboundPropertiesFilteredTotal); pm.Len() > 0 {
mx["ad_replication_inbound_properties_filtered_total"] = int64(pm.Max())
}
if pm := pms.FindByName(metricADReplicationInboundPropertiesUpdatedTotal); pm.Len() > 0 {
mx["ad_replication_inbound_properties_updated_total"] = int64(pm.Max())
}
if pm := pms.FindByName(metricADReplicationInboundSyncObjectsRemaining); pm.Len() > 0 {
mx["ad_replication_inbound_sync_objects_remaining"] = int64(pm.Max())
}
for _, pm := range pms.FindByName(metricADReplicationDataInterSiteBytesTotal) {
if name := pm.Labels.Get("direction"); name != "" {
mx["ad_replication_data_intersite_bytes_total_"+name] = int64(pm.Value)
}
}
for _, pm := range pms.FindByName(metricADReplicationDataIntraSiteBytesTotal) {
if name := pm.Labels.Get("direction"); name != "" {
mx["ad_replication_data_intrasite_bytes_total_"+name] = int64(pm.Value)
}
}
if pm := pms.FindByName(metricADReplicationPendingSyncs); pm.Len() > 0 {
mx["ad_replication_pending_synchronizations"] = int64(pm.Max())
}
if pm := pms.FindByName(metricADReplicationSyncRequestsTotal); pm.Len() > 0 {
mx["ad_replication_sync_requests_total"] = int64(pm.Max())
}
if pm := pms.FindByName(metricADDirectoryServiceThreads); pm.Len() > 0 {
mx["ad_directory_service_threads"] = int64(pm.Max())
}
if pm := pms.FindByName(metricADLDAPLastBindTimeSecondsTotal); pm.Len() > 0 {
mx["ad_ldap_last_bind_time_seconds"] = int64(pm.Max())
}
for _, pm := range pms.FindByName(metricADBindsTotal) {
mx["ad_binds_total"] += int64(pm.Value) // sum "bind_method"'s
}
if pm := pms.FindByName(metricADLDAPSearchesTotal); pm.Len() > 0 {
mx["ad_ldap_searches_total"] = int64(pm.Max())
}
if pm := pms.FindByName(metricADNameCacheLookupsTotal); pm.Len() > 0 {
mx["ad_name_cache_lookups_total"] = int64(pm.Max())
}
if pm := pms.FindByName(metricADNameCacheHitsTotal); pm.Len() > 0 {
mx["ad_name_cache_hits_total"] = int64(pm.Max())
}
}

View file

@ -1,70 +0,0 @@
// SPDX-License-Identifier: GPL-3.0-or-later
package windows
import (
"strings"
"github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/prometheus"
)
const (
metricADCSRequestsTotal = "windows_adcs_requests_total"
metricADCSFailedRequestsTotal = "windows_adcs_failed_requests_total"
metricADCSIssuedRequestsTotal = "windows_adcs_issued_requests_total"
metricADCSPendingRequestsTotal = "windows_adcs_pending_requests_total"
metricADCSRequestProcessingTime = "windows_adcs_request_processing_time_seconds"
metricADCSRetrievalsTotal = "windows_adcs_retrievals_total"
metricADCSRetrievalsProcessingTime = "windows_adcs_retrievals_processing_time_seconds"
metricADCSRequestCryptoSigningTime = "windows_adcs_request_cryptographic_signing_time_seconds"
metricADCSRequestPolicyModuleProcessingTime = "windows_adcs_request_policy_module_processing_time_seconds"
metricADCSChallengeResponseResponsesTotal = "windows_adcs_challenge_responses_total"
metricADCSChallengeResponseProcessingTime = "windows_adcs_challenge_response_processing_time_seconds"
metricADCSSignedCertTimestampListsTotal = "windows_adcs_signed_certificate_timestamp_lists_total"
metricADCSSignedCertTimestampListProcessingTime = "windows_adcs_signed_certificate_timestamp_list_processing_time_seconds"
)
func (c *Collector) collectADCS(mx map[string]int64, pms prometheus.Series) {
pms = pms.FindByNames(
metricADCSRequestsTotal,
metricADCSFailedRequestsTotal,
metricADCSIssuedRequestsTotal,
metricADCSPendingRequestsTotal,
metricADCSRequestProcessingTime,
metricADCSRetrievalsTotal,
metricADCSRetrievalsProcessingTime,
metricADCSRequestCryptoSigningTime,
metricADCSRequestPolicyModuleProcessingTime,
metricADCSChallengeResponseResponsesTotal,
metricADCSChallengeResponseProcessingTime,
metricADCSSignedCertTimestampListsTotal,
metricADCSSignedCertTimestampListProcessingTime,
)
seen := make(map[string]bool)
for _, pm := range pms {
if tmpl := pm.Labels.Get("cert_template"); tmpl != "" && tmpl != "_Total" {
seen[tmpl] = true
name := strings.TrimPrefix(pm.Name(), "windows_adcs_")
v := pm.Value
if strings.HasSuffix(pm.Name(), "_seconds") {
v *= precision
}
mx["adcs_cert_template_"+tmpl+"_"+name] += int64(v)
}
}
for template := range seen {
if !c.cache.adcs[template] {
c.cache.adcs[template] = true
c.addCertificateTemplateCharts(template)
}
}
for template := range c.cache.adcs {
if !seen[template] {
delete(c.cache.adcs, template)
c.removeCertificateTemplateCharts(template)
}
}
}

View file

@ -1,119 +0,0 @@
// SPDX-License-Identifier: GPL-3.0-or-later
package windows
import (
"strings"
"github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/prometheus"
)
const (
metricADFSADLoginConnectionFailuresTotal = "windows_adfs_ad_login_connection_failures_total"
metricADFSCertificateAuthenticationsTotal = "windows_adfs_certificate_authentications_total"
metricADFSDBArtifactFailureTotal = "windows_adfs_db_artifact_failure_total"
metricADFSDBArtifactQueryTimeSeconds = "windows_adfs_db_artifact_query_time_seconds_total"
metricADFSDBConfigFailureTotal = "windows_adfs_db_config_failure_total"
metricADFSDBQueryTimeSecondsTotal = "windows_adfs_db_config_query_time_seconds_total"
metricADFSDeviceAuthenticationsTotal = "windows_adfs_device_authentications_total"
metricADFSExternalAuthenticationsFailureTotal = "windows_adfs_external_authentications_failure_total"
metricADFSExternalAuthenticationsSuccessTotal = "windows_adfs_external_authentications_success_total"
metricADFSExtranetAccountLockoutsTotal = "windows_adfs_extranet_account_lockouts_total"
metricADFSFederatedAuthenticationsTotal = "windows_adfs_federated_authentications_total"
metricADFSFederationMetadataRequestsTotal = "windows_adfs_federation_metadata_requests_total"
metricADFSOauthAuthorizationRequestsTotal = "windows_adfs_oauth_authorization_requests_total"
metricADFSOauthClientAuthenticationFailureTotal = "windows_adfs_oauth_client_authentication_failure_total"
metricADFSOauthClientAuthenticationSuccessTotal = "windows_adfs_oauth_client_authentication_success_total"
metricADFSOauthClientCredentialsFailureTotal = "windows_adfs_oauth_client_credentials_failure_total"
metricADFSOauthClientCredentialsSuccessTotal = "windows_adfs_oauth_client_credentials_success_total"
metricADFSOauthClientPrivKeyJTWAuthenticationFailureTotal = "windows_adfs_oauth_client_privkey_jtw_authentication_failure_total"
metricADFSOauthClientPrivKeyJWTAuthenticationSuccessTotal = "windows_adfs_oauth_client_privkey_jwt_authentications_success_total"
metricADFSOauthClientSecretBasicAuthenticationsFailureTotal = "windows_adfs_oauth_client_secret_basic_authentications_failure_total"
metricADFSADFSOauthClientSecretBasicAuthenticationsSuccessTotal = "windows_adfs_oauth_client_secret_basic_authentications_success_total"
metricADFSOauthClientSecretPostAuthenticationsFailureTotal = "windows_adfs_oauth_client_secret_post_authentications_failure_total"
metricADFSOauthClientSecretPostAuthenticationsSuccessTotal = "windows_adfs_oauth_client_secret_post_authentications_success_total"
metricADFSOauthClientWindowsAuthenticationsFailureTotal = "windows_adfs_oauth_client_windows_authentications_failure_total"
metricADFSOauthClientWindowsAuthenticationsSuccessTotal = "windows_adfs_oauth_client_windows_authentications_success_total"
metricADFSOauthLogonCertificateRequestsFailureTotal = "windows_adfs_oauth_logon_certificate_requests_failure_total"
metricADFSOauthLogonCertificateTokenRequestsSuccessTotal = "windows_adfs_oauth_logon_certificate_token_requests_success_total"
metricADFSOauthPasswordGrantRequestsFailureTotal = "windows_adfs_oauth_password_grant_requests_failure_total"
metricADFSOauthPasswordGrantRequestsSuccessTotal = "windows_adfs_oauth_password_grant_requests_success_total"
metricADFSOauthTokenRequestsSuccessTotal = "windows_adfs_oauth_token_requests_success_total"
metricADFSPassiveRequestsTotal = "windows_adfs_passive_requests_total"
metricADFSPasswortAuthenticationsTotal = "windows_adfs_passport_authentications_total"
metricADFSPasswordChangeFailedTotal = "windows_adfs_password_change_failed_total"
metricADFSWPasswordChangeSucceededTotal = "windows_adfs_password_change_succeeded_total"
metricADFSSamlpTokenRequestsSuccessTotal = "windows_adfs_samlp_token_requests_success_total"
metricADFSSSOAuthenticationsFailureTotal = "windows_adfs_sso_authentications_failure_total"
metricADFSSSOAuthenticationsSuccessTotal = "windows_adfs_sso_authentications_success_total"
metricADFSTokenRequestsTotal = "windows_adfs_token_requests_total"
metricADFSUserPasswordAuthenticationsFailureTotal = "windows_adfs_userpassword_authentications_failure_total"
metricADFSUserPasswordAuthenticationsSuccessTotal = "windows_adfs_userpassword_authentications_success_total"
metricADFSWindowsIntegratedAuthenticationsTotal = "windows_adfs_windows_integrated_authentications_total"
metricADFSWSFedTokenRequestsSuccessTotal = "windows_adfs_wsfed_token_requests_success_total"
metricADFSWSTrustTokenRequestsSuccessTotal = "windows_adfs_wstrust_token_requests_success_total"
)
var adfsMetrics = []string{
metricADFSADLoginConnectionFailuresTotal,
metricADFSCertificateAuthenticationsTotal,
metricADFSDBArtifactFailureTotal,
metricADFSDBArtifactQueryTimeSeconds,
metricADFSDBConfigFailureTotal,
metricADFSDBQueryTimeSecondsTotal,
metricADFSDeviceAuthenticationsTotal,
metricADFSExternalAuthenticationsFailureTotal,
metricADFSExternalAuthenticationsSuccessTotal,
metricADFSExtranetAccountLockoutsTotal,
metricADFSFederatedAuthenticationsTotal,
metricADFSFederationMetadataRequestsTotal,
metricADFSOauthAuthorizationRequestsTotal,
metricADFSOauthClientAuthenticationFailureTotal,
metricADFSOauthClientAuthenticationSuccessTotal,
metricADFSOauthClientCredentialsFailureTotal,
metricADFSOauthClientCredentialsSuccessTotal,
metricADFSOauthClientPrivKeyJTWAuthenticationFailureTotal,
metricADFSOauthClientPrivKeyJWTAuthenticationSuccessTotal,
metricADFSOauthClientSecretBasicAuthenticationsFailureTotal,
metricADFSADFSOauthClientSecretBasicAuthenticationsSuccessTotal,
metricADFSOauthClientSecretPostAuthenticationsFailureTotal,
metricADFSOauthClientSecretPostAuthenticationsSuccessTotal,
metricADFSOauthClientWindowsAuthenticationsFailureTotal,
metricADFSOauthClientWindowsAuthenticationsSuccessTotal,
metricADFSOauthLogonCertificateRequestsFailureTotal,
metricADFSOauthLogonCertificateTokenRequestsSuccessTotal,
metricADFSOauthPasswordGrantRequestsFailureTotal,
metricADFSOauthPasswordGrantRequestsSuccessTotal,
metricADFSOauthTokenRequestsSuccessTotal,
metricADFSPassiveRequestsTotal,
metricADFSPasswortAuthenticationsTotal,
metricADFSPasswordChangeFailedTotal,
metricADFSWPasswordChangeSucceededTotal,
metricADFSSamlpTokenRequestsSuccessTotal,
metricADFSSSOAuthenticationsFailureTotal,
metricADFSSSOAuthenticationsSuccessTotal,
metricADFSTokenRequestsTotal,
metricADFSUserPasswordAuthenticationsFailureTotal,
metricADFSUserPasswordAuthenticationsSuccessTotal,
metricADFSWindowsIntegratedAuthenticationsTotal,
metricADFSWSFedTokenRequestsSuccessTotal,
metricADFSWSTrustTokenRequestsSuccessTotal,
}
func (c *Collector) collectADFS(mx map[string]int64, pms prometheus.Series) {
if !c.cache.collection[collectorADFS] {
c.cache.collection[collectorADFS] = true
c.addADFSCharts()
}
for _, pm := range pms.FindByNames(adfsMetrics...) {
name := strings.TrimPrefix(pm.Name(), "windows_")
v := pm.Value
if strings.HasSuffix(name, "_seconds_total") {
v *= precision
}
mx[name] = int64(v)
}
}

View file

@ -1,46 +0,0 @@
// SPDX-License-Identifier: GPL-3.0-or-later
package windows
import (
"github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/prometheus"
)
const (
metricCollectorDuration = "windows_exporter_collector_duration_seconds"
metricCollectorSuccess = "windows_exporter_collector_success"
)
func (c *Collector) collectCollector(mx map[string]int64, pms prometheus.Series) {
seen := make(map[string]bool)
px := "collector_"
for _, pm := range pms.FindByName(metricCollectorDuration) {
if name := pm.Labels.Get("collector"); name != "" {
seen[name] = true
mx[px+name+"_duration"] = int64(pm.Value * precision)
}
}
for _, pm := range pms.FindByName(metricCollectorSuccess) {
if name := pm.Labels.Get("collector"); name != "" {
seen[name] = true
if pm.Value == 1 {
mx[px+name+"_status_success"], mx[px+name+"_status_fail"] = 1, 0
} else {
mx[px+name+"_status_success"], mx[px+name+"_status_fail"] = 0, 1
}
}
}
for name := range seen {
if !c.cache.collectors[name] {
c.cache.collectors[name] = true
c.addCollectorCharts(name)
}
}
for name := range c.cache.collectors {
if !seen[name] {
delete(c.cache.collectors, name)
c.removeCollectorCharts(name)
}
}
}

View file

@ -1,78 +0,0 @@
// SPDX-License-Identifier: GPL-3.0-or-later
package windows
import (
"github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/prometheus"
)
const (
metricCPUTimeTotal = "windows_cpu_time_total"
metricCPUInterruptsTotal = "windows_cpu_interrupts_total"
metricCPUDPCsTotal = "windows_cpu_dpcs_total"
metricCPUCStateTotal = "windows_cpu_cstate_seconds_total"
)
func (c *Collector) collectCPU(mx map[string]int64, pms prometheus.Series) {
if !c.cache.collection[collectorCPU] {
c.cache.collection[collectorCPU] = true
c.addCPUCharts()
}
seen := make(map[string]bool)
for _, pm := range pms.FindByName(metricCPUTimeTotal) {
core := pm.Labels.Get("core")
mode := pm.Labels.Get("mode")
if core == "" || mode == "" {
continue
}
seen[core] = true
mx["cpu_"+mode+"_time"] += int64(pm.Value * precision)
mx["cpu_core_"+core+"_"+mode+"_time"] += int64(pm.Value * precision)
}
for _, pm := range pms.FindByName(metricCPUInterruptsTotal) {
core := pm.Labels.Get("core")
if core == "" {
continue
}
seen[core] = true
mx["cpu_core_"+core+"_interrupts"] += int64(pm.Value)
}
for _, pm := range pms.FindByName(metricCPUDPCsTotal) {
core := pm.Labels.Get("core")
if core == "" {
continue
}
seen[core] = true
mx["cpu_core_"+core+"_dpcs"] += int64(pm.Value)
}
for _, pm := range pms.FindByName(metricCPUCStateTotal) {
core := pm.Labels.Get("core")
state := pm.Labels.Get("state")
if core == "" || state == "" {
continue
}
seen[core] = true
mx["cpu_core_"+core+"_cstate_"+state] += int64(pm.Value * precision)
}
for core := range seen {
if !c.cache.cores[core] {
c.cache.cores[core] = true
c.addCPUCoreCharts(core)
}
}
for core := range c.cache.cores {
if !seen[core] {
delete(c.cache.cores, core)
c.removeCPUCoreCharts(core)
}
}
}

View file

@ -1,245 +0,0 @@
// SPDX-License-Identifier: GPL-3.0-or-later
package windows
import (
"strings"
"github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/metrix"
"github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/prometheus"
)
const (
metricExchangeActiveSyncPingCmdsPending = "windows_exchange_activesync_ping_cmds_pending"
metricExchangeActiveSyncRequestsTotal = "windows_exchange_activesync_requests_total"
metricExchangeActiveSyncCMDsTotal = "windows_exchange_activesync_sync_cmds_total"
metricExchangeAutoDiscoverRequestsTotal = "windows_exchange_autodiscover_requests_total"
metricExchangeAvailServiceRequestsPerSec = "windows_exchange_avail_service_requests_per_sec"
metricExchangeOWACurrentUniqueUsers = "windows_exchange_owa_current_unique_users"
metricExchangeOWARequestsTotal = "windows_exchange_owa_requests_total"
metricExchangeRPCActiveUserCount = "windows_exchange_rpc_active_user_count"
metricExchangeRPCAvgLatencySec = "windows_exchange_rpc_avg_latency_sec"
metricExchangeRPCConnectionCount = "windows_exchange_rpc_connection_count"
metricExchangeRPCOperationsTotal = "windows_exchange_rpc_operations_total"
metricExchangeRPCRequests = "windows_exchange_rpc_requests"
metricExchangeRPCUserCount = "windows_exchange_rpc_user_count"
metricExchangeTransportQueuesActiveMailboxDelivery = "windows_exchange_transport_queues_active_mailbox_delivery"
metricExchangeTransportQueuesExternalActiveRemoteDelivery = "windows_exchange_transport_queues_external_active_remote_delivery"
metricExchangeTransportQueuesExternalLargestDelivery = "windows_exchange_transport_queues_external_largest_delivery"
metricExchangeTransportQueuesInternalActiveRemoteDelivery = "windows_exchange_transport_queues_internal_active_remote_delivery"
metricExchangeTransportQueuesInternalLargestDelivery = "windows_exchange_transport_queues_internal_largest_delivery"
metricExchangeTransportQueuesPoison = "windows_exchange_transport_queues_poison"
metricExchangeTransportQueuesRetryMailboxDelivery = "windows_exchange_transport_queues_retry_mailbox_delivery"
metricExchangeTransportQueuesUnreachable = "windows_exchange_transport_queues_unreachable"
metricExchangeWorkloadActiveTasks = "windows_exchange_workload_active_tasks"
metricExchangeWorkloadCompletedTasks = "windows_exchange_workload_completed_tasks"
metricExchangeWorkloadQueuedTasks = "windows_exchange_workload_queued_tasks"
metricExchangeWorkloadYieldedTasks = "windows_exchange_workload_yielded_tasks"
metricExchangeWorkloadIsActive = "windows_exchange_workload_is_active"
metricExchangeLDAPLongRunningOPSPerSec = "windows_exchange_ldap_long_running_ops_per_sec"
metricExchangeLDAPReadTimeSec = "windows_exchange_ldap_read_time_sec"
metricExchangeLDAPSearchTmeSec = "windows_exchange_ldap_search_time_sec"
metricExchangeLDAPWriteTimeSec = "windows_exchange_ldap_write_time_sec"
metricExchangeLDAPTimeoutErrorsTotal = "windows_exchange_ldap_timeout_errors_total"
metricExchangeHTTPProxyAvgAuthLatency = "windows_exchange_http_proxy_avg_auth_latency"
metricExchangeHTTPProxyAvgCASProcessingLatencySec = "windows_exchange_http_proxy_avg_cas_proccessing_latency_sec"
metricExchangeHTTPProxyMailboxProxyFailureRate = "windows_exchange_http_proxy_mailbox_proxy_failure_rate"
metricExchangeHTTPProxyMailboxServerLocatorAvgLatencySec = "windows_exchange_http_proxy_mailbox_server_locator_avg_latency_sec"
metricExchangeHTTPProxyOutstandingProxyRequests = "windows_exchange_http_proxy_outstanding_proxy_requests"
metricExchangeHTTPProxyRequestsTotal = "windows_exchange_http_proxy_requests_total"
)
func (c *Collector) collectExchange(mx map[string]int64, pms prometheus.Series) {
if !c.cache.collection[collectorExchange] {
c.cache.collection[collectorExchange] = true
c.addExchangeCharts()
}
if pm := pms.FindByName(metricExchangeActiveSyncPingCmdsPending); pm.Len() > 0 {
mx["exchange_activesync_ping_cmds_pending"] = int64(pm.Max())
}
if pm := pms.FindByName(metricExchangeActiveSyncRequestsTotal); pm.Len() > 0 {
mx["exchange_activesync_requests_total"] = int64(pm.Max())
}
if pm := pms.FindByName(metricExchangeActiveSyncCMDsTotal); pm.Len() > 0 {
mx["exchange_activesync_sync_cmds_total"] = int64(pm.Max())
}
if pm := pms.FindByName(metricExchangeAutoDiscoverRequestsTotal); pm.Len() > 0 {
mx["exchange_autodiscover_requests_total"] = int64(pm.Max())
}
if pm := pms.FindByName(metricExchangeAvailServiceRequestsPerSec); pm.Len() > 0 {
mx["exchange_avail_service_requests_per_sec"] = int64(pm.Max())
}
if pm := pms.FindByName(metricExchangeOWACurrentUniqueUsers); pm.Len() > 0 {
mx["exchange_owa_current_unique_users"] = int64(pm.Max())
}
if pm := pms.FindByName(metricExchangeOWARequestsTotal); pm.Len() > 0 {
mx["exchange_owa_requests_total"] = int64(pm.Max())
}
if pm := pms.FindByName(metricExchangeRPCActiveUserCount); pm.Len() > 0 {
mx["exchange_rpc_active_user_count"] = int64(pm.Max())
}
if pm := pms.FindByName(metricExchangeRPCAvgLatencySec); pm.Len() > 0 {
mx["exchange_rpc_avg_latency_sec"] = int64(pm.Max() * precision)
}
if pm := pms.FindByName(metricExchangeRPCConnectionCount); pm.Len() > 0 {
mx["exchange_rpc_connection_count"] = int64(pm.Max())
}
if pm := pms.FindByName(metricExchangeRPCOperationsTotal); pm.Len() > 0 {
mx["exchange_rpc_operations_total"] = int64(pm.Max())
}
if pm := pms.FindByName(metricExchangeRPCRequests); pm.Len() > 0 {
mx["exchange_rpc_requests"] = int64(pm.Max())
}
if pm := pms.FindByName(metricExchangeRPCUserCount); pm.Len() > 0 {
mx["exchange_rpc_user_count"] = int64(pm.Max())
}
c.collectExchangeAddTransportQueueMetric(mx, pms)
c.collectExchangeAddWorkloadMetric(mx, pms)
c.collectExchangeAddLDAPMetric(mx, pms)
c.collectExchangeAddHTTPProxyMetric(mx, pms)
}
func (c *Collector) collectExchangeAddTransportQueueMetric(mx map[string]int64, pms prometheus.Series) {
pms = pms.FindByNames(
metricExchangeTransportQueuesActiveMailboxDelivery,
metricExchangeTransportQueuesExternalActiveRemoteDelivery,
metricExchangeTransportQueuesExternalLargestDelivery,
metricExchangeTransportQueuesInternalActiveRemoteDelivery,
metricExchangeTransportQueuesInternalLargestDelivery,
metricExchangeTransportQueuesPoison,
metricExchangeTransportQueuesRetryMailboxDelivery,
metricExchangeTransportQueuesUnreachable,
)
for _, pm := range pms {
if name := pm.Labels.Get("name"); name != "" && name != "total_excluding_priority_none" {
metric := strings.TrimPrefix(pm.Name(), "windows_")
mx[metric+"_"+name] += int64(pm.Value)
}
}
}
func (c *Collector) collectExchangeAddWorkloadMetric(mx map[string]int64, pms prometheus.Series) {
seen := make(map[string]bool)
for _, pm := range pms.FindByNames(
metricExchangeWorkloadActiveTasks,
metricExchangeWorkloadCompletedTasks,
metricExchangeWorkloadQueuedTasks,
metricExchangeWorkloadYieldedTasks,
) {
if name := pm.Labels.Get("name"); name != "" {
seen[name] = true
metric := strings.TrimPrefix(pm.Name(), "windows_exchange_workload_")
mx["exchange_workload_"+name+"_"+metric] += int64(pm.Value)
}
}
for _, pm := range pms.FindByName(metricExchangeWorkloadIsActive) {
if name := pm.Labels.Get("name"); name != "" {
seen[name] = true
mx["exchange_workload_"+name+"_is_active"] += metrix.Bool(pm.Value == 1)
mx["exchange_workload_"+name+"_is_paused"] += metrix.Bool(pm.Value == 0)
}
}
for name := range seen {
if !c.cache.exchangeWorkload[name] {
c.cache.exchangeWorkload[name] = true
c.addExchangeWorkloadCharts(name)
}
}
for name := range c.cache.exchangeWorkload {
if !seen[name] {
delete(c.cache.exchangeWorkload, name)
c.removeExchangeWorkloadCharts(name)
}
}
}
func (c *Collector) collectExchangeAddLDAPMetric(mx map[string]int64, pms prometheus.Series) {
seen := make(map[string]bool)
for _, pm := range pms.FindByNames(
metricExchangeLDAPLongRunningOPSPerSec,
metricExchangeLDAPTimeoutErrorsTotal,
) {
if name := pm.Labels.Get("name"); name != "" {
seen[name] = true
metric := strings.TrimPrefix(pm.Name(), "windows_exchange_ldap_")
mx["exchange_ldap_"+name+"_"+metric] += int64(pm.Value)
}
}
for _, pm := range pms.FindByNames(
metricExchangeLDAPReadTimeSec,
metricExchangeLDAPSearchTmeSec,
metricExchangeLDAPWriteTimeSec,
) {
if name := pm.Labels.Get("name"); name != "" {
seen[name] = true
metric := strings.TrimPrefix(pm.Name(), "windows_exchange_ldap_")
mx["exchange_ldap_"+name+"_"+metric] += int64(pm.Value * precision)
}
}
for name := range seen {
if !c.cache.exchangeLDAP[name] {
c.cache.exchangeLDAP[name] = true
c.addExchangeLDAPCharts(name)
}
}
for name := range c.cache.exchangeLDAP {
if !seen[name] {
delete(c.cache.exchangeLDAP, name)
c.removeExchangeLDAPCharts(name)
}
}
}
func (c *Collector) collectExchangeAddHTTPProxyMetric(mx map[string]int64, pms prometheus.Series) {
seen := make(map[string]bool)
for _, pm := range pms.FindByNames(
metricExchangeHTTPProxyAvgAuthLatency,
metricExchangeHTTPProxyOutstandingProxyRequests,
metricExchangeHTTPProxyRequestsTotal,
) {
if name := pm.Labels.Get("name"); name != "" {
seen[name] = true
metric := strings.TrimPrefix(pm.Name(), "windows_exchange_http_proxy_")
mx["exchange_http_proxy_"+name+"_"+metric] += int64(pm.Value)
}
}
for _, pm := range pms.FindByNames(
metricExchangeHTTPProxyAvgCASProcessingLatencySec,
metricExchangeHTTPProxyMailboxProxyFailureRate,
metricExchangeHTTPProxyMailboxServerLocatorAvgLatencySec,
) {
if name := pm.Labels.Get("name"); name != "" {
seen[name] = true
metric := strings.TrimPrefix(pm.Name(), "windows_exchange_http_proxy_")
mx["exchange_http_proxy_"+name+"_"+metric] += int64(pm.Value * precision)
}
}
for name := range seen {
if !c.cache.exchangeHTTPProxy[name] {
c.cache.exchangeHTTPProxy[name] = true
c.addExchangeHTTPProxyCharts(name)
}
}
for name := range c.cache.exchangeHTTPProxy {
if !seen[name] {
delete(c.cache.exchangeHTTPProxy, name)
c.removeExchangeHTTPProxyCharts(name)
}
}
}

View file

@ -1,288 +0,0 @@
// SPDX-License-Identifier: GPL-3.0-or-later
package windows
import (
"strings"
"github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/prometheus"
)
const (
metricHypervHealthCritical = "windows_hyperv_health_critical"
metricHypervHealthOK = "windows_hyperv_health_ok"
metricHypervRootPartition4KGPAPages = "windows_hyperv_root_partition_4K_gpa_pages"
metricHypervRootPartition2MGPAPages = "windows_hyperv_root_partition_2M_gpa_pages"
metricHypervRootPartition1GGPAPages = "windows_hyperv_root_partition_1G_gpa_pages"
metricHypervRootPartition4KDevicePages = "windows_hyperv_root_partition_4K_device_pages"
metricHypervRootPartition2MDevicePages = "windows_hyperv_root_partition_2M_device_pages"
metricHypervRootPartition1GDevicePages = "windows_hyperv_root_partition_1G_device_pages"
metricHypervRootPartitionGPASpaceModifications = "windows_hyperv_root_partition_gpa_space_modifications"
metricHypervRootPartitionAttachedDevices = "windows_hyperv_root_partition_attached_devices"
metricHypervRootPartitionDepositedPages = "windows_hyperv_root_partition_deposited_pages"
metricHypervRootPartitionPhysicalPagesAllocated = "windows_hyperv_root_partition_physical_pages_allocated" // SkippedTimerTicks
metricHypervRootPartitionDeviceDMAErrors = "windows_hyperv_root_partition_device_dma_errors"
metricHypervRootPartitionDeviceInterruptErrors = "windows_hyperv_root_partition_device_interrupt_errors"
metricHypervRootPartitionDeviceInterruptThrottleEvents = "windows_hyperv_root_partition_device_interrupt_throttle_events"
metricHypervRootPartitionIOTLBFlush = "windows_hyperv_root_partition_io_tlb_flush"
metricHypervRootPartitionAddressSpace = "windows_hyperv_root_partition_address_spaces"
metricHypervRootPartitionVirtualTLBPages = "windows_hyperv_root_partition_virtual_tlb_pages"
metricHypervRootPartitionVirtualTLBFlushEntries = "windows_hyperv_root_partition_virtual_tlb_flush_entires"
metricsHypervVMCPUGuestRunTime = "windows_hyperv_vm_cpu_guest_run_time"
metricsHypervVMCPUHypervisorRunTime = "windows_hyperv_vm_cpu_hypervisor_run_time"
metricsHypervVMCPURemoteRunTime = "windows_hyperv_vm_cpu_remote_run_time"
metricsHypervVMCPUTotalRunTime = "windows_hyperv_vm_cpu_total_run_time"
metricHypervVMMemoryPhysical = "windows_hyperv_vm_memory_physical"
metricHypervVMMemoryPhysicalGuestVisible = "windows_hyperv_vm_memory_physical_guest_visible"
metricHypervVMMemoryPressureCurrent = "windows_hyperv_vm_memory_pressure_current"
metricHyperVVIDPhysicalPagesAllocated = "windows_hyperv_vid_physical_pages_allocated"
metricHyperVVIDRemotePhysicalPages = "windows_hyperv_vid_remote_physical_pages"
metricHypervVMDeviceBytesRead = "windows_hyperv_vm_device_bytes_read"
metricHypervVMDeviceBytesWritten = "windows_hyperv_vm_device_bytes_written"
metricHypervVMDeviceOperationsRead = "windows_hyperv_vm_device_operations_read"
metricHypervVMDeviceOperationsWritten = "windows_hyperv_vm_device_operations_written"
metricHypervVMDeviceErrorCount = "windows_hyperv_vm_device_error_count"
metricHypervVMInterfaceBytesReceived = "windows_hyperv_vm_interface_bytes_received"
metricHypervVMInterfaceBytesSent = "windows_hyperv_vm_interface_bytes_sent"
metricHypervVMInterfacePacketsIncomingDropped = "windows_hyperv_vm_interface_packets_incoming_dropped"
metricHypervVMInterfacePacketsOutgoingDropped = "windows_hyperv_vm_interface_packets_outgoing_dropped"
metricHypervVMInterfacePacketsReceived = "windows_hyperv_vm_interface_packets_received"
metricHypervVMInterfacePacketsSent = "windows_hyperv_vm_interface_packets_sent"
metricHypervVSwitchBroadcastPacketsReceivedTotal = "windows_hyperv_vswitch_broadcast_packets_received_total"
metricHypervVSwitchBroadcastPacketsSentTotal = "windows_hyperv_vswitch_broadcast_packets_sent_total"
metricHypervVSwitchBytesReceivedTotal = "windows_hyperv_vswitch_bytes_received_total"
metricHypervVSwitchBytesSentTotal = "windows_hyperv_vswitch_bytes_sent_total"
metricHypervVSwitchPacketsReceivedTotal = "windows_hyperv_vswitch_packets_received_total"
metricHypervVSwitchPacketsSentTotal = "windows_hyperv_vswitch_packets_sent_total"
metricHypervVSwitchDirectedPacketsReceivedTotal = "windows_hyperv_vswitch_directed_packets_received_total"
metricHypervVSwitchDirectedPacketsSendTotal = "windows_hyperv_vswitch_directed_packets_send_total"
metricHypervVSwitchDroppedPacketsIncomingTotal = "windows_hyperv_vswitch_dropped_packets_incoming_total"
metricHypervVSwitchDroppedPacketsOutcomingTotal = "windows_hyperv_vswitch_dropped_packets_outcoming_total"
metricHypervVSwitchExtensionDroppedAttacksIncomingTotal = "windows_hyperv_vswitch_extensions_dropped_packets_incoming_total"
metricHypervVSwitchExtensionDroppedPacketsOutcomingTotal = "windows_hyperv_vswitch_extensions_dropped_packets_outcoming_total"
metricHypervVSwitchLearnedMACAddressTotal = "windows_hyperv_vswitch_learned_mac_addresses_total"
metricHypervVSwitchMulticastPacketsReceivedTotal = "windows_hyperv_vswitch_multicast_packets_received_total"
metricHypervVSwitchMulticastPacketsSentTotal = "windows_hyperv_vswitch_multicast_packets_sent_total"
metricHypervVSwitchNumberOfSendChannelMovesTotal = "windows_hyperv_vswitch_number_of_send_channel_moves_total"
metricHypervVSwitchNumberOfVMQMovesTotal = "windows_hyperv_vswitch_number_of_vmq_moves_total"
metricHypervVSwitchPacketsFloodedTotal = "windows_hyperv_vswitch_packets_flooded_total"
metricHypervVSwitchPurgedMACAddresses = "windows_hyperv_vswitch_purged_mac_addresses_total"
)
func (c *Collector) collectHyperv(mx map[string]int64, pms prometheus.Series) {
if !c.cache.collection[collectorHyperv] {
c.cache.collection[collectorHyperv] = true
c.addHypervCharts()
}
for _, v := range []string{
metricHypervHealthOK,
metricHypervHealthCritical,
metricHypervRootPartition4KGPAPages,
metricHypervRootPartition2MGPAPages,
metricHypervRootPartition1GGPAPages,
metricHypervRootPartition4KDevicePages,
metricHypervRootPartition2MDevicePages,
metricHypervRootPartition1GDevicePages,
metricHypervRootPartitionGPASpaceModifications,
metricHypervRootPartitionAddressSpace,
metricHypervRootPartitionAttachedDevices,
metricHypervRootPartitionDepositedPages,
metricHypervRootPartitionPhysicalPagesAllocated,
metricHypervRootPartitionDeviceDMAErrors,
metricHypervRootPartitionDeviceInterruptErrors,
metricHypervRootPartitionDeviceInterruptThrottleEvents,
metricHypervRootPartitionIOTLBFlush,
metricHypervRootPartitionVirtualTLBPages,
metricHypervRootPartitionVirtualTLBFlushEntries,
} {
for _, pm := range pms.FindByName(v) {
name := strings.TrimPrefix(pm.Name(), "windows_")
mx[name] = int64(pm.Value)
}
}
c.collectHypervVM(mx, pms)
c.collectHypervVMDevices(mx, pms)
c.collectHypervVMInterface(mx, pms)
c.collectHypervVSwitch(mx, pms)
}
func (c *Collector) collectHypervVM(mx map[string]int64, pms prometheus.Series) {
seen := make(map[string]bool)
px := "hyperv_vm_"
for _, v := range []string{
metricHypervVMMemoryPhysical,
metricHypervVMMemoryPhysicalGuestVisible,
metricHypervVMMemoryPressureCurrent,
metricsHypervVMCPUGuestRunTime,
metricsHypervVMCPUHypervisorRunTime,
metricsHypervVMCPURemoteRunTime,
} {
for _, pm := range pms.FindByName(v) {
if vm := pm.Labels.Get("vm"); vm != "" {
name := strings.TrimPrefix(pm.Name(), "windows_hyperv_vm")
seen[vm] = true
mx[px+hypervCleanName(vm)+name] += int64(pm.Value)
}
}
}
px = "hyperv_vid_"
for _, v := range []string{
metricHyperVVIDPhysicalPagesAllocated,
metricHyperVVIDRemotePhysicalPages,
} {
for _, pm := range pms.FindByName(v) {
if vm := pm.Labels.Get("vm"); vm != "" {
name := strings.TrimPrefix(pm.Name(), "windows_hyperv_vid")
seen[vm] = true
mx[px+hypervCleanName(vm)+name] = int64(pm.Value)
}
}
}
for v := range seen {
if !c.cache.hypervVMMem[v] {
c.cache.hypervVMMem[v] = true
c.addHypervVMCharts(v)
}
}
for v := range c.cache.hypervVMMem {
if !seen[v] {
delete(c.cache.hypervVMMem, v)
c.removeHypervVMCharts(v)
}
}
}
func (c *Collector) collectHypervVMDevices(mx map[string]int64, pms prometheus.Series) {
seen := make(map[string]bool)
px := "hyperv_vm_device_"
for _, v := range []string{
metricHypervVMDeviceBytesRead,
metricHypervVMDeviceBytesWritten,
metricHypervVMDeviceOperationsRead,
metricHypervVMDeviceOperationsWritten,
metricHypervVMDeviceErrorCount,
} {
for _, pm := range pms.FindByName(v) {
if device := pm.Labels.Get("vm_device"); device != "" {
name := strings.TrimPrefix(pm.Name(), "windows_hyperv_vm_device")
seen[device] = true
mx[px+hypervCleanName(device)+name] = int64(pm.Value)
}
}
}
for v := range seen {
if !c.cache.hypervVMDevices[v] {
c.cache.hypervVMDevices[v] = true
c.addHypervVMDeviceCharts(v)
}
}
for v := range c.cache.hypervVMDevices {
if !seen[v] {
delete(c.cache.hypervVMDevices, v)
c.removeHypervVMDeviceCharts(v)
}
}
}
func (c *Collector) collectHypervVMInterface(mx map[string]int64, pms prometheus.Series) {
seen := make(map[string]bool)
px := "hyperv_vm_interface_"
for _, v := range []string{
metricHypervVMInterfaceBytesReceived,
metricHypervVMInterfaceBytesSent,
metricHypervVMInterfacePacketsIncomingDropped,
metricHypervVMInterfacePacketsOutgoingDropped,
metricHypervVMInterfacePacketsReceived,
metricHypervVMInterfacePacketsSent,
} {
for _, pm := range pms.FindByName(v) {
if iface := pm.Labels.Get("vm_interface"); iface != "" {
name := strings.TrimPrefix(pm.Name(), "windows_hyperv_vm_interface")
seen[iface] = true
mx[px+hypervCleanName(iface)+name] = int64(pm.Value)
}
}
}
for v := range seen {
if !c.cache.hypervVMInterfaces[v] {
c.cache.hypervVMInterfaces[v] = true
c.addHypervVMInterfaceCharts(v)
}
}
for v := range c.cache.hypervVMInterfaces {
if !seen[v] {
delete(c.cache.hypervVMInterfaces, v)
c.removeHypervVMInterfaceCharts(v)
}
}
}
func (c *Collector) collectHypervVSwitch(mx map[string]int64, pms prometheus.Series) {
seen := make(map[string]bool)
px := "hyperv_vswitch_"
for _, v := range []string{
metricHypervVSwitchBytesReceivedTotal,
metricHypervVSwitchBytesSentTotal,
metricHypervVSwitchPacketsReceivedTotal,
metricHypervVSwitchPacketsSentTotal,
metricHypervVSwitchDirectedPacketsReceivedTotal,
metricHypervVSwitchDirectedPacketsSendTotal,
metricHypervVSwitchBroadcastPacketsReceivedTotal,
metricHypervVSwitchBroadcastPacketsSentTotal,
metricHypervVSwitchMulticastPacketsReceivedTotal,
metricHypervVSwitchMulticastPacketsSentTotal,
metricHypervVSwitchDroppedPacketsIncomingTotal,
metricHypervVSwitchDroppedPacketsOutcomingTotal,
metricHypervVSwitchExtensionDroppedAttacksIncomingTotal,
metricHypervVSwitchExtensionDroppedPacketsOutcomingTotal,
metricHypervVSwitchPacketsFloodedTotal,
metricHypervVSwitchLearnedMACAddressTotal,
metricHypervVSwitchPurgedMACAddresses,
metricHypervVSwitchNumberOfSendChannelMovesTotal,
metricHypervVSwitchNumberOfVMQMovesTotal,
} {
for _, pm := range pms.FindByName(v) {
if vswitch := pm.Labels.Get("vswitch"); vswitch != "" {
name := strings.TrimPrefix(pm.Name(), "windows_hyperv_vswitch")
seen[vswitch] = true
mx[px+hypervCleanName(vswitch)+name] = int64(pm.Value)
}
}
}
for v := range seen {
if !c.cache.hypervVswitch[v] {
c.cache.hypervVswitch[v] = true
c.addHypervVSwitchCharts(v)
}
}
for v := range c.cache.hypervVswitch {
if !seen[v] {
delete(c.cache.hypervVswitch, v)
c.removeHypervVSwitchCharts(v)
}
}
}
var hypervNameReplacer = strings.NewReplacer(" ", "_", "?", "_", ":", "_", ".", "_")
func hypervCleanName(name string) string {
name = hypervNameReplacer.Replace(name)
return strings.ToLower(name)
}

View file

@ -1,140 +0,0 @@
// SPDX-License-Identifier: GPL-3.0-or-later
package windows
import (
"strings"
"github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/prometheus"
)
const (
metricIISCurrentAnonymousUsers = "windows_iis_current_anonymous_users"
metricIISCurrentNonAnonymousUsers = "windows_iis_current_non_anonymous_users"
metricIISCurrentConnections = "windows_iis_current_connections"
metricIICurrentISAPIExtRequests = "windows_iis_current_isapi_extension_requests"
metricIISUptime = "windows_iis_service_uptime"
metricIISReceivedBytesTotal = "windows_iis_received_bytes_total"
metricIISSentBytesTotal = "windows_iis_sent_bytes_total"
metricIISRequestsTotal = "windows_iis_requests_total"
metricIISIPAPIExtRequestsTotal = "windows_iis_ipapi_extension_requests_total"
metricIISConnAttemptsAllInstancesTotal = "windows_iis_connection_attempts_all_instances_total"
metricIISFilesReceivedTotal = "windows_iis_files_received_total"
metricIISFilesSentTotal = "windows_iis_files_sent_total"
metricIISLogonAttemptsTotal = "windows_iis_logon_attempts_total"
metricIISLockedErrorsTotal = "windows_iis_locked_errors_total"
metricIISNotFoundErrorsTotal = "windows_iis_not_found_errors_total"
)
func (c *Collector) collectIIS(mx map[string]int64, pms prometheus.Series) {
seen := make(map[string]bool)
px := "iis_website_"
for _, pm := range pms.FindByName(metricIISCurrentAnonymousUsers) {
if name := cleanWebsiteName(pm.Labels.Get("site")); name != "" {
seen[name] = true
mx[px+name+"_current_anonymous_users"] += int64(pm.Value)
}
}
for _, pm := range pms.FindByName(metricIISCurrentNonAnonymousUsers) {
if name := cleanWebsiteName(pm.Labels.Get("site")); name != "" {
seen[name] = true
mx[px+name+"_current_non_anonymous_users"] += int64(pm.Value)
}
}
for _, pm := range pms.FindByName(metricIISCurrentConnections) {
if name := cleanWebsiteName(pm.Labels.Get("site")); name != "" {
seen[name] = true
mx[px+name+"_current_connections"] += int64(pm.Value)
}
}
for _, pm := range pms.FindByName(metricIICurrentISAPIExtRequests) {
if name := cleanWebsiteName(pm.Labels.Get("site")); name != "" {
seen[name] = true
mx[px+name+"_current_isapi_extension_requests"] += int64(pm.Value)
}
}
for _, pm := range pms.FindByName(metricIISUptime) {
if name := cleanWebsiteName(pm.Labels.Get("site")); name != "" {
seen[name] = true
mx[px+name+"_service_uptime"] += int64(pm.Value)
}
}
for _, pm := range pms.FindByName(metricIISReceivedBytesTotal) {
if name := cleanWebsiteName(pm.Labels.Get("site")); name != "" {
seen[name] = true
mx[px+name+"_received_bytes_total"] += int64(pm.Value)
}
}
for _, pm := range pms.FindByName(metricIISSentBytesTotal) {
if name := cleanWebsiteName(pm.Labels.Get("site")); name != "" {
seen[name] = true
mx[px+name+"_sent_bytes_total"] += int64(pm.Value)
}
}
for _, pm := range pms.FindByName(metricIISRequestsTotal) {
if name := cleanWebsiteName(pm.Labels.Get("site")); name != "" {
seen[name] = true
mx[px+name+"_requests_total"] += int64(pm.Value)
}
}
for _, pm := range pms.FindByName(metricIISConnAttemptsAllInstancesTotal) {
if name := cleanWebsiteName(pm.Labels.Get("site")); name != "" {
seen[name] = true
mx[px+name+"_connection_attempts_all_instances_total"] += int64(pm.Value)
}
}
for _, pm := range pms.FindByName(metricIISFilesReceivedTotal) {
if name := cleanWebsiteName(pm.Labels.Get("site")); name != "" {
seen[name] = true
mx[px+name+"_files_received_total"] += int64(pm.Value)
}
}
for _, pm := range pms.FindByName(metricIISFilesSentTotal) {
if name := cleanWebsiteName(pm.Labels.Get("site")); name != "" {
seen[name] = true
mx[px+name+"_files_sent_total"] += int64(pm.Value)
}
}
for _, pm := range pms.FindByName(metricIISIPAPIExtRequestsTotal) {
if name := cleanWebsiteName(pm.Labels.Get("site")); name != "" {
seen[name] = true
mx[px+name+"_isapi_extension_requests_total"] += int64(pm.Value)
}
}
for _, pm := range pms.FindByName(metricIISLogonAttemptsTotal) {
if name := cleanWebsiteName(pm.Labels.Get("site")); name != "" {
seen[name] = true
mx[px+name+"_logon_attempts_total"] += int64(pm.Value)
}
}
for _, pm := range pms.FindByName(metricIISLockedErrorsTotal) {
if name := cleanWebsiteName(pm.Labels.Get("site")); name != "" {
seen[name] = true
mx[px+name+"_locked_errors_total"] += int64(pm.Value)
}
}
for _, pm := range pms.FindByName(metricIISNotFoundErrorsTotal) {
if name := cleanWebsiteName(pm.Labels.Get("site")); name != "" {
seen[name] = true
mx[px+name+"_not_found_errors_total"] += int64(pm.Value)
}
}
for site := range seen {
if !c.cache.iis[site] {
c.cache.iis[site] = true
c.addIISWebsiteCharts(site)
}
}
for site := range c.cache.iis {
if !seen[site] {
delete(c.cache.iis, site)
c.removeIIWebsiteSCharts(site)
}
}
}
func cleanWebsiteName(name string) string {
return strings.ReplaceAll(name, " ", "_")
}

View file

@ -1,95 +0,0 @@
// SPDX-License-Identifier: GPL-3.0-or-later
package windows
import (
"strings"
"github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/prometheus"
)
const (
metricLDReadBytesTotal = "windows_logical_disk_read_bytes_total"
metricLDWriteBytesTotal = "windows_logical_disk_write_bytes_total"
metricLDReadsTotal = "windows_logical_disk_reads_total"
metricLDWritesTotal = "windows_logical_disk_writes_total"
metricLDSizeBytes = "windows_logical_disk_size_bytes"
metricLDFreeBytes = "windows_logical_disk_free_bytes"
metricLDReadLatencyTotal = "windows_logical_disk_read_latency_seconds_total"
metricLDWriteLatencyTotal = "windows_logical_disk_write_latency_seconds_total"
)
func (c *Collector) collectLogicalDisk(mx map[string]int64, pms prometheus.Series) {
seen := make(map[string]bool)
px := "logical_disk_"
for _, pm := range pms.FindByName(metricLDReadBytesTotal) {
vol := pm.Labels.Get("volume")
if vol != "" && !strings.HasPrefix(vol, "HarddiskVolume") {
seen[vol] = true
mx[px+vol+"_read_bytes_total"] = int64(pm.Value)
}
}
for _, pm := range pms.FindByName(metricLDWriteBytesTotal) {
vol := pm.Labels.Get("volume")
if vol != "" && !strings.HasPrefix(vol, "HarddiskVolume") {
seen[vol] = true
mx[px+vol+"_write_bytes_total"] = int64(pm.Value)
}
}
for _, pm := range pms.FindByName(metricLDReadsTotal) {
vol := pm.Labels.Get("volume")
if vol != "" && !strings.HasPrefix(vol, "HarddiskVolume") {
seen[vol] = true
mx[px+vol+"_reads_total"] = int64(pm.Value)
}
}
for _, pm := range pms.FindByName(metricLDWritesTotal) {
vol := pm.Labels.Get("volume")
if vol != "" && !strings.HasPrefix(vol, "HarddiskVolume") {
seen[vol] = true
mx[px+vol+"_writes_total"] = int64(pm.Value)
}
}
for _, pm := range pms.FindByName(metricLDSizeBytes) {
vol := pm.Labels.Get("volume")
if vol != "" && !strings.HasPrefix(vol, "HarddiskVolume") {
seen[vol] = true
mx[px+vol+"_total_space"] = int64(pm.Value)
}
}
for _, pm := range pms.FindByName(metricLDFreeBytes) {
vol := pm.Labels.Get("volume")
if vol != "" && !strings.HasPrefix(vol, "HarddiskVolume") {
seen[vol] = true
mx[px+vol+"_free_space"] = int64(pm.Value)
}
}
for _, pm := range pms.FindByName(metricLDReadLatencyTotal) {
vol := pm.Labels.Get("volume")
if vol != "" && !strings.HasPrefix(vol, "HarddiskVolume") {
seen[vol] = true
mx[px+vol+"_read_latency"] = int64(pm.Value * precision)
}
}
for _, pm := range pms.FindByName(metricLDWriteLatencyTotal) {
vol := pm.Labels.Get("volume")
if vol != "" && !strings.HasPrefix(vol, "HarddiskVolume") {
seen[vol] = true
mx[px+vol+"_write_latency"] = int64(pm.Value * precision)
}
}
for disk := range seen {
if !c.cache.volumes[disk] {
c.cache.volumes[disk] = true
c.addDiskCharts(disk)
}
mx[px+disk+"_used_space"] = mx[px+disk+"_total_space"] - mx[px+disk+"_free_space"]
}
for disk := range c.cache.volumes {
if !seen[disk] {
delete(c.cache.volumes, disk)
c.removeDiskCharts(disk)
}
}
}

View file

@ -1,24 +0,0 @@
// SPDX-License-Identifier: GPL-3.0-or-later
package windows
import (
"github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/prometheus"
)
const (
metricLogonType = "windows_logon_logon_type"
)
func (c *Collector) collectLogon(mx map[string]int64, pms prometheus.Series) {
if !c.cache.collection[collectorLogon] {
c.cache.collection[collectorLogon] = true
c.addLogonCharts()
}
for _, pm := range pms.FindByName(metricLogonType) {
if v := pm.Labels.Get("status"); v != "" {
mx["logon_type_"+v+"_sessions"] = int64(pm.Value)
}
}
}

View file

@ -1,78 +0,0 @@
// SPDX-License-Identifier: GPL-3.0-or-later
package windows
import (
"github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/prometheus"
)
const (
metricMemAvailBytes = "windows_memory_available_bytes"
metricMemCacheFaultsTotal = "windows_memory_cache_faults_total"
metricMemCommitLimit = "windows_memory_commit_limit"
metricMemCommittedBytes = "windows_memory_committed_bytes"
metricMemModifiedPageListBytes = "windows_memory_modified_page_list_bytes"
metricMemPageFaultsTotal = "windows_memory_page_faults_total"
metricMemSwapPageReadsTotal = "windows_memory_swap_page_reads_total"
metricMemSwapPagesReadTotal = "windows_memory_swap_pages_read_total"
metricMemSwapPagesWrittenTotal = "windows_memory_swap_pages_written_total"
metricMemSwapPageWritesTotal = "windows_memory_swap_page_writes_total"
metricMemPoolNonPagedBytesTotal = "windows_memory_pool_nonpaged_bytes"
metricMemPoolPagedBytes = "windows_memory_pool_paged_bytes"
metricMemStandbyCacheCoreBytes = "windows_memory_standby_cache_core_bytes"
metricMemStandbyCacheNormalPriorityBytes = "windows_memory_standby_cache_normal_priority_bytes"
metricMemStandbyCacheReserveBytes = "windows_memory_standby_cache_reserve_bytes"
)
func (c *Collector) collectMemory(mx map[string]int64, pms prometheus.Series) {
if !c.cache.collection[collectorMemory] {
c.cache.collection[collectorMemory] = true
c.addMemoryCharts()
}
if pm := pms.FindByName(metricMemAvailBytes); pm.Len() > 0 {
mx["memory_available_bytes"] = int64(pm.Max())
}
if pm := pms.FindByName(metricMemCacheFaultsTotal); pm.Len() > 0 {
mx["memory_cache_faults_total"] = int64(pm.Max())
}
if pm := pms.FindByName(metricMemCommitLimit); pm.Len() > 0 {
mx["memory_commit_limit"] = int64(pm.Max())
}
if pm := pms.FindByName(metricMemCommittedBytes); pm.Len() > 0 {
mx["memory_committed_bytes"] = int64(pm.Max())
}
if pm := pms.FindByName(metricMemModifiedPageListBytes); pm.Len() > 0 {
mx["memory_modified_page_list_bytes"] = int64(pm.Max())
}
if pm := pms.FindByName(metricMemPageFaultsTotal); pm.Len() > 0 {
mx["memory_page_faults_total"] = int64(pm.Max())
}
if pm := pms.FindByName(metricMemSwapPageReadsTotal); pm.Len() > 0 {
mx["memory_swap_page_reads_total"] = int64(pm.Max())
}
if pm := pms.FindByName(metricMemSwapPagesReadTotal); pm.Len() > 0 {
mx["memory_swap_pages_read_total"] = int64(pm.Max())
}
if pm := pms.FindByName(metricMemSwapPagesWrittenTotal); pm.Len() > 0 {
mx["memory_swap_pages_written_total"] = int64(pm.Max())
}
if pm := pms.FindByName(metricMemSwapPageWritesTotal); pm.Len() > 0 {
mx["memory_swap_page_writes_total"] = int64(pm.Max())
}
if pm := pms.FindByName(metricMemPoolNonPagedBytesTotal); pm.Len() > 0 {
mx["memory_pool_nonpaged_bytes_total"] = int64(pm.Max())
}
if pm := pms.FindByName(metricMemPoolPagedBytes); pm.Len() > 0 {
mx["memory_pool_paged_bytes"] = int64(pm.Max())
}
if pm := pms.FindByName(metricMemStandbyCacheCoreBytes); pm.Len() > 0 {
mx["memory_standby_cache_core_bytes"] = int64(pm.Max())
}
if pm := pms.FindByName(metricMemStandbyCacheNormalPriorityBytes); pm.Len() > 0 {
mx["memory_standby_cache_normal_priority_bytes"] = int64(pm.Max())
}
if pm := pms.FindByName(metricMemStandbyCacheReserveBytes); pm.Len() > 0 {
mx["memory_standby_cache_reserve_bytes"] = int64(pm.Max())
}
}

View file

@ -1,259 +0,0 @@
// SPDX-License-Identifier: GPL-3.0-or-later
package windows
import (
"strings"
"github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/prometheus"
)
const (
metricMSSQLAccessMethodPageSplits = "windows_mssql_accessmethods_page_splits"
metricMSSQLBufferCacheHits = "windows_mssql_bufman_buffer_cache_hits"
metricMSSQLBufferCacheLookups = "windows_mssql_bufman_buffer_cache_lookups"
metricMSSQLBufferCheckpointPages = "windows_mssql_bufman_checkpoint_pages"
metricMSSQLBufferPageLifeExpectancy = "windows_mssql_bufman_page_life_expectancy_seconds"
metricMSSQLBufferPageReads = "windows_mssql_bufman_page_reads"
metricMSSQLBufferPageWrites = "windows_mssql_bufman_page_writes"
metricMSSQLBlockedProcesses = "windows_mssql_genstats_blocked_processes"
metricMSSQLUserConnections = "windows_mssql_genstats_user_connections"
metricMSSQLLockWait = "windows_mssql_locks_lock_wait_seconds"
metricMSSQLDeadlocks = "windows_mssql_locks_deadlocks"
metricMSSQLConnectionMemoryBytes = "windows_mssql_memmgr_connection_memory_bytes"
metricMSSQLExternalBenefitOfMemory = "windows_mssql_memmgr_external_benefit_of_memory"
metricMSSQLPendingMemoryGrants = "windows_mssql_memmgr_pending_memory_grants"
metricMSSQLSQLErrorsTotal = "windows_mssql_sql_errors_total"
metricMSSQLTotalServerMemory = "windows_mssql_memmgr_total_server_memory_bytes"
metricMSSQLStatsAutoParameterization = "windows_mssql_sqlstats_auto_parameterization_attempts"
metricMSSQLStatsBatchRequests = "windows_mssql_sqlstats_batch_requests"
metricMSSQLStatSafeAutoParameterization = "windows_mssql_sqlstats_safe_auto_parameterization_attempts"
metricMSSQLCompilations = "windows_mssql_sqlstats_sql_compilations"
metricMSSQLRecompilations = "windows_mssql_sqlstats_sql_recompilations"
metricMSSQLDatabaseActiveTransactions = "windows_mssql_databases_active_transactions"
metricMSSQLDatabaseBackupRestoreOperations = "windows_mssql_databases_backup_restore_operations"
metricMSSQLDatabaseDataFileSize = "windows_mssql_databases_data_files_size_bytes"
metricMSSQLDatabaseLogFlushed = "windows_mssql_databases_log_flushed_bytes"
metricMSSQLDatabaseLogFlushes = "windows_mssql_databases_log_flushes"
metricMSSQLDatabaseTransactions = "windows_mssql_databases_transactions"
metricMSSQLDatabaseWriteTransactions = "windows_mssql_databases_write_transactions"
)
func (c *Collector) collectMSSQL(mx map[string]int64, pms prometheus.Series) {
instances := make(map[string]bool)
dbs := make(map[string]bool)
px := "mssql_instance_"
for _, pm := range pms.FindByName(metricMSSQLAccessMethodPageSplits) {
if name := pm.Labels.Get("mssql_instance"); name != "" {
instances[name] = true
mx[px+name+"_accessmethods_page_splits"] = int64(pm.Value)
}
}
for _, pm := range pms.FindByName(metricMSSQLBufferCacheHits) {
if name := pm.Labels.Get("mssql_instance"); name != "" {
instances[name] = true
mx[px+name+"_bufman_buffer_cache_hits"] = int64(pm.Value)
}
}
for _, pm := range pms.FindByName(metricMSSQLBufferCacheLookups) {
if name := pm.Labels.Get("mssql_instance"); name != "" && pm.Value > 0 {
instances[name] = true
mx[px+name+"_cache_hit_ratio"] = int64(float64(mx[px+name+"_bufman_buffer_cache_hits"]) / pm.Value * 100)
}
}
for _, pm := range pms.FindByName(metricMSSQLBufferCheckpointPages) {
if name := pm.Labels.Get("mssql_instance"); name != "" {
instances[name] = true
mx[px+name+"_bufman_checkpoint_pages"] = int64(pm.Value)
}
}
for _, pm := range pms.FindByName(metricMSSQLBufferPageLifeExpectancy) {
if name := pm.Labels.Get("mssql_instance"); name != "" {
instances[name] = true
mx[px+name+"_bufman_page_life_expectancy_seconds"] = int64(pm.Value)
}
}
for _, pm := range pms.FindByName(metricMSSQLBufferPageReads) {
if name := pm.Labels.Get("mssql_instance"); name != "" {
instances[name] = true
mx[px+name+"_bufman_page_reads"] = int64(pm.Value)
}
}
for _, pm := range pms.FindByName(metricMSSQLBufferPageWrites) {
if name := pm.Labels.Get("mssql_instance"); name != "" {
instances[name] = true
mx[px+name+"_bufman_page_writes"] = int64(pm.Value)
}
}
for _, pm := range pms.FindByName(metricMSSQLBlockedProcesses) {
if name := pm.Labels.Get("mssql_instance"); name != "" {
instances[name] = true
mx[px+name+"_genstats_blocked_processes"] = int64(pm.Value)
}
}
for _, pm := range pms.FindByName(metricMSSQLUserConnections) {
if name := pm.Labels.Get("mssql_instance"); name != "" {
instances[name] = true
mx[px+name+"_genstats_user_connections"] = int64(pm.Value)
}
}
for _, pm := range pms.FindByName(metricMSSQLLockWait) {
if name := pm.Labels.Get("mssql_instance"); name != "" {
instances[name] = true
if res := pm.Labels.Get("resource"); res != "" {
mx[px+name+"_resource_"+res+"_locks_lock_wait_seconds"] = int64(pm.Value)
}
}
}
for _, pm := range pms.FindByName(metricMSSQLDeadlocks) {
if name := pm.Labels.Get("mssql_instance"); name != "" {
instances[name] = true
if res := pm.Labels.Get("resource"); res != "" {
mx[px+name+"_resource_"+res+"_locks_deadlocks"] = int64(pm.Value)
}
}
}
for _, pm := range pms.FindByName(metricMSSQLConnectionMemoryBytes) {
if name := pm.Labels.Get("mssql_instance"); name != "" {
instances[name] = true
mx[px+name+"_memmgr_connection_memory_bytes"] = int64(pm.Value)
}
}
for _, pm := range pms.FindByName(metricMSSQLExternalBenefitOfMemory) {
if name := pm.Labels.Get("mssql_instance"); name != "" {
instances[name] = true
mx[px+name+"_memmgr_external_benefit_of_memory"] = int64(pm.Value)
}
}
for _, pm := range pms.FindByName(metricMSSQLPendingMemoryGrants) {
if name := pm.Labels.Get("mssql_instance"); name != "" {
instances[name] = true
mx[px+name+"_memmgr_pending_memory_grants"] = int64(pm.Value)
}
}
for _, pm := range pms.FindByName(metricMSSQLSQLErrorsTotal) {
if name := pm.Labels.Get("mssql_instance"); name != "" {
instances[name] = true
if res := pm.Labels.Get("resource"); res != "" && res != "_Total" {
dim := mssqlParseResource(res)
mx[px+name+"_sql_errors_total_"+dim] = int64(pm.Value)
}
}
}
for _, pm := range pms.FindByName(metricMSSQLTotalServerMemory) {
if name := pm.Labels.Get("mssql_instance"); name != "" {
instances[name] = true
mx[px+name+"_memmgr_total_server_memory_bytes"] = int64(pm.Value)
}
}
for _, pm := range pms.FindByName(metricMSSQLStatsAutoParameterization) {
if name := pm.Labels.Get("mssql_instance"); name != "" {
instances[name] = true
mx[px+name+"_sqlstats_auto_parameterization_attempts"] = int64(pm.Value)
}
}
for _, pm := range pms.FindByName(metricMSSQLStatsBatchRequests) {
if name := pm.Labels.Get("mssql_instance"); name != "" {
instances[name] = true
mx[px+name+"_sqlstats_batch_requests"] = int64(pm.Value)
}
}
for _, pm := range pms.FindByName(metricMSSQLStatSafeAutoParameterization) {
if name := pm.Labels.Get("mssql_instance"); name != "" {
instances[name] = true
mx[px+name+"_sqlstats_safe_auto_parameterization_attempts"] = int64(pm.Value)
}
}
for _, pm := range pms.FindByName(metricMSSQLCompilations) {
if name := pm.Labels.Get("mssql_instance"); name != "" {
instances[name] = true
mx[px+name+"_sqlstats_sql_compilations"] = int64(pm.Value)
}
}
for _, pm := range pms.FindByName(metricMSSQLRecompilations) {
if name := pm.Labels.Get("mssql_instance"); name != "" {
instances[name] = true
mx[px+name+"_sqlstats_sql_recompilations"] = int64(pm.Value)
}
}
px = "mssql_db_"
for _, pm := range pms.FindByName(metricMSSQLDatabaseActiveTransactions) {
if name, db := pm.Labels.Get("mssql_instance"), pm.Labels.Get("database"); name != "" && db != "" {
instances[name], dbs[name+":"+db] = true, true
mx[px+db+"_instance_"+name+"_active_transactions"] = int64(pm.Value)
}
}
for _, pm := range pms.FindByName(metricMSSQLDatabaseBackupRestoreOperations) {
if name, db := pm.Labels.Get("mssql_instance"), pm.Labels.Get("database"); name != "" && db != "" {
instances[name], dbs[name+":"+db] = true, true
mx[px+db+"_instance_"+name+"_backup_restore_operations"] = int64(pm.Value)
}
}
for _, pm := range pms.FindByName(metricMSSQLDatabaseDataFileSize) {
if name, db := pm.Labels.Get("mssql_instance"), pm.Labels.Get("database"); name != "" && db != "" {
instances[name], dbs[name+":"+db] = true, true
mx[px+db+"_instance_"+name+"_data_files_size_bytes"] = int64(pm.Value)
}
}
for _, pm := range pms.FindByName(metricMSSQLDatabaseLogFlushed) {
if name, db := pm.Labels.Get("mssql_instance"), pm.Labels.Get("database"); name != "" && db != "" {
instances[name], dbs[name+":"+db] = true, true
mx[px+db+"_instance_"+name+"_log_flushed_bytes"] = int64(pm.Value)
}
}
for _, pm := range pms.FindByName(metricMSSQLDatabaseLogFlushes) {
if name, db := pm.Labels.Get("mssql_instance"), pm.Labels.Get("database"); name != "" && db != "" {
instances[name], dbs[name+":"+db] = true, true
mx[px+db+"_instance_"+name+"_log_flushes"] = int64(pm.Value)
}
}
for _, pm := range pms.FindByName(metricMSSQLDatabaseTransactions) {
if name, db := pm.Labels.Get("mssql_instance"), pm.Labels.Get("database"); name != "" && db != "" {
instances[name], dbs[name+":"+db] = true, true
mx[px+db+"_instance_"+name+"_transactions"] = int64(pm.Value)
}
}
for _, pm := range pms.FindByName(metricMSSQLDatabaseWriteTransactions) {
if name, db := pm.Labels.Get("mssql_instance"), pm.Labels.Get("database"); name != "" && db != "" {
instances[name], dbs[name+":"+db] = true, true
mx[px+db+"_instance_"+name+"_write_transactions"] = int64(pm.Value)
}
}
for v := range instances {
if !c.cache.mssqlInstances[v] {
c.cache.mssqlInstances[v] = true
c.addMSSQLInstanceCharts(v)
}
}
for v := range c.cache.mssqlInstances {
if !instances[v] {
delete(c.cache.mssqlInstances, v)
c.removeMSSQLInstanceCharts(v)
}
}
for v := range dbs {
if !c.cache.mssqlDBs[v] {
c.cache.mssqlDBs[v] = true
if s := strings.Split(v, ":"); len(s) == 2 {
c.addMSSQLDBCharts(s[0], s[1])
}
}
}
for v := range c.cache.mssqlDBs {
if !dbs[v] {
delete(c.cache.mssqlDBs, v)
if s := strings.Split(v, ":"); len(s) == 2 {
c.removeMSSQLDBCharts(s[0], s[1])
}
}
}
}
func mssqlParseResource(name string) string {
name = strings.ReplaceAll(name, " ", "_")
return strings.ToLower(name)
}

View file

@ -1,90 +0,0 @@
// SPDX-License-Identifier: GPL-3.0-or-later
package windows
import (
"strings"
"github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/prometheus"
)
const (
metricNetBytesReceivedTotal = "windows_net_bytes_received_total"
metricNetBytesSentTotal = "windows_net_bytes_sent_total"
metricNetPacketsReceivedTotal = "windows_net_packets_received_total"
metricNetPacketsSentTotal = "windows_net_packets_sent_total"
metricNetPacketsReceivedDiscardedTotal = "windows_net_packets_received_discarded_total"
metricNetPacketsOutboundDiscardedTotal = "windows_net_packets_outbound_discarded_total"
metricNetPacketsReceivedErrorsTotal = "windows_net_packets_received_errors_total"
metricNetPacketsOutboundErrorsTotal = "windows_net_packets_outbound_errors_total"
)
func (c *Collector) collectNet(mx map[string]int64, pms prometheus.Series) {
seen := make(map[string]bool)
px := "net_nic_"
for _, pm := range pms.FindByName(metricNetBytesReceivedTotal) {
if nic := cleanNICID(pm.Labels.Get("nic")); nic != "" {
seen[nic] = true
mx[px+nic+"_bytes_received"] += int64(pm.Value * 8)
}
}
for _, pm := range pms.FindByName(metricNetBytesSentTotal) {
if nic := cleanNICID(pm.Labels.Get("nic")); nic != "" {
seen[nic] = true
mx[px+nic+"_bytes_sent"] += int64(pm.Value * 8)
}
}
for _, pm := range pms.FindByName(metricNetPacketsReceivedTotal) {
if nic := cleanNICID(pm.Labels.Get("nic")); nic != "" {
seen[nic] = true
mx[px+nic+"_packets_received_total"] += int64(pm.Value)
}
}
for _, pm := range pms.FindByName(metricNetPacketsSentTotal) {
if nic := cleanNICID(pm.Labels.Get("nic")); nic != "" {
seen[nic] = true
mx[px+nic+"_packets_sent_total"] += int64(pm.Value)
}
}
for _, pm := range pms.FindByName(metricNetPacketsReceivedDiscardedTotal) {
if nic := cleanNICID(pm.Labels.Get("nic")); nic != "" {
seen[nic] = true
mx[px+nic+"_packets_received_discarded"] += int64(pm.Value)
}
}
for _, pm := range pms.FindByName(metricNetPacketsOutboundDiscardedTotal) {
if nic := cleanNICID(pm.Labels.Get("nic")); nic != "" {
seen[nic] = true
mx[px+nic+"_packets_outbound_discarded"] += int64(pm.Value)
}
}
for _, pm := range pms.FindByName(metricNetPacketsReceivedErrorsTotal) {
if nic := cleanNICID(pm.Labels.Get("nic")); nic != "" {
seen[nic] = true
mx[px+nic+"_packets_received_errors"] += int64(pm.Value)
}
}
for _, pm := range pms.FindByName(metricNetPacketsOutboundErrorsTotal) {
if nic := cleanNICID(pm.Labels.Get("nic")); nic != "" {
seen[nic] = true
mx[px+nic+"_packets_outbound_errors"] += int64(pm.Value)
}
}
for nic := range seen {
if !c.cache.nics[nic] {
c.cache.nics[nic] = true
c.addNICCharts(nic)
}
}
for nic := range c.cache.nics {
if !seen[nic] {
delete(c.cache.nics, nic)
c.removeNICCharts(nic)
}
}
}
func cleanNICID(id string) string {
return strings.Replace(id, "__", "_", -1)
}

View file

@ -1,531 +0,0 @@
// SPDX-License-Identifier: GPL-3.0-or-later
package windows
import (
"github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/prometheus"
)
const (
netframeworkPrefix = "netframework_"
)
const (
metricNetFrameworkCLRExceptionsThrownTotal = "windows_netframework_clrexceptions_exceptions_thrown_total"
metricNetFrameworkCLRExceptionsFiltersTotal = "windows_netframework_clrexceptions_exceptions_filters_total"
metricNetFrameworkCLRExceptionsFinallysTotal = "windows_netframework_clrexceptions_exceptions_finallys_total"
metricNetFrameworkCLRExceptionsThrowCatchDepthTotal = "windows_netframework_clrexceptions_throw_to_catch_depth_total"
)
func (c *Collector) collectNetFrameworkCLRExceptions(mx map[string]int64, pms prometheus.Series) {
seen := make(map[string]bool)
for _, pm := range pms.FindByName(metricNetFrameworkCLRExceptionsThrownTotal) {
if name := cleanProcessName(pm.Labels.Get("process")); name != "" {
seen[name] = true
mx[netframeworkPrefix+name+"_clrexception_thrown_total"] += int64(pm.Value)
}
}
for _, pm := range pms.FindByName(metricNetFrameworkCLRExceptionsFiltersTotal) {
if name := cleanProcessName(pm.Labels.Get("process")); name != "" {
seen[name] = true
mx[netframeworkPrefix+name+"_clrexception_filters_total"] += int64(pm.Value)
}
}
for _, pm := range pms.FindByName(metricNetFrameworkCLRExceptionsFinallysTotal) {
if name := cleanProcessName(pm.Labels.Get("process")); name != "" {
seen[name] = true
mx[netframeworkPrefix+name+"_clrexception_finallys_total"] += int64(pm.Value)
}
}
for _, pm := range pms.FindByName(metricNetFrameworkCLRExceptionsThrowCatchDepthTotal) {
if name := cleanProcessName(pm.Labels.Get("process")); name != "" {
seen[name] = true
mx[netframeworkPrefix+name+"_clrexception_throw_to_catch_depth_total"] += int64(pm.Value)
}
}
for proc := range seen {
if !c.cache.netFrameworkCLRExceptions[proc] {
c.cache.netFrameworkCLRExceptions[proc] = true
c.addProcessNetFrameworkExceptionsCharts(proc)
}
}
for proc := range c.cache.netFrameworkCLRExceptions {
if !seen[proc] {
delete(c.cache.netFrameworkCLRExceptions, proc)
c.removeProcessFromNetFrameworkExceptionsCharts(proc)
}
}
}
const (
metricNetFrameworkCLRInteropComCallableWrappersTotal = "windows_netframework_clrinterop_com_callable_wrappers_total"
metricNetFrameworkCLRInteropMarshallingTotal = "windows_netframework_clrinterop_interop_marshalling_total"
metricNetFrameworkCLRInteropStubsCreatedTotal = "windows_netframework_clrinterop_interop_stubs_created_total"
)
func (c *Collector) collectNetFrameworkCLRInterop(mx map[string]int64, pms prometheus.Series) {
seen := make(map[string]bool)
for _, pm := range pms.FindByName(metricNetFrameworkCLRInteropComCallableWrappersTotal) {
if name := cleanProcessName(pm.Labels.Get("process")); name != "" {
seen[name] = true
mx[netframeworkPrefix+name+"_clrinterop_com_callable_wrappers_total"] += int64(pm.Value)
}
}
for _, pm := range pms.FindByName(metricNetFrameworkCLRInteropMarshallingTotal) {
if name := cleanProcessName(pm.Labels.Get("process")); name != "" {
seen[name] = true
mx[netframeworkPrefix+name+"_clrinterop_interop_marshalling_total"] += int64(pm.Value)
}
}
for _, pm := range pms.FindByName(metricNetFrameworkCLRInteropStubsCreatedTotal) {
if name := cleanProcessName(pm.Labels.Get("process")); name != "" {
seen[name] = true
mx[netframeworkPrefix+name+"_clrinterop_interop_stubs_created_total"] += int64(pm.Value)
}
}
for proc := range seen {
if !c.cache.netFrameworkCLRInterops[proc] {
c.cache.netFrameworkCLRInterops[proc] = true
c.addProcessNetFrameworkInteropCharts(proc)
}
}
for proc := range c.cache.netFrameworkCLRInterops {
if !seen[proc] {
delete(c.cache.netFrameworkCLRInterops, proc)
c.removeProcessNetFrameworkInteropCharts(proc)
}
}
}
const (
metricNetFrameworkCLRJITMethodsTotal = "windows_netframework_clrjit_jit_methods_total"
metricNetFrameworkCLRJITTimePercent = "windows_netframework_clrjit_jit_time_percent"
metricNetFrameworkCLRJITStandardFailuresTotal = "windows_netframework_clrjit_jit_standard_failures_total"
metricNetFrameworkCLRJITILBytesTotal = "windows_netframework_clrjit_jit_il_bytes_total"
)
func (c *Collector) collectNetFrameworkCLRJIT(mx map[string]int64, pms prometheus.Series) {
seen := make(map[string]bool)
for _, pm := range pms.FindByName(metricNetFrameworkCLRJITMethodsTotal) {
if name := cleanProcessName(pm.Labels.Get("process")); name != "" {
seen[name] = true
mx[netframeworkPrefix+name+"_clrjit_methods_total"] += int64(pm.Value)
}
}
for _, pm := range pms.FindByName(metricNetFrameworkCLRJITStandardFailuresTotal) {
if name := cleanProcessName(pm.Labels.Get("process")); name != "" {
seen[name] = true
mx[netframeworkPrefix+name+"_clrjit_standard_failures_total"] += int64(pm.Value)
}
}
for _, pm := range pms.FindByName(metricNetFrameworkCLRJITTimePercent) {
if name := cleanProcessName(pm.Labels.Get("process")); name != "" {
seen[name] = true
mx[netframeworkPrefix+name+"_clrjit_time_percent"] += int64(pm.Value)
}
}
for _, pm := range pms.FindByName(metricNetFrameworkCLRJITILBytesTotal) {
if name := cleanProcessName(pm.Labels.Get("process")); name != "" {
seen[name] = true
mx[netframeworkPrefix+name+"_clrjit_il_bytes_total"] += int64(pm.Value)
}
}
for proc := range seen {
if !c.cache.netFrameworkCLRJIT[proc] {
c.cache.netFrameworkCLRJIT[proc] = true
c.addProcessNetFrameworkJITCharts(proc)
}
}
for proc := range c.cache.netFrameworkCLRJIT {
if !seen[proc] {
delete(c.cache.netFrameworkCLRJIT, proc)
c.removeProcessNetFrameworkJITCharts(proc)
}
}
}
const (
metricNetFrameworkCLRLoadingLoaderHeapSizeBytes = "windows_netframework_clrloading_loader_heap_size_bytes"
metricNetFrameworkCLRLoadingAppDomainLoadedTotal = "windows_netframework_clrloading_appdomains_loaded_total"
metricNetFrameworkCLRLoadingAppDomainUnloadedTotal = "windows_netframework_clrloading_appdomains_unloaded_total"
metricNetFrameworkCLRLoadingAssembliesLoadedTotal = "windows_netframework_clrloading_assemblies_loaded_total"
metricNetFrameworkCLRLoadingClassesLoadedTotal = "windows_netframework_clrloading_classes_loaded_total"
metricNetFrameworkCLRLoadingClassLoadFailuresTotal = "windows_netframework_clrloading_class_load_failures_total"
)
func (c *Collector) collectNetFrameworkCLRLoading(mx map[string]int64, pms prometheus.Series) {
seen := make(map[string]bool)
for _, pm := range pms.FindByName(metricNetFrameworkCLRLoadingLoaderHeapSizeBytes) {
if name := cleanProcessName(pm.Labels.Get("process")); name != "" {
seen[name] = true
mx[netframeworkPrefix+name+"_clrloading_loader_heap_size_bytes"] += int64(pm.Value)
}
}
for _, pm := range pms.FindByName(metricNetFrameworkCLRLoadingAppDomainLoadedTotal) {
if name := cleanProcessName(pm.Labels.Get("process")); name != "" {
seen[name] = true
mx[netframeworkPrefix+name+"_clrloading_appdomains_loaded_total"] += int64(pm.Value)
}
}
for _, pm := range pms.FindByName(metricNetFrameworkCLRLoadingAppDomainUnloadedTotal) {
if name := cleanProcessName(pm.Labels.Get("process")); name != "" {
seen[name] = true
mx[netframeworkPrefix+name+"_clrloading_appdomains_unloaded_total"] += int64(pm.Value)
}
}
for _, pm := range pms.FindByName(metricNetFrameworkCLRLoadingAssembliesLoadedTotal) {
if name := cleanProcessName(pm.Labels.Get("process")); name != "" {
seen[name] = true
mx[netframeworkPrefix+name+"_clrloading_assemblies_loaded_total"] += int64(pm.Value)
}
}
for _, pm := range pms.FindByName(metricNetFrameworkCLRLoadingClassesLoadedTotal) {
if name := cleanProcessName(pm.Labels.Get("process")); name != "" {
seen[name] = true
mx[netframeworkPrefix+name+"_clrloading_classes_loaded_total"] += int64(pm.Value)
}
}
for _, pm := range pms.FindByName(metricNetFrameworkCLRLoadingClassLoadFailuresTotal) {
if name := cleanProcessName(pm.Labels.Get("process")); name != "" {
seen[name] = true
mx[netframeworkPrefix+name+"_clrloading_class_load_failures_total"] += int64(pm.Value)
}
}
for proc := range seen {
if !c.cache.netFrameworkCLRLoading[proc] {
c.cache.netFrameworkCLRLoading[proc] = true
c.addProcessNetFrameworkLoadingCharts(proc)
}
}
for proc := range c.cache.netFrameworkCLRLoading {
if !seen[proc] {
delete(c.cache.netFrameworkCLRLoading, proc)
c.removeProcessNetFrameworkLoadingCharts(proc)
}
}
}
const (
metricNetFrameworkCLRLocksAndThreadsQueueLengthTotal = "windows_netframework_clrlocksandthreads_queue_length_total"
metricNetFrameworkCLRLocksAndThreadsCurrentLogicalThreads = "windows_netframework_clrlocksandthreads_current_logical_threads"
metricNetFrameworkCLRLocksAndThreadsPhysicalThreadsCurrent = "windows_netframework_clrlocksandthreads_physical_threads_current"
metricNetFrameworkCLRLocksAndThreadsRecognizedThreadsTotal = "windows_netframework_clrlocksandthreads_recognized_threads_total"
metricNetFrameworkCLRLocksAndThreadsContentionsTotal = "windows_netframework_clrlocksandthreads_contentions_total"
)
func (c *Collector) collectNetFrameworkCLRLocksAndThreads(mx map[string]int64, pms prometheus.Series) {
seen := make(map[string]bool)
for _, pm := range pms.FindByName(metricNetFrameworkCLRLocksAndThreadsQueueLengthTotal) {
if name := cleanProcessName(pm.Labels.Get("process")); name != "" {
seen[name] = true
mx[netframeworkPrefix+name+"_clrlocksandthreads_queue_length_total"] += int64(pm.Value)
}
}
for _, pm := range pms.FindByName(metricNetFrameworkCLRLocksAndThreadsCurrentLogicalThreads) {
if name := cleanProcessName(pm.Labels.Get("process")); name != "" {
seen[name] = true
mx[netframeworkPrefix+name+"_clrlocksandthreads_current_logical_threads"] += int64(pm.Value)
}
}
for _, pm := range pms.FindByName(metricNetFrameworkCLRLocksAndThreadsPhysicalThreadsCurrent) {
if name := cleanProcessName(pm.Labels.Get("process")); name != "" {
seen[name] = true
mx[netframeworkPrefix+name+"_clrlocksandthreads_physical_threads_current"] += int64(pm.Value)
}
}
for _, pm := range pms.FindByName(metricNetFrameworkCLRLocksAndThreadsRecognizedThreadsTotal) {
if name := cleanProcessName(pm.Labels.Get("process")); name != "" {
seen[name] = true
mx[netframeworkPrefix+name+"_clrlocksandthreads_recognized_threads_total"] += int64(pm.Value)
}
}
for _, pm := range pms.FindByName(metricNetFrameworkCLRLocksAndThreadsContentionsTotal) {
if name := cleanProcessName(pm.Labels.Get("process")); name != "" {
seen[name] = true
mx[netframeworkPrefix+name+"_clrlocksandthreads_contentions_total"] += int64(pm.Value)
}
}
for proc := range seen {
if !c.cache.netFrameworkCLRLocksThreads[proc] {
c.cache.netFrameworkCLRLocksThreads[proc] = true
c.addProcessNetFrameworkLocksAndThreadsCharts(proc)
}
}
for proc := range c.cache.netFrameworkCLRLocksThreads {
if !seen[proc] {
delete(c.cache.netFrameworkCLRLocksThreads, proc)
c.removeProcessNetFrameworkLocksAndThreadsCharts(proc)
}
}
}
const (
metricNetFrameworkCLRMemoryAllocatedBytesTotal = "windows_netframework_clrmemory_allocated_bytes_total"
metricNetFrameworkCLRMemoryFinalizationSurvivors = "windows_netframework_clrmemory_finalization_survivors"
metricNetFrameworkCLRMemoryHeapSizeBytes = "windows_netframework_clrmemory_heap_size_bytes"
metricNetFrameworkCLRMemoryPromotedBytes = "windows_netframework_clrmemory_promoted_bytes"
metricNetFrameworkCLRMemoryNumberGCHandles = "windows_netframework_clrmemory_number_gc_handles"
metricNetFrameworkCLRMemoryCollectionsTotal = "windows_netframework_clrmemory_collections_total"
metricNetFrameworkCLRMemoryInducedGCTotal = "windows_netframework_clrmemory_induced_gc_total"
metricNetFrameworkCLRMemoryNumberPinnedObjects = "windows_netframework_clrmemory_number_pinned_objects"
metricNetFrameworkCLRMemoryNumberSinkBlockInUse = "windows_netframework_clrmemory_number_sink_blocksinuse"
metricNetFrameworkCLRMemoryCommittedBytes = "windows_netframework_clrmemory_committed_bytes"
metricNetFrameworkCLRMemoryReservedBytes = "windows_netframework_clrmemory_reserved_bytes"
metricNetFrameworkCLRMemoryGCTimePercent = "windows_netframework_clrmemory_gc_time_percent"
)
func (c *Collector) collectNetFrameworkCLRMemory(mx map[string]int64, pms prometheus.Series) {
seen := make(map[string]bool)
for _, pm := range pms.FindByName(metricNetFrameworkCLRMemoryAllocatedBytesTotal) {
if name := cleanProcessName(pm.Labels.Get("process")); name != "" {
seen[name] = true
mx[netframeworkPrefix+name+"_clrmemory_allocated_bytes_total"] += int64(pm.Value)
}
}
for _, pm := range pms.FindByName(metricNetFrameworkCLRMemoryFinalizationSurvivors) {
if name := cleanProcessName(pm.Labels.Get("process")); name != "" {
seen[name] = true
mx[netframeworkPrefix+name+"_clrmemory_finalization_survivors"] += int64(pm.Value)
}
}
for _, pm := range pms.FindByName(metricNetFrameworkCLRMemoryHeapSizeBytes) {
if name := cleanProcessName(pm.Labels.Get("process")); name != "" {
seen[name] = true
mx[netframeworkPrefix+name+"_clrmemory_heap_size_bytes"] += int64(pm.Value)
}
}
for _, pm := range pms.FindByName(metricNetFrameworkCLRMemoryPromotedBytes) {
if name := cleanProcessName(pm.Labels.Get("process")); name != "" {
seen[name] = true
mx[netframeworkPrefix+name+"_clrmemory_promoted_bytes"] += int64(pm.Value)
}
}
for _, pm := range pms.FindByName(metricNetFrameworkCLRMemoryNumberGCHandles) {
if name := cleanProcessName(pm.Labels.Get("process")); name != "" {
seen[name] = true
mx[netframeworkPrefix+name+"_clrmemory_number_gc_handles"] += int64(pm.Value)
}
}
for _, pm := range pms.FindByName(metricNetFrameworkCLRMemoryCollectionsTotal) {
if name := cleanProcessName(pm.Labels.Get("process")); name != "" {
seen[name] = true
mx[netframeworkPrefix+name+"_clrmemory_collections_total"] += int64(pm.Value)
}
}
for _, pm := range pms.FindByName(metricNetFrameworkCLRMemoryInducedGCTotal) {
if name := cleanProcessName(pm.Labels.Get("process")); name != "" {
seen[name] = true
mx[netframeworkPrefix+name+"_clrmemory_induced_gc_total"] += int64(pm.Value)
}
}
for _, pm := range pms.FindByName(metricNetFrameworkCLRMemoryNumberPinnedObjects) {
if name := cleanProcessName(pm.Labels.Get("process")); name != "" {
seen[name] = true
mx[netframeworkPrefix+name+"_clrmemory_number_pinned_objects"] += int64(pm.Value)
}
}
for _, pm := range pms.FindByName(metricNetFrameworkCLRMemoryNumberSinkBlockInUse) {
if name := cleanProcessName(pm.Labels.Get("process")); name != "" {
seen[name] = true
mx[netframeworkPrefix+name+"_clrmemory_number_sink_blocksinuse"] += int64(pm.Value)
}
}
for _, pm := range pms.FindByName(metricNetFrameworkCLRMemoryCommittedBytes) {
if name := cleanProcessName(pm.Labels.Get("process")); name != "" {
seen[name] = true
mx[netframeworkPrefix+name+"_clrmemory_committed_bytes"] += int64(pm.Value)
}
}
for _, pm := range pms.FindByName(metricNetFrameworkCLRMemoryReservedBytes) {
if name := cleanProcessName(pm.Labels.Get("process")); name != "" {
seen[name] = true
mx[netframeworkPrefix+name+"_clrmemory_reserved_bytes"] += int64(pm.Value)
}
}
for _, pm := range pms.FindByName(metricNetFrameworkCLRMemoryGCTimePercent) {
if name := cleanProcessName(pm.Labels.Get("process")); name != "" {
seen[name] = true
mx[netframeworkPrefix+name+"_clrmemory_gc_time_percent"] += int64(pm.Value)
}
}
for proc := range seen {
if !c.cache.netFrameworkCLRMemory[proc] {
c.cache.netFrameworkCLRMemory[proc] = true
c.addProcessNetFrameworkMemoryCharts(proc)
}
}
for proc := range c.cache.netFrameworkCLRMemory {
if !seen[proc] {
delete(c.cache.netFrameworkCLRMemory, proc)
c.removeProcessNetFrameworkMemoryCharts(proc)
}
}
}
const (
metricNetFrameworkCLRRemotingChannelsTotal = "windows_netframework_clrremoting_channels_total"
metricNetFrameworkCLRRemotingContextBoundClassesLoaded = "windows_netframework_clrremoting_context_bound_classes_loaded"
metricNetFrameworkCLRRemotingContextBoundObjectsTotal = "windows_netframework_clrremoting_context_bound_objects_total"
metricNetFrameworkCLRRemotingContextProxiesTotal = "windows_netframework_clrremoting_context_proxies_total"
metricNetFrameworkCLRRemotingContexts = "windows_netframework_clrremoting_contexts"
metricNetFrameworkCLRRemotingRemoteCallsTotal = "windows_netframework_clrremoting_remote_calls_total"
)
func (c *Collector) collectNetFrameworkCLRRemoting(mx map[string]int64, pms prometheus.Series) {
seen := make(map[string]bool)
for _, pm := range pms.FindByName(metricNetFrameworkCLRRemotingChannelsTotal) {
if name := cleanProcessName(pm.Labels.Get("process")); name != "" {
seen[name] = true
mx[netframeworkPrefix+name+"_clrremoting_channels_total"] += int64(pm.Value)
}
}
for _, pm := range pms.FindByName(metricNetFrameworkCLRRemotingContextBoundClassesLoaded) {
if name := cleanProcessName(pm.Labels.Get("process")); name != "" {
seen[name] = true
mx[netframeworkPrefix+name+"_clrremoting_context_bound_classes_loaded"] += int64(pm.Value)
}
}
for _, pm := range pms.FindByName(metricNetFrameworkCLRRemotingContextBoundObjectsTotal) {
if name := cleanProcessName(pm.Labels.Get("process")); name != "" {
seen[name] = true
mx[netframeworkPrefix+name+"_clrremoting_context_bound_objects_total"] += int64(pm.Value)
}
}
for _, pm := range pms.FindByName(metricNetFrameworkCLRRemotingContextProxiesTotal) {
if name := cleanProcessName(pm.Labels.Get("process")); name != "" {
seen[name] = true
mx[netframeworkPrefix+name+"_clrremoting_context_proxies_total"] += int64(pm.Value)
}
}
for _, pm := range pms.FindByName(metricNetFrameworkCLRRemotingContexts) {
if name := cleanProcessName(pm.Labels.Get("process")); name != "" {
seen[name] = true
mx[netframeworkPrefix+name+"_clrremoting_contexts"] += int64(pm.Value)
}
}
for _, pm := range pms.FindByName(metricNetFrameworkCLRRemotingRemoteCallsTotal) {
if name := cleanProcessName(pm.Labels.Get("process")); name != "" {
seen[name] = true
mx[netframeworkPrefix+name+"_clrremoting_remote_calls_total"] += int64(pm.Value)
}
}
for proc := range seen {
if !c.cache.netFrameworkCLRRemoting[proc] {
c.cache.netFrameworkCLRRemoting[proc] = true
c.addProcessNetFrameworkRemotingCharts(proc)
}
}
for proc := range c.cache.netFrameworkCLRRemoting {
if !seen[proc] {
delete(c.cache.netFrameworkCLRRemoting, proc)
c.removeProcessNetFrameworkRemotingCharts(proc)
}
}
}
const (
metricNetFrameworkCLRSecurityLinkTimeChecksTotal = "windows_netframework_clrsecurity_link_time_checks_total"
metricNetFrameworkCLRSecurityRTChecksTimePercent = "windows_netframework_clrsecurity_rt_checks_time_percent"
metricNetFrameworkCLRSecurityStackWalkDepth = "windows_netframework_clrsecurity_stack_walk_depth"
metricNetFrameworkCLRSecurityRuntimeChecksTotal = "windows_netframework_clrsecurity_runtime_checks_total"
)
func (c *Collector) collectNetFrameworkCLRSecurity(mx map[string]int64, pms prometheus.Series) {
seen := make(map[string]bool)
for _, pm := range pms.FindByName(metricNetFrameworkCLRSecurityLinkTimeChecksTotal) {
if name := cleanProcessName(pm.Labels.Get("process")); name != "" {
seen[name] = true
mx[netframeworkPrefix+name+"_clrsecurity_link_time_checks_total"] += int64(pm.Value)
}
}
for _, pm := range pms.FindByName(metricNetFrameworkCLRSecurityRTChecksTimePercent) {
if name := cleanProcessName(pm.Labels.Get("process")); name != "" {
seen[name] = true
mx[netframeworkPrefix+name+"_clrsecurity_checks_time_percent"] += int64(pm.Value)
}
}
for _, pm := range pms.FindByName(metricNetFrameworkCLRSecurityStackWalkDepth) {
if name := cleanProcessName(pm.Labels.Get("process")); name != "" {
seen[name] = true
mx[netframeworkPrefix+name+"_clrsecurity_stack_walk_depth"] += int64(pm.Value)
}
}
for _, pm := range pms.FindByName(metricNetFrameworkCLRSecurityRuntimeChecksTotal) {
if name := cleanProcessName(pm.Labels.Get("process")); name != "" {
seen[name] = true
mx[netframeworkPrefix+name+"_clrsecurity_runtime_checks_total"] += int64(pm.Value)
}
}
for proc := range seen {
if !c.cache.netFrameworkCLRSecurity[proc] {
c.cache.netFrameworkCLRSecurity[proc] = true
c.addProcessNetFrameworkSecurityCharts(proc)
}
}
for proc := range c.cache.netFrameworkCLRSecurity {
if !seen[proc] {
delete(c.cache.netFrameworkCLRSecurity, proc)
c.removeProcessNetFrameworkSecurityCharts(proc)
}
}
}

View file

@ -1,47 +0,0 @@
// SPDX-License-Identifier: GPL-3.0-or-later
package windows
import (
"github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/prometheus"
)
const (
metricOSPhysicalMemoryFreeBytes = "windows_os_physical_memory_free_bytes"
metricOSPagingFreeBytes = "windows_os_paging_free_bytes"
metricOSProcessesLimit = "windows_os_processes_limit"
metricOSProcesses = "windows_os_processes"
metricOSUsers = "windows_os_users"
metricOSPagingLimitBytes = "windows_os_paging_limit_bytes"
metricOSVisibleMemoryBytes = "windows_os_visible_memory_bytes"
)
func (c *Collector) collectOS(mx map[string]int64, pms prometheus.Series) {
if !c.cache.collection[collectorOS] {
c.cache.collection[collectorOS] = true
c.addOSCharts()
}
px := "os_"
if pm := pms.FindByName(metricOSPhysicalMemoryFreeBytes); pm.Len() > 0 {
mx[px+"physical_memory_free_bytes"] = int64(pm.Max())
}
if pm := pms.FindByName(metricOSPagingFreeBytes); pm.Len() > 0 {
mx[px+"paging_free_bytes"] = int64(pm.Max())
}
if pm := pms.FindByName(metricOSProcessesLimit); pm.Len() > 0 {
mx[px+"processes_limit"] = int64(pm.Max())
}
if pm := pms.FindByName(metricOSProcesses); pm.Len() > 0 {
mx[px+"processes"] = int64(pm.Max())
}
if pm := pms.FindByName(metricOSUsers); pm.Len() > 0 {
mx[px+"users"] = int64(pm.Max())
}
if pm := pms.FindByName(metricOSPagingLimitBytes); pm.Len() > 0 {
mx[px+"paging_limit_bytes"] = int64(pm.Max())
}
if pm := pms.FindByName(metricOSVisibleMemoryBytes); pm.Len() > 0 {
mx[px+"visible_memory_bytes"] = int64(pm.Max())
}
}

View file

@ -1,95 +0,0 @@
// SPDX-License-Identifier: GPL-3.0-or-later
package windows
import (
"strings"
"github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/prometheus"
)
const (
metricProcessCPUTimeTotal = "windows_process_cpu_time_total"
metricProcessWorkingSetBytes = "windows_process_working_set_private_bytes"
metricProcessIOBytes = "windows_process_io_bytes_total"
metricProcessIOOperations = "windows_process_io_operations_total"
metricProcessPageFaults = "windows_process_page_faults_total"
metricProcessPageFileBytes = "windows_process_page_file_bytes"
metricProcessThreads = "windows_process_threads"
metricProcessCPUHandles = "windows_process_handles"
)
func (c *Collector) collectProcess(mx map[string]int64, pms prometheus.Series) {
if !c.cache.collection[collectorProcess] {
c.cache.collection[collectorProcess] = true
c.addProcessesCharts()
}
seen := make(map[string]bool)
px := "process_"
for _, pm := range pms.FindByName(metricProcessCPUTimeTotal) {
if name := cleanProcessName(pm.Labels.Get("process")); name != "" {
seen[name] = true
mx[px+name+"_cpu_time"] += int64(pm.Value * 1000)
}
}
for _, pm := range pms.FindByName(metricProcessWorkingSetBytes) {
if name := cleanProcessName(pm.Labels.Get("process")); name != "" {
seen[name] = true
mx[px+name+"_working_set_private_bytes"] += int64(pm.Value)
}
}
for _, pm := range pms.FindByName(metricProcessIOBytes) {
if name := cleanProcessName(pm.Labels.Get("process")); name != "" {
seen[name] = true
mx[px+name+"_io_bytes"] += int64(pm.Value)
}
}
for _, pm := range pms.FindByName(metricProcessIOOperations) {
if name := cleanProcessName(pm.Labels.Get("process")); name != "" {
seen[name] = true
mx[px+name+"_io_operations"] += int64(pm.Value)
}
}
for _, pm := range pms.FindByName(metricProcessPageFaults) {
if name := cleanProcessName(pm.Labels.Get("process")); name != "" {
seen[name] = true
mx[px+name+"_page_faults"] += int64(pm.Value)
}
}
for _, pm := range pms.FindByName(metricProcessPageFileBytes) {
if name := cleanProcessName(pm.Labels.Get("process")); name != "" {
seen[name] = true
mx[px+name+"_page_file_bytes"] += int64(pm.Value)
}
}
for _, pm := range pms.FindByName(metricProcessThreads) {
if name := cleanProcessName(pm.Labels.Get("process")); name != "" {
seen[name] = true
mx[px+name+"_threads"] += int64(pm.Value)
}
}
for _, pm := range pms.FindByName(metricProcessCPUHandles) {
if name := cleanProcessName(pm.Labels.Get("process")); name != "" {
seen[name] = true
mx[px+name+"_handles"] += int64(pm.Value)
}
}
for proc := range seen {
if !c.cache.processes[proc] {
c.cache.processes[proc] = true
c.addProcessToCharts(proc)
}
}
for proc := range c.cache.processes {
if !seen[proc] {
delete(c.cache.processes, proc)
c.removeProcessFromCharts(proc)
}
}
}
func cleanProcessName(name string) string {
return strings.ReplaceAll(name, " ", "_")
}

View file

@ -1,56 +0,0 @@
// SPDX-License-Identifier: GPL-3.0-or-later
package windows
import (
"strings"
"github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/prometheus"
)
const (
metricServiceState = "windows_service_state"
metricServiceStatus = "windows_service_status"
)
func (c *Collector) collectService(mx map[string]int64, pms prometheus.Series) {
seen := make(map[string]bool)
px := "service_"
for _, pm := range pms.FindByName(metricServiceState) {
name := cleanService(pm.Labels.Get("name"))
state := cleanService(pm.Labels.Get("state"))
if name == "" || state == "" {
continue
}
seen[name] = true
mx[px+name+"_state_"+state] = int64(pm.Value)
}
for _, pm := range pms.FindByName(metricServiceStatus) {
name := cleanService(pm.Labels.Get("name"))
status := cleanService(pm.Labels.Get("status"))
if name == "" || status == "" {
continue
}
seen[name] = true
mx[px+name+"_status_"+status] = int64(pm.Value)
}
for svc := range seen {
if !c.cache.services[svc] {
c.cache.services[svc] = true
c.addServiceCharts(svc)
}
}
for svc := range c.cache.services {
if !seen[svc] {
delete(c.cache.services, svc)
c.removeServiceCharts(svc)
}
}
}
func cleanService(name string) string {
return strings.ReplaceAll(name, " ", "_")
}

View file

@ -1,29 +0,0 @@
// SPDX-License-Identifier: GPL-3.0-or-later
package windows
import (
"time"
"github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/prometheus"
)
const (
metricSysSystemUpTime = "windows_system_system_up_time"
metricSysThreads = "windows_system_threads"
)
func (c *Collector) collectSystem(mx map[string]int64, pms prometheus.Series) {
if !c.cache.collection[collectorSystem] {
c.cache.collection[collectorSystem] = true
c.addSystemCharts()
}
px := "system_"
if pm := pms.FindByName(metricSysSystemUpTime); pm.Len() > 0 {
mx[px+"up_time"] = time.Now().Unix() - int64(pm.Max())
}
if pm := pms.FindByName(metricSysThreads); pm.Len() > 0 {
mx[px+"threads"] = int64(pm.Max())
}
}

View file

@ -1,65 +0,0 @@
// SPDX-License-Identifier: GPL-3.0-or-later
package windows
import "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/prometheus"
const (
metricTCPConnectionFailure = "windows_tcp_connection_failures_total"
metricTCPConnectionActive = "windows_tcp_connections_active_total"
metricTCPConnectionEstablished = "windows_tcp_connections_established"
metricTCPConnectionPassive = "windows_tcp_connections_passive_total"
metricTCPConnectionReset = "windows_tcp_connections_reset_total"
metricTCPConnectionSegmentsReceived = "windows_tcp_segments_received_total"
metricTCPConnectionSegmentsRetransmitted = "windows_tcp_segments_retransmitted_total"
metricTCPConnectionSegmentsSent = "windows_tcp_segments_sent_total"
)
func (c *Collector) collectTCP(mx map[string]int64, pms prometheus.Series) {
if !c.cache.collection[collectorTCP] {
c.cache.collection[collectorTCP] = true
c.addTCPCharts()
}
px := "tcp_"
for _, pm := range pms.FindByName(metricTCPConnectionFailure) {
if af := pm.Labels.Get("af"); af != "" {
mx[px+af+"_conns_failures"] = int64(pm.Value)
}
}
for _, pm := range pms.FindByName(metricTCPConnectionActive) {
if af := pm.Labels.Get("af"); af != "" {
mx[px+af+"_conns_active"] = int64(pm.Value)
}
}
for _, pm := range pms.FindByName(metricTCPConnectionEstablished) {
if af := pm.Labels.Get("af"); af != "" {
mx[px+af+"_conns_established"] = int64(pm.Value)
}
}
for _, pm := range pms.FindByName(metricTCPConnectionPassive) {
if af := pm.Labels.Get("af"); af != "" {
mx[px+af+"_conns_passive"] = int64(pm.Value)
}
}
for _, pm := range pms.FindByName(metricTCPConnectionReset) {
if af := pm.Labels.Get("af"); af != "" {
mx[px+af+"_conns_resets"] = int64(pm.Value)
}
}
for _, pm := range pms.FindByName(metricTCPConnectionSegmentsReceived) {
if af := pm.Labels.Get("af"); af != "" {
mx[px+af+"_segments_received"] = int64(pm.Value)
}
}
for _, pm := range pms.FindByName(metricTCPConnectionSegmentsRetransmitted) {
if af := pm.Labels.Get("af"); af != "" {
mx[px+af+"_segments_retransmitted"] = int64(pm.Value)
}
}
for _, pm := range pms.FindByName(metricTCPConnectionSegmentsSent) {
if af := pm.Labels.Get("af"); af != "" {
mx[px+af+"_segments_sent"] = int64(pm.Value)
}
}
}

View file

@ -1,45 +0,0 @@
// SPDX-License-Identifier: GPL-3.0-or-later
package windows
import (
"strings"
"github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/prometheus"
)
const (
metricThermalzoneTemperatureCelsius = "windows_thermalzone_temperature_celsius"
)
func (c *Collector) collectThermalzone(mx map[string]int64, pms prometheus.Series) {
seen := make(map[string]bool)
for _, pm := range pms.FindByName(metricThermalzoneTemperatureCelsius) {
if name := cleanZoneName(pm.Labels.Get("name")); name != "" {
seen[name] = true
mx["thermalzone_"+name+"_temperature"] = int64(pm.Value)
}
}
for zone := range seen {
if !c.cache.thermalZones[zone] {
c.cache.thermalZones[zone] = true
c.addThermalZoneCharts(zone)
}
}
for zone := range c.cache.thermalZones {
if !seen[zone] {
delete(c.cache.thermalZones, zone)
c.removeThermalZoneCharts(zone)
}
}
}
func cleanZoneName(name string) string {
// "\\_TZ.TZ10", "\\_TZ.X570" => TZ10, X570
i := strings.Index(name, ".")
if i == -1 || len(name) == i+1 {
return ""
}
return name[i+1:]
}

View file

@ -1,171 +0,0 @@
// SPDX-License-Identifier: GPL-3.0-or-later
package windows
import (
"context"
_ "embed"
"errors"
"fmt"
"time"
"github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module"
"github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/confopt"
"github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/prometheus"
"github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/web"
)
//go:embed "config_schema.json"
var configSchema string
func init() {
module.Register("windows", module.Creator{
JobConfigSchema: configSchema,
Defaults: module.Defaults{
UpdateEvery: 5,
},
Create: func() module.Module { return New() },
Config: func() any { return &Config{} },
})
}
func New() *Collector {
return &Collector{
Config: Config{
HTTPConfig: web.HTTPConfig{
ClientConfig: web.ClientConfig{
Timeout: confopt.Duration(time.Second * 5),
},
},
},
cache: cache{
collection: make(map[string]bool),
collectors: make(map[string]bool),
cores: make(map[string]bool),
nics: make(map[string]bool),
volumes: make(map[string]bool),
thermalZones: make(map[string]bool),
processes: make(map[string]bool),
iis: make(map[string]bool),
adcs: make(map[string]bool),
services: make(map[string]bool),
netFrameworkCLRExceptions: make(map[string]bool),
netFrameworkCLRInterops: make(map[string]bool),
netFrameworkCLRJIT: make(map[string]bool),
netFrameworkCLRLoading: make(map[string]bool),
netFrameworkCLRLocksThreads: make(map[string]bool),
netFrameworkCLRMemory: make(map[string]bool),
netFrameworkCLRRemoting: make(map[string]bool),
netFrameworkCLRSecurity: make(map[string]bool),
mssqlInstances: make(map[string]bool),
mssqlDBs: make(map[string]bool),
exchangeWorkload: make(map[string]bool),
exchangeLDAP: make(map[string]bool),
exchangeHTTPProxy: make(map[string]bool),
hypervVMMem: make(map[string]bool),
hypervVMDevices: make(map[string]bool),
hypervVMInterfaces: make(map[string]bool),
hypervVswitch: make(map[string]bool),
},
charts: &module.Charts{},
}
}
type Config struct {
UpdateEvery int `yaml:"update_every,omitempty" json:"update_every"`
web.HTTPConfig `yaml:",inline" json:""`
Vnode string `yaml:"vnode,omitempty" json:"vnode"`
}
type (
Collector struct {
module.Base
Config `yaml:",inline" json:""`
charts *module.Charts
prom prometheus.Prometheus
cache cache
}
cache struct {
cores map[string]bool
volumes map[string]bool
nics map[string]bool
thermalZones map[string]bool
processes map[string]bool
iis map[string]bool
adcs map[string]bool
mssqlInstances map[string]bool
mssqlDBs map[string]bool
services map[string]bool
netFrameworkCLRExceptions map[string]bool
netFrameworkCLRInterops map[string]bool
netFrameworkCLRJIT map[string]bool
netFrameworkCLRLoading map[string]bool
netFrameworkCLRLocksThreads map[string]bool
netFrameworkCLRMemory map[string]bool
netFrameworkCLRRemoting map[string]bool
netFrameworkCLRSecurity map[string]bool
collectors map[string]bool
collection map[string]bool
exchangeWorkload map[string]bool
exchangeLDAP map[string]bool
exchangeHTTPProxy map[string]bool
hypervVMMem map[string]bool
hypervVMDevices map[string]bool
hypervVMInterfaces map[string]bool
hypervVswitch map[string]bool
}
)
func (c *Collector) Configuration() any {
return c.Config
}
func (c *Collector) Init(context.Context) error {
if err := c.validateConfig(); err != nil {
return fmt.Errorf("config validation: %v", err)
}
prom, err := c.initPrometheusClient()
if err != nil {
return fmt.Errorf("init prometheus clients: %v", err)
}
c.prom = prom
return nil
}
func (c *Collector) Check(context.Context) error {
mx, err := c.collect()
if err != nil {
return err
}
if len(mx) == 0 {
return errors.New("no metrics collected")
}
return nil
}
func (c *Collector) Charts() *module.Charts {
return c.charts
}
func (c *Collector) Collect(context.Context) map[string]int64 {
ms, err := c.collect()
if err != nil {
c.Error(err)
}
if len(ms) == 0 {
return nil
}
return ms
}
func (c *Collector) Cleanup(context.Context) {
if c.prom != nil && c.prom.HTTPClient() != nil {
c.prom.HTTPClient().CloseIdleConnections()
}
}

File diff suppressed because it is too large Load diff

View file

@ -1,192 +0,0 @@
{
"jsonSchema": {
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "Windows collector configuration.",
"type": "object",
"properties": {
"update_every": {
"title": "Update every",
"description": "Data collection interval, measured in seconds.",
"type": "integer",
"minimum": 1,
"default": 5
},
"url": {
"title": "URL",
"description": "The URL of the Windows exporter metrics endpoint.",
"type": "string"
},
"timeout": {
"title": "Timeout",
"description": "The timeout in seconds for the HTTP request.",
"type": "number",
"minimum": 0.5,
"default": 5
},
"not_follow_redirects": {
"title": "Not follow redirects",
"description": "If set, the client will not follow HTTP redirects automatically.",
"type": "boolean"
},
"vnode": {
"title": "Vnode",
"description": "Associates this data collection job with a [Virtual Node](https://learn.netdata.cloud/docs/netdata-agent/configuration/organize-systems-metrics-and-alerts#virtual-nodes).",
"type": "string"
},
"username": {
"title": "Username",
"description": "The username for basic authentication.",
"type": "string",
"sensitive": true
},
"password": {
"title": "Password",
"description": "The password for basic authentication.",
"type": "string",
"sensitive": true
},
"proxy_url": {
"title": "Proxy URL",
"description": "The URL of the proxy server.",
"type": "string"
},
"proxy_username": {
"title": "Proxy username",
"description": "The username for proxy authentication.",
"type": "string",
"sensitive": true
},
"proxy_password": {
"title": "Proxy password",
"description": "The password for proxy authentication.",
"type": "string",
"sensitive": true
},
"headers": {
"title": "Headers",
"description": "Additional HTTP headers to include in the request.",
"type": [
"object",
"null"
],
"additionalProperties": {
"type": "string"
}
},
"tls_skip_verify": {
"title": "Skip TLS verification",
"description": "If set, TLS certificate verification will be skipped.",
"type": "boolean"
},
"tls_ca": {
"title": "TLS CA",
"description": "The path to the CA certificate file for TLS verification.",
"type": "string",
"pattern": "^$|^/"
},
"tls_cert": {
"title": "TLS certificate",
"description": "The path to the client certificate file for TLS authentication.",
"type": "string",
"pattern": "^$|^/"
},
"tls_key": {
"title": "TLS key",
"description": "The path to the client key file for TLS authentication.",
"type": "string",
"pattern": "^$|^/"
},
"body": {
"title": "Body",
"type": "string"
},
"method": {
"title": "Method",
"type": "string"
}
},
"required": [
"url"
],
"patternProperties": {
"^name$": {}
}
},
"uiSchema": {
"ui:flavour": "tabs",
"ui:options": {
"tabs": [
{
"title": "Base",
"fields": [
"update_every",
"url",
"timeout",
"not_follow_redirects",
"vnode"
]
},
{
"title": "Auth",
"fields": [
"username",
"password"
]
},
{
"title": "TLS",
"fields": [
"tls_skip_verify",
"tls_ca",
"tls_cert",
"tls_key"
]
},
{
"title": "Proxy",
"fields": [
"proxy_url",
"proxy_username",
"proxy_password"
]
},
{
"title": "Headers",
"fields": [
"headers"
]
}
]
},
"uiOptions": {
"fullPage": true
},
"body": {
"ui:widget": "hidden"
},
"method": {
"ui:widget": "hidden"
},
"vnode": {
"ui:placeholder": "To use this option, first create a Virtual Node and then reference its name here."
},
"url": {
"ui:placeholder": "http://203.0.113.0:9182/metrics"
},
"timeout": {
"ui:help": "Accepts decimals for precise control (e.g., type 1.5 for 1.5 seconds)."
},
"username": {
"ui:widget": "password"
},
"proxy_username": {
"ui:widget": "password"
},
"password": {
"ui:widget": "password"
},
"proxy_password": {
"ui:widget": "password"
}
}
}

View file

@ -1,25 +0,0 @@
// SPDX-License-Identifier: GPL-3.0-or-later
package windows
import (
"errors"
"github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/prometheus"
"github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/web"
)
func (c *Collector) validateConfig() error {
if c.URL == "" {
return errors.New("'url' is not set")
}
return nil
}
func (c *Collector) initPrometheusClient() (prometheus.Prometheus, error) {
client, err := web.NewHTTPClient(c.ClientConfig)
if err != nil {
return nil, err
}
return prometheus.New(client, c.RequestConfig), nil
}

View file

@ -1,22 +0,0 @@
{
"update_every": 123,
"vnode": "ok",
"url": "ok",
"body": "ok",
"method": "ok",
"headers": {
"ok": "ok"
},
"username": "ok",
"password": "ok",
"proxy_url": "ok",
"proxy_username": "ok",
"proxy_password": "ok",
"timeout": 123.123,
"not_follow_redirects": true,
"tls_ca": "ok",
"tls_cert": "ok",
"tls_key": "ok",
"tls_skip_verify": true,
"force_http2": true
}

View file

@ -1,19 +0,0 @@
update_every: 123
vnode: "ok"
url: "ok"
body: "ok"
method: "ok"
headers:
ok: "ok"
username: "ok"
password: "ok"
proxy_url: "ok"
proxy_username: "ok"
proxy_password: "ok"
timeout: 123.123
not_follow_redirects: yes
tls_ca: "ok"
tls_cert: "ok"
tls_key: "ok"
tls_skip_verify: yes
force_http2: yes

File diff suppressed because it is too large Load diff

View file

@ -128,7 +128,6 @@ modules:
# web_log: yes
# wireguard: yes
# whoisquery: yes
# windows: yes
# x509check: yes
# zfspool: yes
# zookeeper: yes

View file

@ -1,8 +0,0 @@
## All available configuration options, their descriptions and default values:
## https://github.com/netdata/netdata/tree/master/src/go/plugin/go.d/collector/windows#readme
#jobs:
# - name: win_server1
# url: http://10.0.0.1:9182/metrics
# - name: win_server2
# url: http://10.0.0.2:9182/metrics

View file

@ -1,108 +0,0 @@
## CPU
template: windows_10min_cpu_usage
on: windows.cpu_utilization_total
class: Utilization
type: Windows
component: CPU
lookup: average -10m unaligned match-names of dpc,user,privileged,interrupt
units: %
every: 1m
warn: $this > (($status >= $WARNING) ? (75) : (85))
crit: $this > (($status == $CRITICAL) ? (85) : (95))
delay: down 15m multiplier 1.5 max 1h
summary: CPU utilization
info: Average CPU utilization over the last 10 minutes
to: silent
## Memory
template: windows_ram_in_use
on: windows.memory_utilization
class: Utilization
type: Windows
component: Memory
calc: ($used) * 100 / ($used + $available)
units: %
every: 10s
warn: $this > (($status >= $WARNING) ? (80) : (90))
crit: $this > (($status == $CRITICAL) ? (90) : (98))
delay: down 15m multiplier 1.5 max 1h
summary: Ram utilization
info: Memory utilization
to: sysadmin
## Network
template: windows_inbound_packets_discarded
on: windows.net_nic_discarded
class: Errors
type: Windows
component: Network
lookup: sum -10m unaligned absolute match-names of inbound
units: packets
every: 1m
warn: $this >= 5
delay: down 1h multiplier 1.5 max 2h
summary: Inbound network packets discarded
info: Number of inbound discarded packets for the network interface in the last 10 minutes
to: silent
template: windows_outbound_packets_discarded
on: windows.net_nic_discarded
class: Errors
type: Windows
component: Network
lookup: sum -10m unaligned absolute match-names of outbound
units: packets
every: 1m
warn: $this >= 5
delay: down 1h multiplier 1.5 max 2h
summary: Outbound network packets discarded
info: Number of outbound discarded packets for the network interface in the last 10 minutes
to: silent
template: windows_inbound_packets_errors
on: windows.net_nic_errors
class: Errors
type: Windows
component: Network
lookup: sum -10m unaligned absolute match-names of inbound
units: packets
every: 1m
warn: $this >= 5
delay: down 1h multiplier 1.5 max 2h
summary: Inbound network errors
info: Number of inbound errors for the network interface in the last 10 minutes
to: silent
template: windows_outbound_packets_errors
on: windows.net_nic_errors
class: Errors
type: Windows
component: Network
lookup: sum -10m unaligned absolute match-names of outbound
units: packets
every: 1m
warn: $this >= 5
delay: down 1h multiplier 1.5 max 2h
summary: Outbound network errors
info: Number of outbound errors for the network interface in the last 10 minutes
to: silent
## Disk
template: windows_disk_in_use
on: windows.logical_disk_space_usage
class: Utilization
type: Windows
component: Disk
calc: ($used) * 100 / ($used + $free)
units: %
every: 10s
warn: $this > (($status >= $WARNING) ? (80) : (90))
crit: $this > (($status == $CRITICAL) ? (90) : (98))
delay: down 15m multiplier 1.5 max 1h
summary: Disk space usage
info: Disk space utilization
to: sysadmin