Get bios firmware version of the node.

    :param snmp_client: an SNMP client object.
    :raises: SNMPFailure if SNMP operation failed.
    :returns: a string of bios firmware version.
168897
def get_bios_firmware_version(snmp_client):
    

    try:
        bios_firmware_version = snmp_client.get(BIOS_FW_VERSION_OID)
        return six.text_type(bios_firmware_version)
    except SNMPFailure as e:
        raise SNMPBIOSFirmwareFailure(
            SNMP_FAILURE_MSG % ("GET BIOS FIRMWARE VERSION", e))
965312
def get_sdk_version(self) -> str:
        ''''''
        output, _ = self._execute(
            '-s', self.device_sn, 'shell', 'getprop', 'ro.build.version.sdk')
        return output.strip()
458172
def version(self, conn):
        

        command = b'version\r\n'
        response = yield from self._execute_simple_command(
            conn, command)
        if not response.startswith(const.VERSION):
            raise ClientException('Memcached version failed', response)
        version, number = response.split()
        return number
1249077
def get_version(self):
        

        ptr = self._get_version_func(self.alpr_pointer)
        version_number = ctypes.cast(ptr, ctypes.c_char_p).value
        version_number = _convert_from_charp(version_number)
        self._free_json_mem_func(ctypes.c_void_p(ptr))
        return version_number
284844
def _get_bios_boot_resource(self, data):
        
        try:
            boot_uri = data['links']['Boot']['href']
        except KeyError:
            msg = ('Boot resource not found.')
            raise exception.IloCommandNotSupportedError(msg)

        status, headers, boot_settings = self._rest_get(boot_uri)

        if status != 200:
            msg = self._get_extended_error(boot_settings)
            raise exception.IloError(msg)

        return boot_settings
158732
async def get_firmware_version(self):
        
        current_time = time.time()
        if self.query_reply_data.get(PrivateConstants.REPORT_FIRMWARE) == '':
            await self._send_sysex(PrivateConstants.REPORT_FIRMWARE)
            while self.query_reply_data.get(
                    PrivateConstants.REPORT_FIRMWARE) == '':
                elapsed_time = time.time()
                if elapsed_time - current_time > 4:
                    return None
                await asyncio.sleep(self.sleep_tune)
        return self.query_reply_data.get(PrivateConstants.REPORT_FIRMWARE)
1250994
def get_fp_version(self):
        
        command = const.CMD_OPTIONS_RRQ
        command_string = b'~ZKFPVersion\x00'
        response_size = 1024

        cmd_response = self.__send_command(command, command_string, response_size)
        if cmd_response.get('status'):
            response = self.__data.split(b'=', 1)[-1].split(b'\x00')[0]
            response = response.replace(b'=', b'')
            return safe_cast(response, int, 0) if response else 0
        else:
            raise ZKErrorResponse("can't read fingerprint version")
865820
def get_cluster_info(host, port, ignore_cluster_errors=False):
    
    client = Telnet(host, int(port))
    client.write(b'version\n')
    res = client.read_until(b'\r\n').strip()
    version_list = res.split(b' ')
    if len(version_list) not in [2, 3] or version_list[0] != b'VERSION':
        raise WrongProtocolData('version', res)
    version = version_list[1]
    if StrictVersion(smart_text(version)) >= StrictVersion('1.4.14'):
        cmd = b'config get cluster\n'
    else:
        cmd = b'get AmazonElastiCache:cluster\n'
    client.write(cmd)
    regex_index, match_object, res = client.expect([
        re.compile(b'\n\r\nEND\r\n'),
        re.compile(b'ERROR\r\n')
    ])
    client.close()

    if res == b'ERROR\r\n' and ignore_cluster_errors:
        return {
            'version': version,
            'nodes': [
                '{0}:{1}'.format(smart_text(host),
                               smart_text(port))
            ]
        }

    ls = list(filter(None, re.compile(br'\r?\n').split(res)))
    if len(ls) != 4:
        raise WrongProtocolData(cmd, res)

    try:
        version = int(ls[1])
    except ValueError:
        raise WrongProtocolData(cmd, res)
    nodes = []
    try:
        for node in ls[2].split(b' '):
            host, ip, port = node.split(b'|')
            nodes.append('{0}:{1}'.format(smart_text(ip or host),
                                        smart_text(port)))
    except ValueError:
        raise WrongProtocolData(cmd, res)
    return {
        'version': version,
        'nodes': nodes
    }
69889
def get_ntp_servers(self):
        """"""
        ntp_table = junos_views.junos_ntp_servers_config_table(self.device)
        ntp_table.get()

        ntp_servers = ntp_table.items()

        if not ntp_servers:
            return {}

        return {napalm_base.helpers.ip(server[0]): {} for server in ntp_servers}
929380
def get_network_by_name(self, nwk_name):
        
        ret_net_lst = []
        try:
            body = {}
            net_list = self.neutronclient.list_networks(body=body)
            net_list = net_list.get('networks')
            for net in net_list:
                if net.get('name') == nwk_name:
                    ret_net_lst.append(net)
        except Exception as exc:
            LOG.error("Failed to get network by name %(name)s, "
                      "Exc %(exc)s",
                      {'name': nwk_name, 'exc': str(exc)})
        return ret_net_lst
574030
def get_bios(self):
        
        uri = "{}/bios".format(self.data["uri"])
        return self._helper.do_get(uri)
317
def get_firmware_image(self, image_id):
        
        api = self._get_api(update_service.DefaultApi)
        return FirmwareImage(api.firmware_image_retrieve(image_id))
388231
def get_snmp_from_host2(self):
        
        if not self.snmp2:
            self.activity_value2 = None
        else:
            response = self.snmp2.get_oids(activity_oid)
            self.activity_value2 = activity[int(response[0])]
981328
def get_snmp_information(self):
        """"""
        snmp_information = {}

        snmp_config = junos_views.junos_snmp_config_table(self.device)
        snmp_config.get()
        snmp_items = snmp_config.items()

        if not snmp_items:
            return snmp_information

        snmp_information = {
            py23_compat.text_type(ele[0]): ele[1] if ele[1] else ""
            for ele in snmp_items[0][1]
        }

        snmp_information["community"] = {}
        communities_table = snmp_information.pop("communities_table")
        if not communities_table:
            return snmp_information

        for community in communities_table.items():
            community_name = py23_compat.text_type(community[0])
            community_details = {"acl": ""}
            community_details.update(
                {
                    py23_compat.text_type(ele[0]): py23_compat.text_type(
                        ele[1]
                        if ele[0] != "mode"
                        else C.SNMP_AUTHORIZATION_MODE_MAP.get(ele[1])
                    )
                    for ele in community[1]
                }
            )
            snmp_information["community"][community_name] = community_details

        return snmp_information
616649
def firmware_version(self):
        """"""
        if (self._firmware_version is None) or \
                (datetime.now() - timedelta(hours=24) > self._fw_last_read):
            self._fw_last_read = datetime.now()
            with self._bt_interface.connect(self._mac) as connection:
                res = connection.read_handle(_HANDLE_READ_VERSION_BATTERY)  # pylint: disable=no-member
                _LOGGER.debug('Received result for handle %s: %s',
                              _HANDLE_READ_VERSION_BATTERY, self._format_bytes(res))
            if res is None:
                self.battery = 0
                self._firmware_version = None
            else:
                self.battery = res[0]
                self._firmware_version = "".join(map(chr, res[2:]))
        return self._firmware_version
391669
def check(self):
        
        try:
            self.get_snmp_from_host1()
            self.get_snmp_from_host2()
        except (health_monitoring_plugins.SnmpException, TypeError, KeyError):
            self.helper.status(unknown)
            self.helper.add_summary("SNMP response incomplete or invalid")
            return

        self.helper.add_summary("Filter Status")
        self.helper.add_long_output("Power Supply 1: %s" % self.ps1_value)
        if self.ps1_value != "ok":
            self.helper.status(critical)
            self.helper.add_summary("Power Supply 1: %s" % self.ps1_value)

        self.helper.add_long_output("Power Supply 2: %s" % self.ps2_value)
        if self.ps2_value != "ok":
            self.helper.status(critical)
            self.helper.add_summary("Power Supply 2: %s" % self.ps2_value)

        self.helper.add_long_output("Fan 1: %s" % self.fan1_value)
        if self.fan1_value != "ok":
            self.helper.status(critical)
            self.helper.add_summary("Fan 1: %s" % self.fan1_value)

        self.helper.add_long_output("Fan 2: %s" % self.fan2_value)
        if self.fan2_value != "ok":
            self.helper.status(critical)
            self.helper.add_summary("Fan 2: %s" % self.fan2_value)

        self.helper.add_long_output("Battery: %s" % self.bat_value)
        if self.bat_value != "ok":
            self.helper.status(critical)
            self.helper.add_summary("Battery: %s" % self.bat_value)

        self.helper.add_long_output("Temperature: %s" % self.temp_value)
        if self.temp_value != "ok":
            self.helper.status(critical)
            self.helper.add_summary("Temperature: %s" % self.temp_value)

        self.helper.add_metric(label='logfill',value=self.logfill_value, uom="%%")
        self.helper.add_long_output("Fill Level internal log: %s%%" % self.logfill_value)

        self.helper.add_long_output("Activity State: %s" % self.activity_value1)
        if self.activity_value1 == "error":
            self.helper.status(critical)
            self.helper.add_summary("Activity State: %s" % self.activity_value1)

        if self.activity_value2:
            self.helper.add_long_output("Activity State 2: %s" % self.activity_value2)
            if self.activity_value1 == "active" and self.activity_value2 == "active":
                self.helper.status(critical)
                self.helper.add_summary("Filter 1 and Filter 2 active!")
                    
            if self.activity_value1 == "standby" and self.activity_value2 == "standby":
                self.helper.status(critical)
                self.helper.add_summary("Filter 1 and Filter 2 standby!")

        self.helper.check_all_metrics()
975496
def bios_settings(self):
        
        return bios.BIOSSettings(
            self._conn, utils.get_subresource_path_by(self, 'Bios'),
            redfish_version=self.redfish_version)