ZTE ZXA10 C600 Интерфейсы не отображаются
./noc script --debug --pretty get_interfaces ZTE_C600
PROCESS: ./commands/script.py
VERSION: 20.4.4
BRANCH: HEAD CHANGESET: 24fcd851
ERROR FINGERPRINT: c7986fc0-ebfa-55dd-859b-e14e46105734
WORKING DIRECTORY: /opt/noc
EXCEPTION: <class 'KeyError'> 'GFGM'
START OF TRACEBACK
------------------------------------------------------------------------
File: sa/profiles/ZTE/ZXA10/get_interfaces.py (Line: 106)
Function: execute_cli
99 }
100 ],
101 }
102 ]
103 for p in ports:
104 if int(p["port"]) < 1 or p["realtype"] == "":
105 continue
106 ==> prefix = self.type[p["realtype"]]
107 if prefix in ["gpon-onu_", ""]:
108 continue
109 for i in range(int(p["port"])):
110 port_num = "%s/%s/%s" % (p["shelf"], p["slot"], str(i + 1))
111 ifname = "%s%s" % (prefix, port_num)
112 try:
Variables:
self =
<noc.sa.profiles.ZTE.ZXA10.get_interfaces.Script object at 0x7f30b887b880>
interfaces = []
ports =
[{'cfgtype': 'GFGM',
'hardver': 'V1.0.0',
'port': '16',
'realtype': 'GFGM',
'shelf': '1',
'slot': '1',
'status': 'INSERVICE'},
{'cfgtype': 'GFGN',
'hardver': 'V1.0.0',
'port': '16',
'realtype': 'GFGN',
'shelf': '1',
'slot': '2',
'status': 'INSERVICE'},
{'cfgtype': 'GFGN',
'hardver': 'V1.0.0',
'port': '16',
'realtype': 'GFGN',
'shelf': '1',
'slot': '3',
'status': 'INSERVICE'},
{'cfgtype': 'GFGN',
'hardver': 'V1.0.0',
'port': '16',
'realtype': 'GFGN',
'shelf': '1',
'slot': '4',
'status': 'INSERVICE'},
{'cfgtype': 'GFGN',
'hardver': '',
'port': '16',
'realtype': '',
'shelf': '1',
'slot': '5',
'status': 'OFFLINE'},
{'cfgtype': 'GFGN',
'hardver': '',
'port': '16',
'realtype': '',
'shelf': '1',
'slot': '6',
'status': 'OFFLINE'},
{'cfgtype': 'GFGN',
'hardver': '',
'port': '16',
'realtype': '',
'shelf': '1',
'slot': '7',
'status': 'OFFLINE'},
{'cfgtype': 'GFGN',
'hardver': '',
'port': '16',
'realtype': '',
'shelf': '1',
'slot': '8',
'status': 'OFFLINE'},
{'cfgtype': 'SFUL',
'hardver': 'V1.0.0',
'port': '0',
'realtype': 'SFUL',
'shelf': '1',
'slot': '10',
'status': 'INSERVICE'},
{'cfgtype': 'SFUL',
'hardver': 'V1.0.0',
'port': '0',
'realtype': 'SFUL',
'shelf': '1',
'slot': '11',
'status': 'STANDBY'},
{'cfgtype': 'XFTO',
'hardver': 'V1.0.0',
'port': '8',
'realtype': 'XFTO',
'shelf': '1',
'slot': '16',
'status': 'INSERVICE'},
{'cfgtype': 'XFTO',
'hardver': 'V1.0.0',
'port': '8',
'realtype': 'XFTO',
'shelf': '1',
'slot': '17',
'status': 'INSERVICE'},
{'cfgtype': 'PRVR',
'hardver': 'V1.0.0',
'port': '0',
'realtype': 'PRVR',
'shelf': '1',
'slot': '18',
'status': 'INSERVICE'},
{'cfgtype': 'PRVR',
'hardver': 'V1.0.0',
'port': '0',
'realtype': 'PRVR',
'shelf': '1',
'slot': '20',
'status': 'INSERVICE'},
{'cfgtype': 'FCVDIC',
'hardver': 'V1.0.0',
'port': '0',
'realtype': 'FCVDIC',
'shelf': '1',
'slot': '21',
'status': 'INSERVICE'}]
portchannel_members = {}
p =
{'cfgtype': 'GFGM',
'hardver': 'V1.0.0',
'port': '16',
'realtype': 'GFGM',
'shelf': '1',
'slot': '1',
'status': 'INSERVICE'}
------------------------------------------------------------------------
File: core/script/base.py (Line: 488)
Function: call_method
481 if isinstance(handler, str):
482 handler = getattr(self, handler, None)
483 if handler is None:
484 self.logger.debug("No '%s' handler. Passing to next method" % m)
485 continue
486 # Call handler
487 try:
488 ==> r = handler(**kwargs)
489 if isinstance(r, PartialResult):
490 if self.partial_result:
491 self.partial_result.update(r.result)
492 else:
493 self.partial_result = r.result
494 self.logger.debug(
Variables:
self =
<noc.sa.profiles.ZTE.ZXA10.get_interfaces.Script object at 0x7f30b887b880>
cli_handler =
<bound method Script.execute_cli of <noc.sa.profiles.ZTE.ZXA10.get_interfaces.Script object at 0x7f30b887b880>>
snmp_handler =
<bound method BaseScript.execute_snmp of <noc.sa.profiles.ZTE.ZXA10.get_interfaces.Script object at 0x7f30b887b880>>
fallback_handler = None
kwargs = {}
access_preference = 'CS*'
m = 'C'
handler =
<bound method Script.execute_cli of <noc.sa.profiles.ZTE.ZXA10.get_interfaces.Script object at 0x7f30b887b880>>
------------------------------------------------------------------------
File: core/script/base.py (Line: 451)
Function: execute
444 for f in self._execute_chain:
445 if f._match(self, self.version):
446 return f(self, **kwargs)
447 # Raise error
448 raise self.NotSupportedError()
449 else:
450 # New SNMP/CLI API
451 ==> return self.call_method(
452 cli_handler=self.execute_cli, snmp_handler=self.execute_snmp, **kwargs
453 )
454
455 def call_method(self, cli_handler=None, snmp_handler=None, fallback_handler=None, **kwargs):
456 """
457 Call function depending on access_preference
Variables:
self =
<noc.sa.profiles.ZTE.ZXA10.get_interfaces.Script object at 0x7f30b887b880>
kwargs = {}
------------------------------------------------------------------------
File: core/script/base.py (Line: 307)
Function: run
300 self.logger.info("Using cached result")
301 cache_hit = True
302 except KeyError:
303 pass
304 # Execute script
305 if not cache_hit:
306 try:
307 ==> result = self.execute(**self.args)
308 if self.cache and self.parent and result:
309 self.logger.info("Caching result")
310 self.set_cache(self.name, self.args, result)
311 finally:
312 if not self.parent:
313 # Close SNMP socket when necessary
Variables:
self =
<noc.sa.profiles.ZTE.ZXA10.get_interfaces.Script object at 0x7f30b887b880>
cache_hit = False
------------------------------------------------------------------------
File: commands/script.py (Line: 149)
Function: handle
142 name=script,
143 )
144 span_sample = 1 if update_spec or beef_output else 0
145 result = ""
146 if beef_output:
147 scr.start_tracking()
148 with Span(sample=span_sample, suppress_trace=span_sample):
149 ==> result = scr.run()
150 if pretty:
151 pprint.pprint(result)
152 elif yaml_o:
153 import sys
154
155 yaml.dump(result, sys.stdout)
Variables:
self = <__main__.Command object at 0x7f30c3cc5910>
script = 'ZTE.ZXA10.get_interfaces'
object_name = ['3749']
arguments = []
pretty = True
yaml_o = False
use_snmp = True
access_preference = None
snmp_rate_limit = 0
update_spec = None
beef_output = None
args = {}
options = {}
obj = <ManagedObject: Ленина 64 ZTE 2>
credentials =
{'access_preference': 'CS',
'address': '10.11.4.7',
'cli_protocol': 'telnet',
'password': 'atmS$365',
'path': None,
'raise_privileges': True,
'snmp_rate_limit': None,
'snmp_ro': 'subnet911',
'snmp_version': 'v2c',
'super_password': None,
'user': 'zte'}
script_class = <class 'noc.sa.profiles.ZTE.ZXA10.get_interfaces.Script'>
caps =
{'SNMP': True,
'SNMP | Bulk': True,
'SNMP | IF-MIB': True,
'SNMP | IF-MIB | HC': True,
'SNMP | OID | EnterpriseID': 3902,
'SNMP | v1': True,
'SNMP | v2c': True}
version =
{'caps': {'SNMP': True,
'SNMP | Bulk': True,
'SNMP | IF-MIB': True,
'SNMP | IF-MIB | HC': True,
'SNMP | OID | EnterpriseID': 3902,
'SNMP | v1': True,
'SNMP | v2c': True},
'image': None,
'platform': 'C600',
'vendor': 'ZTE',
'version': 'V1.2.1'}
service = <__main__.ServiceStub object at 0x7f30b90d0760>
scr =
<noc.sa.profiles.ZTE.ZXA10.get_interfaces.Script object at 0x7f30b887b880>
span_sample = 0
result = ''
------------------------------------------------------------------------
File: core/management/base.py (Line: 78)
Function: run_from_argv
71 self.no_progressbar = cmd_options.pop("no_progressbar", False)
72 if enable_profiling:
73 # Start profiler
74 import yappi
75
76 yappi.start()
77 try:
78 ==> return self.handle(*args, **cmd_options) or 0
79 except CommandError as e:
80 self.print(str(e))
81 return 1
82 except KeyboardInterrupt:
83 self.print("Ctrl+C")
84 return 3
Variables:
self = <__main__.Command object at 0x7f30c3cc5910>
argv = ['--debug', '--pretty', 'get_interfaces', '3749']
parser =
ArgumentParser(prog='noc script', usage=None, description=None, formatter_class=<class 'argparse.HelpFormatter'>, conflict_handler='error', add_help=True)
options =
Namespace(access_preference=None, arguments=[], beef_output=None, object_name=['3749'], pretty=True, script=['get_interfaces'], snmp_rate_limit=0, update_spec=None, use_snmp=True, yaml_o=False)
cmd_options =
{'access_preference': None,
'arguments': [],
'beef_output': None,
'object_name': ['3749'],
'pretty': True,
'script': ['get_interfaces'],
'snmp_rate_limit': 0,
'update_spec': None,
'use_snmp': True,
'yaml_o': False}
args = ()
loglevel = 'debug'
enable_profiling = False
show_metrics = False
error_report = <function error_report at 0x7f31492139d0>
------------------------------------------------------------------------
END OF TRACEBACK