def test_hostinfo_get_all(declared_hostinfo): dev = SnmpHandler(host='1.1.1.1', version='2c', community='public') hostinfo = HostInfo(dev) hostinfo.get_all() assert hostinfo.description == 'Cisco Adaptive Security Appliance Version 9.3(2)2' assert hostinfo.contact == 'Networklore' assert hostinfo.location == 'Westeros' assert hostinfo.vendor == 'cisco' assert hostinfo.version == '9.3(2)2'
def main(): argparser = SnmpArgs(description) args = argparser.parser.parse_args() snmp = NelkitSnmp(args) hostinfo = HostInfo(snmp) hostinfo.get_all() print ('OS: %s' % hostinfo.os) print ('Version: %s' % hostinfo.version) print ('Vendor: %s' % hostinfo.vendor) print ('Description: %s' % hostinfo.description)
def main(): argparser = SnmpArgs(description) args = argparser.parser.parse_args() snmp = NelkitSnmp(args) hostinfo = HostInfo(snmp) hostinfo.get_all() print('OS: %s' % hostinfo.os) print('Version: %s' % hostinfo.version) print('Vendor: %s' % hostinfo.vendor) print('Description: %s' % hostinfo.description)
def main(): """run nk-snmp-deviceinfo.""" argparser = SnmpArgs(description) args = argparser.parser.parse_args() snmp = NelkitSnmp(args) hostinfo = HostInfo(snmp) try: hostinfo.get_all() print('OS: %s' % hostinfo.os) print('Version: %s' % hostinfo.version) print('Vendor: %s' % hostinfo.vendor) print('Description: %s' % hostinfo.description) except Exception as e: print('ERROR: {0}'.format(e))