diff options
author | Austin S. Hemmelgarn <austin@netdata.cloud> | 2024-02-13 06:56:20 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-02-13 06:56:20 -0500 |
commit | 3a29b66132f561c910d827e8c7ae82997f7c1f30 (patch) | |
tree | a9306156631b6b188de8877f7c1dbdbe8b067804 /src/go/collectors/go.d.plugin/modules/windows | |
parent | 57eec3da0e51baa400037ccc4b547cb839ab6ffa (diff) |
Include Go plugin sources in main repository. (#16997)
* Include Go plugin sources in main repository.
* Fix CI issues.
* Rename source tree.
Diffstat (limited to 'src/go/collectors/go.d.plugin/modules/windows')
35 files changed, 19100 insertions, 0 deletions
diff --git a/src/go/collectors/go.d.plugin/modules/windows/README.md b/src/go/collectors/go.d.plugin/modules/windows/README.md new file mode 120000 index 0000000000..802d61bd11 --- /dev/null +++ b/src/go/collectors/go.d.plugin/modules/windows/README.md @@ -0,0 +1 @@ +integrations/windows.md
\ No newline at end of file diff --git a/src/go/collectors/go.d.plugin/modules/windows/charts.go b/src/go/collectors/go.d.plugin/modules/windows/charts.go new file mode 100644 index 0000000000..14db70395a --- /dev/null +++ b/src/go/collectors/go.d.plugin/modules/windows/charts.go @@ -0,0 +1,4936 @@ +// SPDX-License-Identifier: GPL-3.0-or-later + +package windows + +import ( + "fmt" + "strings" + + "github.com/netdata/go.d.plugin/agent/module" +) + +const ( + prioCPUUtil = module.Priority + iota + prioCPUCoreUtil + prioCPUInterrupts + prioCPUDPCs + prioCPUCoreCState + + prioMemUtil + prioMemPageFaults + prioMemSwapUtil + prioMemSwapOperations + prioMemSwapPages + prioMemCache + prioMemCacheFaults + prioMemSystemPool + + prioDiskSpaceUsage + prioDiskBandwidth + prioDiskOperations + prioDiskAvgLatency + + prioNICBandwidth + prioNICPackets + prioNICErrors + prioNICDiscards + + prioTCPConnsEstablished + prioTCPConnsActive + prioTCPConnsPassive + prioTCPConnsFailure + prioTCPConnsReset + prioTCPSegmentsReceived + prioTCPSegmentsSent + prioTCPSegmentsRetransmitted + + prioOSProcesses + prioOSUsers + prioOSVisibleMemoryUsage + prioOSPagingUsage + + prioSystemThreads + prioSystemUptime + + prioLogonSessions + + prioThermalzoneTemperature + + prioProcessesCPUUtilization + prioProcessesMemoryUsage + prioProcessesIOBytes + prioProcessesIOOperations + prioProcessesPageFaults + prioProcessesPageFileBytes + prioProcessesThreads + prioProcessesHandles + + prioIISWebsiteTraffic + prioIISWebsiteFTPFileTransferRate + prioIISWebsiteActiveConnectionsCount + prioIISWebsiteRequestsRate + prioIISWebsiteConnectionAttemptsRate + prioIISWebsiteUsersCount + prioIISWebsiteISAPIExtRequestsCount + prioIISWebsiteISAPIExtRequestsRate + prioIISWebsiteErrorsRate + prioIISWebsiteLogonAttemptsRate + prioIISWebsiteUptime + + // Connections + prioMSSQLUserConnections + + // Transactions + prioMSSQLDatabaseTransactions + prioMSSQLDatabaseActiveTransactions + prioMSSQLDatabaseWriteTransactions + prioMSSQLDatabaseBackupRestoreOperations + prioMSSQLDatabaseLogFlushes + prioMSSQLDatabaseLogFlushed + + // Size + prioMSSQLDatabaseDataFileSize + + // SQL activity + prioMSSQLStatsBatchRequests + prioMSSQLStatsCompilations + prioMSSQLStatsRecompilations + prioMSSQLStatsAutoParameterization + prioMSSQLStatsSafeAutoParameterization + + // Processes + prioMSSQLBlockedProcess + + // Buffer Cache + prioMSSQLCacheHitRatio + prioMSSQLBufManIOPS + prioMSSQLBufferCheckpointPages + prioMSSQLAccessMethodPageSplits + prioMSSQLBufferPageLifeExpectancy + + // Memory + prioMSSQLMemmgrConnectionMemoryBytes + prioMSSQLMemTotalServer + prioMSSQLMemmgrExternalBenefitOfMemory + prioMSSQLMemmgrPendingMemoryGrants + + // Locks + prioMSSQLLocksLockWait + prioMSSQLLocksDeadLocks + + // Error + prioMSSQLSqlErrorsTotal + + // NET Framework + // Exceptions + prioNETFrameworkCLRExceptionsThrown + prioNETFrameworkCLRExceptionsFilters + prioNETFrameworkCLRExceptionsFinallys + prioNETFrameworkCLRExceptionsThrowToCatchDepth + + // InterOP + prioNETFrameworkCLRInteropCOMCallableWrappers + prioNETFrameworkCLRInteropMarshalling + prioNETFrameworkCLRInteropStubsCreated + prioNETFrameworkCLRJITMethods + + // JIT + prioNETFrameworkCLRJITTime + prioNETFrameworkCLRJITStandardFailures + prioNETFrameworkCLRJITILBytes + + // Loading + prioNETFrameworkCLRLoadingLoaderHeapSize + prioNETFrameworkCLRLoadingAppDomainsLoaded + prioNETFrameworkCLRLoadingAppDomainsUnloaded + prioNETFrameworkCLRLoadingAssembliesLoaded + prioNETFrameworkCLRLoadingClassesLoaded + prioNETFrameworkCLRLoadingClassLoadFailure + + // Locks and threads + prioNETFrameworkCLRLocksAndThreadsQueueLength + prioNETFrameworkCLRLocksAndThreadsCurrentLogicalThreads + prioNETFrameworkCLRLocksAndThreadsCurrentPhysicalThreads + prioNETFrameworkCLRLocksAndThreadsRecognizedThreads + prioNETFrameworkCLRLocksAndThreadsContentions + + // Memory + prioNETFrameworkCLRMemoryAllocatedBytes + prioNETFrameworkCLRMemoryFinalizationSurvivors + prioNETFrameworkCLRMemoryHeapSize + prioNETFrameworkCLRMemoryPromoted + prioNETFrameworkCLRMemoryNumberGCHandles + prioNETFrameworkCLRMemoryCollections + prioNETFrameworkCLRMemoryInducedGC + prioNETFrameworkCLRMemoryNumberPinnedObjects + prioNETFrameworkCLRMemoryNumberSinkBlocksInUse + prioNETFrameworkCLRMemoryCommitted + prioNETFrameworkCLRMemoryReserved + prioNETFrameworkCLRMemoryGCTime + + // Remoting + prioNETFrameworkCLRRemotingChannels + prioNETFrameworkCLRRemotingContextBoundClassesLoaded + prioNETFrameworkCLRRemotingContextBoundObjects + prioNETFrameworkCLRRemotingContextProxies + prioNETFrameworkCLRRemotingContexts + prioNETFrameworkCLRRemotingRemoteCalls + + // Security + prioNETFrameworkCLRSecurityLinkTimeChecks + prioNETFrameworkCLRSecurityRTChecksTime + prioNETFrameworkCLRSecurityStackWalkDepth + prioNETFrameworkCLRSecurityRuntimeChecks + + prioServiceState + prioServiceStatus + + // Database + prioADDatabaseOperations + prioADDirectoryOperations + prioADNameCacheLookups + prioADCacheHits + + // Replication + prioADDRAReplicationIntersiteCompressedTraffic + prioADDRAReplicationIntrasiteCompressedTraffic + prioADDRAReplicationSyncObjectsRemaining + prioADDRAReplicationPropertiesUpdated + prioADDRAReplicationPropertiesFiltered + prioADDRAReplicationObjectsFiltered + prioADReplicationPendingSyncs + prioADDRASyncRequests + prioADDirectoryServiceThreadsInUse + + // Bind + prioADLDAPBindTime + prioADBindsTotal + + // LDAP + prioADLDAPSearchesTotal + + // Thread Queue + prioADATQAverageRequestLatency + prioADATQOutstandingRequests + + // Requests + prioADCSCertTemplateRequests + prioADCSCertTemplateRequestProcessingTime + prioADCSCertTemplateRetrievals + prioADCSCertTemplateFailedRequests + prioADCSCertTemplateIssuesRequests + prioADCSCertTemplatePendingRequests + + // Response + prioADCSCertTemplateChallengeResponses + + // Retrieval + prioADCSCertTemplateRetrievalProcessingTime + + // Timing + prioADCSCertTemplateRequestCryptoSigningTime + prioADCSCertTemplateRequestPolicyModuleProcessingTime + prioADCSCertTemplateChallengeResponseProcessingTime + prioADCSCertTemplateSignedCertificateTimestampLists + prioADCSCertTemplateSignedCertificateTimestampListProcessingTime + + // ADFS + // AD + prioADFSADLoginConnectionFailures + + // DB Artifacts + prioADFSDBArtifactFailures + prioADFSDBArtifactQueryTimeSeconds + + // DB Config + prioADFSDBConfigFailures + prioADFSDBConfigQueryTimeSeconds + + // Auth + prioADFSDeviceAuthentications + prioADFSExternalAuthentications + prioADFSOauthAuthorizationRequests + prioADFSCertificateAuthentications + prioADFSOauthClientAuthentications + prioADFSPassportAuthentications + prioADFSSSOAuthentications + prioADFSUserPasswordAuthentications + prioADFSWindowsIntegratedAuthentications + + // OAuth + prioADFSOauthClientCredentials + prioADFSOauthClientPrivkeyJwtAuthentication + prioADFSOauthClientSecretBasicAuthentications + prioADFSOauthClientSecretPostAuthentications + prioADFSOauthClientWindowsAuthentications + prioADFSOauthLogonCertificateRequests + prioADFSOauthPasswordGrantRequests + prioADFSOauthTokenRequestsSuccess + prioADFSFederatedAuthentications + + // Requests + prioADFSFederationMetadataRequests + prioADFSPassiveRequests + prioADFSPasswordChangeRequests + prioADFSSAMLPTokenRequests + prioADFSWSTrustTokenRequestsSuccess + prioADFSTokenRequests + prioADFSWSFedTokenRequestsSuccess + + // Exchange + // Transport Queue + prioExchangeTransportQueuesActiveMailboxDelivery + prioExchangeTransportQueuesExternalActiveRemoteDelivery + prioExchangeTransportQueuesExternalLargestDelivery + prioExchangeTransportQueuesInternalActiveRemoteDeliery + prioExchangeTransportQueuesInternalLargestDelivery + prioExchangeTransportQueuesRetryMailboxDelivery + prioExchangeTransportQueuesUnreachable + prioExchangeTransportQueuesPoison + + // LDAP + prioExchangeLDAPLongRunningOPS + prioExchangeLDAPReadTime + prioExchangeLDAPSearchTime + prioExchangeLDAPWriteTime + prioExchangeLDAPTimeoutErrors + + // OWA + prioExchangeOWACurrentUniqueUsers + prioExchangeOWARequestsTotal + + // Sync + prioExchangeActiveSyncPingCMDsPending + prioExchangeActiveSyncRequests + prioExchangeActiveSyncSyncCMDs + + // RPC + prioExchangeRPCActiveUserCount + prioExchangeRPCAvgLatency + prioExchangeRPCConnectionCount + prioExchangeRPCOperationsTotal + prioExchangeRPCRequests + prioExchangeRpcUserCount + + // Workload + prioExchangeWorkloadActiveTasks + prioExchangeWorkloadCompleteTasks + prioExchangeWorkloadQueueTasks + prioExchangeWorkloadYieldedTasks + prioExchangeWorkloadActivityStatus + + // HTTP Proxy + prioExchangeHTTPProxyAVGAuthLatency + prioExchangeHTTPProxyAVGCASProcessingLatency + prioExchangeHTTPProxyMailboxProxyFailureRate + prioExchangeHTTPProxyServerLocatorAvgLatency + prioExchangeHTTPProxyOutstandingProxyRequests + prioExchangeHTTPProxyRequestsTotal + + // Request + prioExchangeAutoDiscoverRequests + prioExchangeAvailServiceRequests + + // Hyperv Health + prioHypervVMHealth + + // Hyperv Partition + prioHypervRootPartitionDeviceSpacePages + prioHypervRootPartitionGPASpacePages + prioHypervRootPartitionGPASpaceModifications + prioHypervRootPartitionAttachedDevices + prioHypervRootPartitionDepositedPages + prioHypervRootPartitionSkippedInterrupts + prioHypervRootPartitionDeviceDMAErrors + prioHypervRootPartitionDeviceInterruptErrors + prioHypervRootPartitionDeviceInterruptThrottleEvents + prioHypervRootPartitionIOTlbFlush + prioHypervRootPartitionAddressSpace + prioHypervRootPartitionVirtualTlbFlushEntires + prioHypervRootPartitionVirtualTlbPages + + // Hyperv VM (Memory) + prioHypervVMCPUUsage + prioHypervVMMemoryPhysical + prioHypervVMMemoryPhysicalGuestVisible + prioHypervVMMemoryPressureCurrent + prioHypervVIDPhysicalPagesAllocated + prioHypervVIDRemotePhysicalPages + + // Hyperv Device + prioHypervVMDeviceBytes + prioHypervVMDeviceOperations + prioHypervVMDeviceErrors + + // Hyperv Interface + prioHypervVMInterfaceBytes + prioHypervVMInterfacePacketsDropped + prioHypervVMInterfacePackets + + // Hyperv Vswitch + prioHypervVswitchTrafficTotal + prioHypervVswitchPackets + prioHypervVswitchDirectedPackets + prioHypervVswitchBroadcastPackets + prioHypervVswitchMulticastPackets + prioHypervVswitchDroppedPackets + prioHypervVswitchExtensionsDroppedPackets + prioHypervVswitchPacketsFlooded + prioHypervVswitchLearnedMACAddresses + prioHypervVswitchPurgeMACAddress + + prioCollectorDuration + prioCollectorStatus +) + +// CPU +var ( + cpuCharts = module.Charts{ + cpuUtilChart.Copy(), + } + cpuUtilChart = module.Chart{ + ID: "cpu_utilization_total", + Title: "Total CPU Utilization (all cores)", + Units: "percentage", + Fam: "cpu", + Ctx: "windows.cpu_utilization_total", + Type: module.Stacked, + Priority: prioCPUUtil, + Dims: module.Dims{ + {ID: "cpu_idle_time", Name: "idle", Algo: module.PercentOfIncremental, Div: 1000, DimOpts: module.DimOpts{Hidden: true}}, + {ID: "cpu_dpc_time", Name: "dpc", Algo: module.PercentOfIncremental, Div: 1000}, + {ID: "cpu_user_time", Name: "user", Algo: module.PercentOfIncremental, Div: 1000}, + {ID: "cpu_privileged_time", Name: "privileged", Algo: module.PercentOfIncremental, Div: 1000}, + {ID: "cpu_interrupt_time", Name: "interrupt", Algo: module.PercentOfIncremental, Div: 1000}, + }, + } +) + +// CPU core +var ( + cpuCoreChartsTmpl = module.Charts{ + cpuCoreUtilChartTmpl.Copy(), + cpuCoreInterruptsChartTmpl.Copy(), + cpuDPCsChartTmpl.Copy(), + cpuCoreCStateChartTmpl.Copy(), + } + cpuCoreUtilChartTmpl = module.Chart{ + ID: "core_%s_cpu_utilization", + Title: "Core CPU Utilization", + Units: "percentage", + Fam: "cpu", + Ctx: "windows.cpu_core_utilization", + Type: module.Stacked, + Priority: prioCPUCoreUtil, + Dims: module.Dims{ + {ID: "cpu_core_%s_idle_time", Name: "idle", Algo: module.PercentOfIncremental, Div: precision, DimOpts: module.DimOpts{Hidden: true}}, + {ID: "cpu_core_%s_dpc_time", Name: "dpc", Algo: module.PercentOfIncremental, Div: precision}, + {ID: "cpu_core_%s_user_time", Name: "user", Algo: module.PercentOfIncremental, Div: precision}, + {ID: "cpu_core_%s_privileged_time", Name: "privileged", Algo: module.PercentOfIncremental, Div: precision}, + {ID: "cpu_core_%s_interrupt_time", Name: "interrupt", Algo: module.PercentOfIncremental, Div: precision}, + }, + } + cpuCoreInterruptsChartTmpl = module.Chart{ + ID: "cpu_core_%s_interrupts", + Title: "Received and Serviced Hardware Interrupts", + Units: "interrupts/s", + Fam: "cpu", + Ctx: "windows.cpu_core_interrupts", + Priority: prioCPUInterrupts, + Dims: module.Dims{ + {ID: "cpu_core_%s_interrupts", Name: "interrupts", Algo: module.Incremental}, + }, + } + cpuDPCsChartTmpl = module.Chart{ + ID: "cpu_core_%s_dpcs", + Title: "Received and Serviced Deferred Procedure Calls (DPC)", + Units: "dpc/s", + Fam: "cpu", + Ctx: "windows.cpu_core_dpcs", + Priority: prioCPUDPCs, + Dims: module.Dims{ + {ID: "cpu_core_%s_dpcs", Name: "dpcs", Algo: module.Incremental}, + }, + } + cpuCoreCStateChartTmpl = module.Chart{ + ID: "cpu_core_%s_cpu_cstate", + Title: "Core Time Spent in Low-Power Idle State", + Units: "percentage", + Fam: "cpu", + Ctx: "windows.cpu_core_cstate", + Type: module.Stacked, + Priority: prioCPUCoreCState, + Dims: module.Dims{ + {ID: "cpu_core_%s_cstate_c1", Name: "c1", Algo: module.PercentOfIncremental, Div: precision}, + {ID: "cpu_core_%s_cstate_c2", Name: "c2", Algo: module.PercentOfIncremental, Div: precision}, + {ID: "cpu_core_%s_cstate_c3", Name: "c3", Algo: module.PercentOfIncremental, Div: precision}, + }, + } +) + +// Memory +var ( + memCharts = module.Charts{ + memUtilChart.Copy(), + memPageFaultsChart.Copy(), + memSwapUtilChart.Copy(), + memSwapOperationsChart.Copy(), + memSwapPagesChart.Copy(), + memCacheChart.Copy(), + memCacheFaultsChart.Copy(), + memSystemPoolChart.Copy(), + } + memUtilChart = module.Chart{ + ID: "memory_utilization", + Title: "Memory Utilization", + Units: "bytes", + Fam: "mem", + Ctx: "windows.memory_utilization", + Type: module.Stacked, + Priority: prioMemUtil, + Dims: module.Dims{ + {ID: "memory_available_bytes", Name: "available"}, + {ID: "memory_used_bytes", Name: "used"}, + }, + } + memPageFaultsChart = module.Chart{ + ID: "memory_page_faults", + Title: "Memory Page Faults", + Units: "pgfaults/s", + Fam: "mem", + Ctx: "windows.memory_page_faults", + Priority: prioMemPageFaults, + Dims: module.Dims{ + {ID: "memory_page_faults_total", Name: "page_faults", Algo: module.Incremental}, + }, + } + memSwapUtilChart = module.Chart{ + ID: "memory_swap_utilization", + Title: "Swap Utilization", + Units: "bytes", + Fam: "mem", + Ctx: "windows.memory_swap_utilization", + Type: module.Stacked, + Priority: prioMemSwapUtil, + Dims: module.Dims{ + {ID: "memory_not_committed_bytes", Name: "available"}, + {ID: "memory_committed_bytes", Name: "used"}, + }, + Vars: module.Vars{ + {ID: "memory_commit_limit"}, + }, + } + memSwapOperationsChart = module.Chart{ + ID: "memory_swap_operations", + Title: "Swap Operations", + Units: "operations/s", + Fam: "mem", + Ctx: "windows.memory_swap_operations", + Type: module.Area, + Priority: prioMemSwapOperations, + Dims: module.Dims{ + {ID: "memory_swap_page_reads_total", Name: "read", Algo: module.Incremental}, + {ID: "memory_swap_page_writes_total", Name: "write", Algo: module.Incremental, Mul: -1}, + }, + } + memSwapPagesChart = module.Chart{ + ID: "memory_swap_pages", + Title: "Swap Pages", + Units: "pages/s", + Fam: "mem", + Ctx: "windows.memory_swap_pages", + Priority: prioMemSwapPages, + Dims: module.Dims{ + {ID: "memory_swap_pages_read_total", Name: "read", Algo: module.Incremental}, + {ID: "memory_swap_pages_written_total", Name: "written", Algo: module.Incremental, Mul: -1}, + }, + } + memCacheChart = module.Chart{ + ID: "memory_cached", + Title: "Cached", + Units: "bytes", + Fam: "mem", + Ctx: "windows.memory_cached", + Type: module.Area, + Priority: prioMemCache, + Dims: module.Dims{ + {ID: "memory_cache_total", Name: "cached"}, + }, + } + memCacheFaultsChart = module.Chart{ + ID: "memory_cache_faults", + Title: "Cache Faults", + Units: "faults/s", + Fam: "mem", + Ctx: "windows.memory_cache_faults", + Priority: prioMemCacheFaults, + Dims: module.Dims{ + {ID: "memory_cache_faults_total", Name: "cache_faults", Algo: module.Incremental}, + }, + } + memSystemPoolChart = module.Chart{ + ID: "memory_system_pool", + Title: "System Memory Pool", + Units: "bytes", + Fam: "mem", + Ctx: "windows.memory_system_pool", + Type: module.Stacked, + Priority: prioMemSystemPool, + Dims: module.Dims{ + {ID: "memory_pool_paged_bytes", Name: "paged"}, + {ID: "memory_pool_nonpaged_bytes_total", Name: "non-paged"}, + }, + } +) + +// Logical Disks +var ( + diskChartsTmpl = module.Charts{ + diskSpaceUsageChartTmpl.Copy(), + diskBandwidthChartTmpl.Copy(), + diskOperationsChartTmpl.Copy(), + diskAvgLatencyChartTmpl.Copy(), + } + diskSpaceUsageChartTmpl = module.Chart{ + ID: "logical_disk_%s_space_usage", + Title: "Space usage", + Units: "bytes", + Fam: "disk", + Ctx: "windows.logical_disk_space_usage", + Type: module.Stacked, + Priority: prioDiskSpaceUsage, + Dims: module.Dims{ + {ID: "logical_disk_%s_free_space", Name: "free"}, + {ID: "logical_disk_%s_used_space", Name: "used"}, + }, + } + diskBandwidthChartTmpl = module.Chart{ + ID: "logical_disk_%s_bandwidth", + Title: "Bandwidth", + Units: "bytes/s", + Fam: "disk", + Ctx: "windows.logical_disk_bandwidth", + Type: module.Area, + Priority: prioDiskBandwidth, + Dims: module.Dims{ + {ID: "logical_disk_%s_read_bytes_total", Name: "read", Algo: module.Incremental}, + {ID: "logical_disk_%s_write_bytes_total", Name: "write", Algo: module.Incremental, Mul: -1}, + }, + } + diskOperationsChartTmpl = module.Chart{ + ID: "logical_disk_%s_operations", + Title: "Operations", + Units: "operations/s", + Fam: "disk", + Ctx: "windows.logical_disk_operations", + Priority: prioDiskOperations, + Dims: module.Dims{ + {ID: "logical_disk_%s_reads_total", Name: "reads", Algo: module.Incremental}, + {ID: "logical_disk_%s_writes_total", Name: "writes", Algo: module.Incremental, Mul: -1}, + }, + } + diskAvgLatencyChartTmpl = module.Chart{ + ID: "logical_disk_%s_latency", + Title: "Average Read/Write Latency", + Units: "seconds", + Fam: "disk", + Ctx: "windows.logical_disk_latency", + Priority: prioDiskAvgLatency, + Dims: module.Dims{ + {ID: "logical_disk_%s_read_latency", Name: "read", Algo: module.Incremental, Div: precision}, + {ID: "logical_disk_%s_write_latency", Name: "write", Algo: module.Incremental, Div: precision}, + }, + } +) + +// Network interfaces +var ( + nicChartsTmpl = module.Charts{ + nicBandwidthChartTmpl.Copy(), + nicPacketsChartTmpl.Copy(), + nicErrorsChartTmpl.Copy(), + nicDiscardsChartTmpl.Copy(), + } + nicBandwidthChartTmpl = module.Chart{ + ID: "nic_%s_bandwidth", + Title: "Bandwidth", + Units: "kilobits/s", + Fam: "net", + Ctx: "windows.net_nic_bandwidth", + Type: module.Area, + Priority: prioNICBandwidth, + Dims: module.Dims{ + {ID: "net_nic_%s_bytes_received", Name: "received", Algo: module.Incremental, Div: 1000}, + {ID: "net_nic_%s_bytes_sent", Name: "sent", Algo: module.Incremental, Mul: -1, Div: 1000}, + }, + } + nicPacketsChartTmpl = module.Chart{ + ID: "nic_%s_packets", + Title: "Packets", + Units: "packets/s", + Fam: "net", + Ctx: "windows.net_nic_packets", + Priority: prioNICPackets, + Dims: module.Dims{ + {ID: "net_nic_%s_packets_received_total", Name: "received", Algo: module.Incremental}, + {ID: "net_nic_%s_packets_sent_total", Name: "sent", Algo: module.Incremental, Mul: -1}, + }, + } + nicErrorsChartTmpl = module.Chart{ + ID: "nic_%s_errors", + Title: "Errors", + Units: "errors/s", + Fam: "net", + Ctx: "windows.net_nic_errors", + Priority: prioNICErrors, + Dims: module.Dims{ + {ID: "net_nic_%s_packets_received_errors", Name: "inbound", Algo: module.Incremental}, + {ID: "net_nic_%s_packets_outbound_errors", Name: "outbound", Algo: module.Incremental, Mul: -1}, + }, + } + nicDiscardsChartTmpl = module.Chart{ + ID: "nic_%s_discarded", + Title: "Discards", + Units: "discards/s", + Fam: "net", + Ctx: "windows.net_nic_discarded", + Priority: prioNICDiscards, + Dims: module.Dims{ + {ID: "net_nic_%s_packets_received_discarded", Name: "inbound", Algo: module.Incremental}, + {ID: "net_nic_%s_packets_outbound_discarded", Name: "outbound", Algo: module.Incremental, Mul: -1}, + }, + } +) + +// TCP +var ( + tcpCharts = module.Charts{ + tcpConnsActiveChart.Copy(), + tcpConnsEstablishedChart.Copy(), + tcpConnsFailuresChart.Copy(), + tcpConnsPassiveChart.Copy(), + tcpConnsResetsChart.Copy(), + tcpSegmentsReceivedChart.Copy(), + tcpSegmentsRetransmittedChart.Copy(), + tcpSegmentsSentChart.Copy(), + } + tcpConnsEstablishedChart = module.Chart{ + ID: "tcp_conns_established", + Title: "TCP established connections", + Units: "connections", + Fam: "tcp", + Ctx: "windows.tcp_conns_established", + Priority: prioTCPConnsEstablished, + Dims: module.Dims{ + {ID: "tcp_ipv4_conns_established", Name: "ipv4"}, + {ID: "tcp_ipv6_conns_est |