mirror of
https://github.com/rwinkhart/uni-nut.git
synced 2026-08-27 20:36:25 -04:00
Delete parseName and getNUTNames
Unused functions.
This commit is contained in:
@@ -256,23 +256,6 @@ func (c *nutCollector) Collect(ch chan<- prometheus.Metric) {
|
||||
}
|
||||
}
|
||||
|
||||
func parseName(s string) (name string, host string) {
|
||||
idx := strings.IndexByte(s, '@')
|
||||
if idx == -1 {
|
||||
return s, "localhost:3439"
|
||||
}
|
||||
return s[:idx], s[idx+1:]
|
||||
}
|
||||
|
||||
func (c *nutCollector) getNUTNames(host string) ([]string, error) {
|
||||
conn, err := Dial(host)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
defer conn.Close()
|
||||
return conn.UPSs()
|
||||
}
|
||||
|
||||
func (c *nutCollector) readNUT(conn *Client, name string, ch chan<- prometheus.Metric) error {
|
||||
vars, err := conn.Variables(name)
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user