Software Development Kit (SDK) and API Discussions

CP info

BOBANPETROVIC
11,895 Views

Hi,

How can I retrieve information about current CP on the system, using API? Which performance object should I refer?

1 ACCEPTED SOLUTION

madden
11,895 Views

Hi Boban,

You can best get this info from the counter manager interface.  From the CLI:

sdt-7dot1a> priv set diag

sdt-7dot1a*> stats start -I test wafl:wafl:cp_count

<<waited a min or two>>

sdt-7dot1a*> stats stop -I test                   

StatisticsID: test

wafl:wafl:cp_count.wafl_timer generated CP:12

wafl:wafl:cp_count.snapshot generated CP:0

wafl:wafl:cp_count.wafl_avail_bufs generated CP:0

wafl:wafl:cp_count.dirty_blk_cnt generated CP:0

wafl:wafl:cp_count.full NV-log generated CP:0

wafl:wafl:cp_count.back-to-back CP:0

wafl:wafl:cp_count.flush generated CP:0

wafl:wafl:cp_count.sync generated CP:0

wafl:wafl:cp_count.deferred back-to-back CP:0

wafl:wafl:cp_count.container-indirect-pin CP:0

wafl:wafl:cp_count.low mbufs generated CP:0

wafl:wafl:cp_count.low datavecs generated CP:0

For a scripted solution you would be best to use the API interface every minute or so allowing you to get a count of CP type that occurred over that minute interval.

You would also want to use the SDK, which also includes some sample code for using these perf APIs:

http://support.netapp.com/NOW/download/software/nmsdk/5.2/

Here is an old, but still accurate doc that describes using this interface:

https://communities.netapp.com/servlet/JiveServlet/previewBody/1044-102-2-7517/Performance_Management_DesignGuide.pdf

Hope this helps!

Cheers,

Chris Madden

Storage Architect, NetApp EMEA

View solution in original post

12 REPLIES 12

rle
NetApp Alumni
11,871 Views

Hi Boban,

It looks like the aggregate, disk, and raid group objects have CP counters like:

cp_read_blocks_hdd - Number of blocks read per second during a CP on the aggregate HDD disks

cp_read_blocks_ssd - Number of blocks read per second during a CP on the aggregate SSD disks

cp_reads - Number of reads per second done during a CP to the aggregate

cp_reads_hdd - Number of reads per second done during a CP to the aggregate HDD disks

cp_reads_ssd - Number of reads per second done during a CP to the aggregate SSD disks

Please see my blog for performance counter API examples.

Regards,

   - Rick -

BOBANPETROVIC
11,871 Views

Thanks for reply, Rick.

I'm not sure if that s helpful to me. I'm planning to poll filer on 1 sec interval, and to get information if CP is performed in that interval and which type (and maybe CP util). That's something similar to sysstat command output.

rle
NetApp Alumni
11,872 Views

Hi Boban,

Sorry for my cDOT assumption.  I don't have a 7-mode system handy.

Polling the filer every 1 second is a burden on ONTAP.  Sysstat can get away with it, because it it internal to ONTAP, and even then, it is not a great idea for the long term.  API calls run through the ZAPI daemon and have to process the request, call the appropriate API, and then return information.  It is more work than sysstat.

If you are still interested in perusing 7-mode APIs, the perf APIs are very similar in 7-mode and cDOT.

Regards,

   - Rick -

BOBANPETROVIC
11,872 Views

Hi,

I'm already polling ONTAP with 1 second interval and about 20 counters, and results are used for plots, in real time. Do you know which CPU domain is affected by this?

rle
NetApp Alumni
11,872 Views

Network and Kahuna domains would be effected.

You might have to do some calculations to show what sysstat shows.

   - Rick -

BOBANPETROVIC
11,872 Views

Hi,

I already do calculations to get average CPU, any CPU, disk util etc. But, for that in formations, I know which counters to poll, and do some calculations after that. For CP type and util, I don't even know  which object to look for appropriate counters.

madden
11,896 Views

Hi Boban,

You can best get this info from the counter manager interface.  From the CLI:

sdt-7dot1a> priv set diag

sdt-7dot1a*> stats start -I test wafl:wafl:cp_count

<<waited a min or two>>

sdt-7dot1a*> stats stop -I test                   

StatisticsID: test

wafl:wafl:cp_count.wafl_timer generated CP:12

wafl:wafl:cp_count.snapshot generated CP:0

wafl:wafl:cp_count.wafl_avail_bufs generated CP:0

wafl:wafl:cp_count.dirty_blk_cnt generated CP:0

wafl:wafl:cp_count.full NV-log generated CP:0

wafl:wafl:cp_count.back-to-back CP:0

wafl:wafl:cp_count.flush generated CP:0

wafl:wafl:cp_count.sync generated CP:0

wafl:wafl:cp_count.deferred back-to-back CP:0

wafl:wafl:cp_count.container-indirect-pin CP:0

wafl:wafl:cp_count.low mbufs generated CP:0

wafl:wafl:cp_count.low datavecs generated CP:0

For a scripted solution you would be best to use the API interface every minute or so allowing you to get a count of CP type that occurred over that minute interval.

You would also want to use the SDK, which also includes some sample code for using these perf APIs:

http://support.netapp.com/NOW/download/software/nmsdk/5.2/

Here is an old, but still accurate doc that describes using this interface:

https://communities.netapp.com/servlet/JiveServlet/previewBody/1044-102-2-7517/Performance_Management_DesignGuide.pdf

Hope this helps!

Cheers,

Chris Madden

Storage Architect, NetApp EMEA

BOBANPETROVIC
11,872 Views

Hi madden,

That's exactly what I want. But I have one problem now because I created low privileged user for only purpose to poll counters via script. It appears that low privileged user can't poll counters for an object that has privilege-level=admin, like wafl object, because I don't get any output, and errors are also not present.

What privilege should be added to poll user to make this possible?

rle
NetApp Alumni
11,872 Views

Hi Boban,

Now that we know what you want, I think you can use the perf APIs to obtain what you want.

The counter object is wafl.

The counter is cp_count. The description is interesting: "Array of counts of different types of CPs"

The cp_count counter is a type delta.  There is also cp_phase_times counter.  I would do a perf-object-instace-list-info with the object name wafl and see what instances are available. I'm hoping that the instance names will match the ones that Chris pointed out.

If that doesn't work, you can look for various counters that are similar like wafl_bufs_available_for_cp.

Regards,

   - Rick -

BOBANPETROVIC
7,382 Views

Hi Rick,

Thanks for your help , I appreciate it. Chris's answer is detailed enough so I checked it as correct.

BOBANPETROVIC
7,382 Views

Hi Chris,

It points out that this request:

<?xml version="1.0" encoding="UTF-8"?>

<netapp  xmlns="http://www.netapp.com/filer/admin" version="1.19">

  <perf-object-get-instances-iter-start>

    <objectname>wafl</objectname>

  </perf-object-get-instances-iter-start>

</netapp>

Resilt this:

<?xml version='1.0' encoding='UTF-8' ?>

<netapp version='1.1' xmlns='http://www.netapp.com/filer/admin'>

    <!-- Output of perf-object-get-instances-iter-start [Execution Time: 94 ms] -->

          <results errno='13001' reason='Not enough memory to get instances for wafl.Use perf-object-get-instances-iter-* calls and/or ask for specific counters to limit the amount of data retrieved' status='failed'/>

</netapp>

If I specify instance and object everything is just fine. Thanks a lot, I'll make your answer correct.

madden
7,382 Views

Hi Boban,

The error message you observed is due to some changes in DOT that were introduced in 8.1.3 that is most commonly hit when using Performance Advisor.  But, if you call the APIs directly you can hit the same.  Here is a support announcement about it that includes links to the related bugs:

https://kb.netapp.com/support/index?page=content&id=7010102&actp=LIST

Glad you got your code working!

Cheers,

Chris

Public