ruimarinho / docker-openvpn-monitor

The trusted multi-platform web-based OpenVPN Monitor docker image.
MIT License
101 stars 27 forks source link

Unknown on Last Ping Field. #32

Open Cioko opened 1 year ago

Cioko commented 1 year ago

Hi, with OpenVpn 2.5.8 the field "Last Ping" show Unknown. Seems that the new version put an "@0" at the end of the macaddress... I resolve it by modify the is_mac_address(s)_ function in the openvpn-monitor.py file as show below:

ORIGINAL:

    @staticmethod
    def is_mac_address(s):
        return len(s) == 17 and \
            len(s.split(':')) == 6 and \
            all(c in string.hexdigits for c in s.replace(':', ''))

MODIFIED:

    @staticmethod
    def is_mac_address(stringa):
        s=stringa.split("@")[0]
        return len(s) == 17 and \
            len(s.split(':')) == 6 and \
            all(c in string.hexdigits for c in s.replace(':', ''))