cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Announcements

Community Helping Community

244
Views
0
Helpful
1
Replies
Highlighted

Using ydk unable to get output in cisco NCS 5500 router

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()

1 ACCEPTED SOLUTION

Accepted Solutions
Cisco Employee

Re: Using ydk unable to get output in cisco NCS 5500 router

Already answered in using YDK unable to get output from cisco NCS5500 router

If this is a different questions, please clarify.

View solution in original post

1 REPLY 1
Cisco Employee

Re: Using ydk unable to get output in cisco NCS 5500 router

Already answered in using YDK unable to get output from cisco NCS5500 router

If this is a different questions, please clarify.

View solution in original post

Content for Community-Ad
FusionCharts will render here