mirror of
https://github.com/prometheus-community/windows_exporter.git
synced 2026-02-10 06:56:38 +00:00
Compare commits
12 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
bad1e7f7b0 | ||
|
|
c868c00e89 | ||
|
|
5035e97369 | ||
|
|
144715e3d2 | ||
|
|
a20cf1274a | ||
|
|
626a25cd00 | ||
|
|
96dd456bb1 | ||
|
|
af1b8bf4d0 | ||
|
|
d83615a818 | ||
|
|
fe4c61a70e | ||
|
|
143705bbf6 | ||
|
|
e8ffb736d0 |
@@ -9,15 +9,16 @@ Prometheus exporter for Windows machines, using the WMI (Windows Management Inst
|
|||||||
|
|
||||||
Name | Description | Enabled by default
|
Name | Description | Enabled by default
|
||||||
---------|-------------|--------------------
|
---------|-------------|--------------------
|
||||||
ad | [Win32_PerfRawData_DirectoryServices_DirectoryServices](https://msdn.microsoft.com/en-us/library/ms803980.aspx) Active Directory |
|
ad | [Win32_PerfRawData_DirectoryServices_DirectoryServices](https://msdn.microsoft.com/en-us/library/ms803980.aspx) Active Directory |
|
||||||
cpu | [Win32_PerfRawData_PerfOS_Processor](https://msdn.microsoft.com/en-us/library/aa394317(v=vs.90).aspx) metrics (cpu usage) | ✓
|
cpu | [Win32_PerfRawData_PerfOS_Processor](https://msdn.microsoft.com/en-us/library/aa394317(v=vs.90).aspx) metrics (cpu usage) | ✓
|
||||||
cs | [Win32_ComputerSystem](https://msdn.microsoft.com/en-us/library/aa394102) metrics (system properties, num cpus/total memory) | ✓
|
cs | [Win32_ComputerSystem](https://msdn.microsoft.com/en-us/library/aa394102) metrics (system properties, num cpus/total memory) | ✓
|
||||||
dns | [Win32_PerfRawData_DNS_DNS](https://technet.microsoft.com/en-us/library/cc977686.aspx) metrics (DNS Server) |
|
dns | [Win32_PerfRawData_DNS_DNS](https://technet.microsoft.com/en-us/library/cc977686.aspx) metrics (DNS Server) |
|
||||||
hyperv | Performance counters for Hyper-V hosts |
|
hyperv | Performance counters for Hyper-V hosts |
|
||||||
iis | [Win32_PerfRawData_W3SVC_WebService](https://msdn.microsoft.com/en-us/library/aa394345) IIS metrics |
|
iis | [Win32_PerfRawData_W3SVC_WebService](https://msdn.microsoft.com/en-us/library/aa394345) IIS metrics |
|
||||||
logical_disk | [Win32_PerfRawData_PerfDisk_LogicalDisk](https://msdn.microsoft.com/en-us/windows/hardware/aa394307(v=vs.71)) metrics (disk I/O) | ✓
|
logical_disk | [Win32_PerfRawData_PerfDisk_LogicalDisk](https://msdn.microsoft.com/en-us/windows/hardware/aa394307(v=vs.71)) metrics (disk I/O) | ✓
|
||||||
net | [Win32_PerfRawData_Tcpip_NetworkInterface](https://technet.microsoft.com/en-us/security/aa394340(v=vs.80)) metrics (network interface I/O) | ✓
|
net | [Win32_PerfRawData_Tcpip_NetworkInterface](https://technet.microsoft.com/en-us/security/aa394340(v=vs.80)) metrics (network interface I/O) | ✓
|
||||||
msmq | [Win32_PerfRawData_MSMQ_MSMQQueue](http://wutils.com/wmi/root/cimv2/win32_perfrawdata_msmq_msmqqueue/) metrics (MSMQ/journal count) |
|
msmq | [Win32_PerfRawData_MSMQ_MSMQQueue](http://wutils.com/wmi/root/cimv2/win32_perfrawdata_msmq_msmqqueue/) metrics (MSMQ/journal count) |
|
||||||
|
mssql | various [SQL Server Performance Objects](https://docs.microsoft.com/en-us/sql/relational-databases/performance-monitor/use-sql-server-objects#SQLServerPOs) metrics |
|
||||||
os | [Win32_OperatingSystem](https://msdn.microsoft.com/en-us/library/aa394239) metrics (memory, processes, users) | ✓
|
os | [Win32_OperatingSystem](https://msdn.microsoft.com/en-us/library/aa394239) metrics (memory, processes, users) | ✓
|
||||||
process | [Win32_PerfRawData_PerfProc_Process](https://msdn.microsoft.com/en-us/library/aa394323(v=vs.85).aspx) metrics (per-process stats) |
|
process | [Win32_PerfRawData_PerfProc_Process](https://msdn.microsoft.com/en-us/library/aa394323(v=vs.85).aspx) metrics (per-process stats) |
|
||||||
service | [Win32_Service](https://msdn.microsoft.com/en-us/library/aa394418(v=vs.85).aspx) metrics (service states) | ✓
|
service | [Win32_Service](https://msdn.microsoft.com/en-us/library/aa394418(v=vs.85).aspx) metrics (service states) | ✓
|
||||||
|
|||||||
3535
collector/mssql.go
Normal file
3535
collector/mssql.go
Normal file
File diff suppressed because it is too large
Load Diff
@@ -177,6 +177,11 @@ type Win32_PerfRawData_PerfProc_Process struct {
|
|||||||
WorkingSetPrivate uint64
|
WorkingSetPrivate uint64
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type WorkerProcess struct {
|
||||||
|
AppPoolName string
|
||||||
|
ProcessId uint32
|
||||||
|
}
|
||||||
|
|
||||||
func (c *ProcessCollector) collect(ch chan<- prometheus.Metric) (*prometheus.Desc, error) {
|
func (c *ProcessCollector) collect(ch chan<- prometheus.Metric) (*prometheus.Desc, error) {
|
||||||
var dst []Win32_PerfRawData_PerfProc_Process
|
var dst []Win32_PerfRawData_PerfProc_Process
|
||||||
q := queryAllWhere(&dst, c.queryWhereClause)
|
q := queryAllWhere(&dst, c.queryWhereClause)
|
||||||
@@ -184,6 +189,10 @@ func (c *ProcessCollector) collect(ch chan<- prometheus.Metric) (*prometheus.Des
|
|||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var dst_wp []WorkerProcess
|
||||||
|
q_wp := queryAll(&dst_wp)
|
||||||
|
wmi.QueryNamespace(q_wp, &dst_wp, "root\\WebAdministration")
|
||||||
|
|
||||||
for _, process := range dst {
|
for _, process := range dst {
|
||||||
|
|
||||||
if process.Name == "_Total" {
|
if process.Name == "_Total" {
|
||||||
@@ -194,6 +203,13 @@ func (c *ProcessCollector) collect(ch chan<- prometheus.Metric) (*prometheus.Des
|
|||||||
pid := strconv.FormatUint(uint64(process.IDProcess), 10)
|
pid := strconv.FormatUint(uint64(process.IDProcess), 10)
|
||||||
cpid := strconv.FormatUint(uint64(process.CreatingProcessID), 10)
|
cpid := strconv.FormatUint(uint64(process.CreatingProcessID), 10)
|
||||||
|
|
||||||
|
for _, wp := range dst_wp {
|
||||||
|
if wp.ProcessId == process.IDProcess {
|
||||||
|
processName = strings.Join([]string{processName, wp.AppPoolName}, "_")
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
ch <- prometheus.MustNewConstMetric(
|
ch <- prometheus.MustNewConstMetric(
|
||||||
c.StartTime,
|
c.StartTime,
|
||||||
prometheus.GaugeValue,
|
prometheus.GaugeValue,
|
||||||
|
|||||||
Reference in New Issue
Block a user