04-13-2017 05:02 AM
Hi,
Unable to get output from cisco NCS 5500 router for cpu utilization .Below is the error ouput / script details . Please let us know the resolution if we are using key value.
Error Output
-------------
Traceback (most recent call last):
File "test7.py", line 29, in <module>
print("System uptime is " +str(system_time.total_cpu_one_minute))
AttributeError: 'YList' object has no attribute 'total_cpu_one_minute'
Script
-------
from ydk.services import CRUDService,CodecService
from ydk.providers import NetconfServiceProvider,CodecServiceProvider
from ydk.models.cisco_ios_xr import Cisco_IOS_XR_shellutil_oper \
as xr_shellutil_oper
from ydk.models.cisco_ios_xr import Cisco_IOS_XR_wdsysmon_fd_oper \
as xr_wd_oper
from datetime import timedelta
if __name__ == "__main__":
"""Main execution path"""
# create NETCONF session
provider = NetconfServiceProvider(address="192.168.1.1",
username="username1",
password="pwd1",
protocol="ssh")
# create CRUD service
crud = CRUDService()
# create system time object
system_time = xr_wd_oper.SystemMonitoring.CpuUtilization()
print cpu_util.total_cpu_one_minute
cpu_util = crud.read(provider, cpu_util,only_config=False)
print("Cpu_util is " +str(cpu_util.total_cpu_one_minute))
provider.close()
exit()
Solved! Go to Solution.
04-17-2017 12:05 PM
Already answered in using YDK unable to get output from cisco NCS5500 router
If this is a different questions, please clarify.
04-17-2017 12:05 PM
Already answered in using YDK unable to get output from cisco NCS5500 router
If this is a different questions, please clarify.
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide