munin-miflora: refactor helper into common, add RSSI and timing metrics

This commit is contained in:
cn committed 2018-12-22 13:56:49 +01:00
1 parent 3b4627f988
commit c66b3d2f75
4 files changed
+87 -25

No files matched your search

+14
View File
@@ -0,0 +1,14 @@
package common
import (
"regexp"
"strings"
)
const peripheralAddressAllowedChars = "[^a-z0-9]+"
var peripheralAddressAllowedCharsPattern = regexp.MustCompile(peripheralAddressAllowedChars)
func MifloraGetAlphaNumericID(peripheralAddress string) string {
return peripheralAddressAllowedCharsPattern.ReplaceAllString(strings.ToLower(peripheralAddress), "")
}