mirror of
https://github.com/prometheus-community/windows_exporter
synced 2025-01-12 09:19:31 +00:00
fixed collectServerShares func
Signed-off-by: Andrey Burtasov <BurtasovAA@GSP-I.RU>
This commit is contained in:
parent
9922f1265a
commit
268a47ff3d
@ -102,8 +102,8 @@ func (c *collector) Build() error {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
c.CurrentOpenFileCount = desc("smb_server_shares_current_open_file_count", "Current count open files")
|
c.CurrentOpenFileCount = desc("server_shares_current_open_file_count", "Current total count open files")
|
||||||
c.TreeConnectCount = desc("smb_server_session_tree_connect_count", "Current tree connect count")
|
c.TreeConnectCount = desc("server_session_tree_connect_count", "Current tree connect count")
|
||||||
|
|
||||||
c.enabledCollectors = make([]string, 0, len(smbAllCollectorNames))
|
c.enabledCollectors = make([]string, 0, len(smbAllCollectorNames))
|
||||||
|
|
||||||
@ -167,14 +167,14 @@ func (c *collector) collectServerShares(ctx *types.ScrapeContext, ch chan<- prom
|
|||||||
}
|
}
|
||||||
for _, instance := range data {
|
for _, instance := range data {
|
||||||
labelName := c.toLabelName(instance.Name)
|
labelName := c.toLabelName(instance.Name)
|
||||||
if strings.HasSuffix(labelName, "_total") {
|
if !strings.HasSuffix(labelName, "_total") {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
ch <- prometheus.MustNewConstMetric(
|
ch <- prometheus.MustNewConstMetric(
|
||||||
c.CurrentOpenFileCount,
|
c.CurrentOpenFileCount,
|
||||||
prometheus.CounterValue,
|
prometheus.CounterValue,
|
||||||
instance.CurrentOpenFileCount,
|
instance.CurrentOpenFileCount,
|
||||||
labelName,
|
|
||||||
)
|
)
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -193,6 +193,7 @@ func (c *collector) collectServerSessions(ctx *types.ScrapeContext, ch chan<- pr
|
|||||||
}
|
}
|
||||||
|
|
||||||
for _, instance := range data {
|
for _, instance := range data {
|
||||||
|
|
||||||
ch <- prometheus.MustNewConstMetric(
|
ch <- prometheus.MustNewConstMetric(
|
||||||
c.TreeConnectCount,
|
c.TreeConnectCount,
|
||||||
prometheus.CounterValue,
|
prometheus.CounterValue,
|
||||||
|
Loading…
Reference in New Issue
Block a user