<div dir="ltr"><div><div><div>If you don't know what IndentationError is, I think there is a long way to go before you familiar with Python.<br><br></div>I suggest you discus something about developer issue in this Development Mailing List<br><br></div>Your problem is that you have modify the file /opt/stack/ceilometer/ceilometer/compute/notifications/cpu.py, but use wrong indentation, for example, you're using tab in linux vim, but set wrong configuration for .vimrc, so it gets wrong indentation comparing to original code<br><br></div>Let's end it, please<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Nov 12, 2014 at 10:41 AM, Du Jun <span dir="ltr"><<a href="mailto:dj199008@gmail.com" target="_blank">dj199008@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi all,<div><br></div><div>I think I have found the reason why I am unable to get compute.node.cpu* information from command:</div><div><br></div><div>$ ceilometer meter-list</div><div><br></div><div>I get the error message from ceilometer-agent-notification.log</div><div><br></div><div><p style="margin:0px;font-size:11px;font-family:Menlo"><font color="#ff0000">2014-11-11 17:10:40.015 19486 ERROR stevedore.extension [-] Could not load 'cpu_user_percent': unexpected indent (cpu.py, line 58)</font></p>
<p style="margin:0px;font-size:11px;font-family:Menlo">2014-11-11 17:10:40.015 19486 ERROR stevedore.extension [-] unexpected indent (cpu.py, line 58)</p>
<p style="margin:0px;font-size:11px;font-family:Menlo">2014-11-11 17:10:40.015 19486 TRACE stevedore.extension Traceback (most recent call last):</p>
<p style="margin:0px;font-size:11px;font-family:Menlo">2014-11-11 17:10:40.015 19486 TRACE stevedore.extension File "/usr/local/lib/python2.7/dist-packages/stevedore/extension.py", line 162, in _load_plugins</p>
<p style="margin:0px;font-size:11px;font-family:Menlo">2014-11-11 17:10:40.015 19486 TRACE stevedore.extension verify_requirements,</p>
<p style="margin:0px;font-size:11px;font-family:Menlo">2014-11-11 17:10:40.015 19486 TRACE stevedore.extension File "/usr/local/lib/python2.7/dist-packages/stevedore/extension.py", line 178, in _load_one_plugin</p>
<p style="margin:0px;font-size:11px;font-family:Menlo">2014-11-11 17:10:40.015 19486 TRACE stevedore.extension plugin = ep.load(require=verify_requirements)</p>
<p style="margin:0px;font-size:11px;font-family:Menlo">2014-11-11 17:10:40.015 19486 TRACE stevedore.extension File "/usr/local/lib/python2.7/dist-packages/pkg_resources.py", line 2184, in load</p>
<p style="margin:0px;font-size:11px;font-family:Menlo">2014-11-11 17:10:40.015 19486 TRACE stevedore.extension ['__name__'])</p>
<p style="margin:0px;font-size:11px;font-family:Menlo">2014-11-11 17:10:40.015 19486 TRACE stevedore.extension File "/opt/stack/ceilometer/ceilometer/compute/notifications/cpu.py", line 58</p>
<p style="margin:0px;font-size:11px;font-family:Menlo">2014-11-11 17:10:40.015 19486 TRACE stevedore.extension if info:</p>
<p style="margin:0px;font-size:11px;font-family:Menlo">2014-11-11 17:10:40.015 19486 TRACE stevedore.extension ^</p>
<p style="margin:0px;font-size:11px;font-family:Menlo">2014-11-11 17:10:40.015 19486 TRACE stevedore.extension IndentationError: unexpected indent</p><p style="margin:0px;font-size:11px;font-family:Menlo"><br></p><p style="margin:0px;font-size:11px;font-family:Menlo">It seems that the python stevedore throws the error. I am not familiar with python stevedore, so I have no idea about the error message now. Any help will be appreciated.</p><p style="margin:0px;font-size:11px;font-family:Menlo"><br></p><p style="margin:0px;font-size:11px;font-family:Menlo"><br></p><p style="margin:0px;font-size:11px;font-family:Menlo">--</p><p style="margin:0px;font-size:11px;font-family:Menlo">Regards,</p><p style="margin:0px;font-size:11px;font-family:Menlo">Frank</p></div></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">2014-11-11 10:52 GMT+08:00 Du Jun <span dir="ltr"><<a href="mailto:dj199008@gmail.com" target="_blank">dj199008@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><span style="font-family:sans-serif">$ ceilometer sample-list -m compute.node.cpu.idle.time</span><br><div><span style="font-family:sans-serif"><br></span></div><div><span style="font-family:sans-serif">I still get nothing.</span></div><div><span style="font-family:sans-serif"><br></span></div><div><span style="font-family:sans-serif"><br></span></div><div><span style="font-family:sans-serif">--</span></div><div><span style="font-family:sans-serif">Regards,</span></div><div><font face="sans-serif">Frank</font></div></div><div><div><div class="gmail_extra"><br><div class="gmail_quote">2014-11-07 21:17 GMT+08:00 Hang H Liu <span dir="ltr"><<a href="mailto:hangliu@cn.ibm.com" target="_blank">hangliu@cn.ibm.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div>
<p><font face="sans-serif">You didn't provide the full name of the meter. Here are results in my system.</font><br>
<br>
<font face="sans-serif">localadmin@ostest2:~/devstack$ ceilometer sample-list -m compute.node.cpu</font><span><br>
<font face="sans-serif">+-------------+------+------+--------+------+-----------+</font><br>
<font face="sans-serif">| Resource ID | Name | Type | Volume | Unit | Timestamp |</font><br>
<font face="sans-serif">+-------------+------+------+--------+------+-----------+</font><br>
<font face="sans-serif">+-------------+------+------+--------+------+-----------+</font><br>
<br>
</span><font face="sans-serif">localadmin@ostest2:~/devstack$ ceilometer sample-list -m compute.node.cpu.idle.time | head</font><br>
<font face="sans-serif">+-----------------+----------------------------+------------+-----------------+------+----------------------------+</font><span><br>
<font face="sans-serif">| Resource ID | Name | Type | Volume | Unit | Timestamp |</font><br>
</span><font face="sans-serif">+-----------------+----------------------------+------------+-----------------+------+----------------------------+</font><br>
<font face="sans-serif">| ostest2_ostest2 | compute.node.cpu.idle.time | cumulative | 3.876353234e+16 | ns | 2014-11-07T13:15:06.580099 |</font><br>
<font face="sans-serif">| ostest2_ostest2 | compute.node.cpu.idle.time | cumulative | 3.876282715e+16 | ns | 2014-11-07T13:14:06.587392 |</font><br>
<font face="sans-serif">| ostest2_ostest2 | compute.node.cpu.idle.time | cumulative | 3.87621264e+16 | ns | 2014-11-07T13:13:06.556272 |</font><br>
<font face="sans-serif">| ostest2_ostest2 | compute.node.cpu.idle.time | cumulative | 3.876141325e+16 | ns | 2014-11-07T13:12:05.596962 |</font><br>
<font face="sans-serif">| ostest2_ostest2 | compute.node.cpu.idle.time | cumulative | 3.876070965e+16 | ns | 2014-11-07T13:11:05.576771 |</font><br>
<font face="sans-serif">| ostest2_ostest2 | compute.node.cpu.idle.time | cumulative | 3.875998092e+16 | ns | 2014-11-07T13:10:03.597978 |</font><br>
<font face="sans-serif">| ostest2_ostest2 | compute.node.cpu.idle.time | cumulative | 3.87592522e+16 | ns | 2014-11-07T13:09:01.583991 |</font><br>
<font face="sans-serif"><br>
<br>
Best Regards,<br>
Liu, Hang(Henry) <br>
</font><span><tt><font>_______________________________________________<br>
OpenStack-dev mailing list<br>
<a href="mailto:OpenStack-dev@lists.openstack.org" target="_blank">OpenStack-dev@lists.openstack.org</a><br>
</font></tt><a href="http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev" target="_blank"><tt><font>http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev</font></tt></a><tt><font><br>
</font></tt><font face="sans-serif"><br>
</font><br>
</span><tt><font>Du Jun <<a href="mailto:dj199008@gmail.com" target="_blank">dj199008@gmail.com</a>> 写于 2014/11/07 15:46:21:<br>
<br>
> From: Du Jun <<a href="mailto:dj199008@gmail.com" target="_blank">dj199008@gmail.com</a>></font></tt><span><br>
<tt><font>> To: "OpenStack Development Mailing List (not for usage questions)" <br>
> <<a href="mailto:openstack-dev@lists.openstack.org" target="_blank">openstack-dev@lists.openstack.org</a>></font></tt><br>
</span><tt><font>> Date: 2014/11/07 15:50</font></tt></p><div><div><br>
<tt><font>> Subject: Re: [openstack-dev] [ceilometer] unable to collect <br>
> compute.node.cpu.* data</font></tt><br>
<tt><font>> <br>
> Nothing shows when I type command:</font></tt><br>
<tt><font>> <br>
> vcap@ubuntu:~$ ceilometer sample-list --meter compute.node.cpu</font></tt><br>
<tt><font>> +-------------+------+------+--------+------+-----------+</font></tt><br>
<tt><font>> | Resource ID | Name | Type | Volume | Unit | Timestamp |</font></tt><br>
<tt><font>> +-------------+------+------+--------+------+-----------+</font></tt><br>
<tt><font>> +-------------+------+------+--------+------+-----------+</font></tt><br>
<tt><font>> <br>
> So, I guess there is no sample data concerning on "compute.node.cpu"<br>
> in the database.</font></tt><br>
<tt><font>> <br>
> I assume the problem is about the "pipeline.yaml", the pipeline in <br>
> my devstack system is:</font></tt><br>
<tt><font>> <br>
> ---</font></tt><br>
<tt><font>> sources:</font></tt><br>
<tt><font>> - name: meter_source</font></tt><br>
<tt><font>> interval: 600</font></tt><br>
<tt><font>> meters:</font></tt><br>
<tt><font>> - "*"</font></tt><br>
<tt><font>> sinks:</font></tt><br>
<tt><font>> - meter_sink</font></tt><br>
<tt><font>> - name: cpu_source</font></tt><br>
<tt><font>> interval: 600</font></tt><br>
<tt><font>> meters:</font></tt><br>
<tt><font>> - "cpu"</font></tt><br>
<tt><font>> sinks:</font></tt><br>
<tt><font>> - cpu_sink</font></tt><br>
<tt><font>> - name: disk_source</font></tt><br>
<tt><font>> interval: 600</font></tt><br>
<tt><font>> meters:</font></tt><br>
<tt><font>> - "disk.read.bytes"</font></tt><br>
<tt><font>> - "disk.read.requests"</font></tt><br>
<tt><font>> - "disk.write.bytes"</font></tt><br>
<tt><font>> - "disk.write.requests"</font></tt><br>
<tt><font>> sinks:</font></tt><br>
<tt><font>> - disk_sink</font></tt><br>
<tt><font>> - name: network_source</font></tt><br>
<tt><font>> interval: 600</font></tt><br>
<tt><font>> meters:</font></tt><br>
<tt><font>> - "network.incoming.bytes"</font></tt><br>
<tt><font>> - "network.incoming.packets"</font></tt><br>
<tt><font>> - "network.outgoing.bytes"</font></tt><br>
<tt><font>> - "network.outgoing.packets"</font></tt><br>
<tt><font>> sinks:</font></tt><br>
<tt><font>> - network_sink</font></tt><br>
<tt><font>> sinks:</font></tt><br>
<tt><font>> - name: meter_sink</font></tt><br>
<tt><font>> transformers:</font></tt><br>
<tt><font>> publishers:</font></tt><br>
<tt><font>> - notifier://</font></tt><br>
<tt><font>> - name: cpu_sink</font></tt><br>
<tt><font>> transformers:</font></tt><br>
<tt><font>> - name: "rate_of_change"</font></tt><br>
<tt><font>> parameters:</font></tt><br>
<tt><font>> target:</font></tt><br>
<tt><font>> name: "cpu_util"</font></tt><br>
<tt><font>> unit: "%"</font></tt><br>
<tt><font>> type: "gauge"</font></tt><br>
<tt><font>> scale: "100.0 / (10**9 * <br>
> (resource_metadata.cpu_number or 1))"</font></tt><br>
<tt><font>> publishers:</font></tt><br>
<tt><font>> - notifier://</font></tt><br>
<tt><font>> - name: disk_sink</font></tt><br>
<tt><font>> transformers:</font></tt><br>
<tt><font>> - name: "rate_of_change"</font></tt><br>
<tt><font>> parameters:</font></tt><br>
<tt><font>> source:</font></tt><br>
<tt><font>> map_from:</font></tt><br>
<tt><font>> name: "disk\\.(read|write)\\.(bytes|requests)"</font></tt><br>
<tt><font>> unit: "(B|request)"</font></tt><br>
<tt><font>> target:</font></tt><br>
<tt><font>> map_to:</font></tt><br>
<tt><font>> name: "disk.\\1.\\2.rate"</font></tt><br>
<tt><font>> unit: "\\1/s"</font></tt><br>
<tt><font>> type: "gauge"</font></tt><br>
<tt><font>> publishers:</font></tt><br>
<tt><font>> - notifier://</font></tt><br>
<tt><font>> - name: network_sink</font></tt><br>
<tt><font>> transformers:</font></tt><br>
<tt><font>> - name: "rate_of_change"</font></tt><br>
<tt><font>> parameters:</font></tt><br>
<tt><font>> source:</font></tt><br>
<tt><font>> map_from:</font></tt><br>
<tt><font>> name: "network\\.(incoming|outgoing)\\.(bytes|packets)"</font></tt><br>
<tt><font>> unit: "(B|packet)"</font></tt><br>
<tt><font>> target:</font></tt><br>
<tt><font>> map_to:</font></tt><br>
<tt><font>> name: "network.\\1.\\2.rate"</font></tt><br>
<tt><font>> unit: "\\1/s"</font></tt><br>
<tt><font>> type: "gauge"</font></tt><br>
<tt><font>> publishers:</font></tt><br>
<tt><font>> - notifier://</font></tt><br>
<tt><font>> <br>
> Can anyone tell me whether it's true?</font></tt><br>
<tt><font>> <br>
> @hangliu, would you please show me your pipeline.yaml, if possible. Thanks!</font></tt><br>
<tt><font>> <br>
> --</font></tt><br>
<tt><font>> Regards,</font></tt><br>
<tt><font>> Frank</font></tt><br>
<tt><font>> <br>
> 2014-11-06 22:37 GMT+08:00 Neal, Phil <<a href="mailto:phil.neal@hp.com" target="_blank">phil.neal@hp.com</a>>:</font></tt><br>
<tt><font>> Frank, I'd echo Hang Liu's suggestion, but also encourage you to <br>
> take this question to the general OpenStack mailing<br>
> list (see <a href="https://wiki.openstack.org/wiki/Mailing_Lists" target="_blank">https://wiki.openstack.org/wiki/Mailing_Lists</a>).<br>
> <br>
> - Phil<br>
> <br>
> From: Hang H Liu [<a href="mailto:hangliu@cn.ibm.com" target="_blank">mailto:hangliu@cn.ibm.com</a>]<br>
> Sent: Wednesday, November 05, 2014 7:36 AM<br>
> To: OpenStack Development Mailing List (not for usage questions)</font></tt><br>
<tt><font>> Subject: Re: [openstack-dev] [ceilometer] unable to collect <br>
> compute.node.cpu.* data<br>
> <br>
> Same steps I can get below results. <br>
> You may need debug into get_meters() in ceilometer/storage/<br>
> impl_sqlalchemy.py to see if some filters are taking effect.<br>
> <br>
> <br>
> localadmin@ostest2:~/devstack$ ceilometer meter-list<br>
> +---------------------------------+------------+---------<br>
> +--------------------------------------<br>
> +----------------------------------+----------------------------------+<br>
> | Name | Type | Unit | Resource <br>
> ID | User ID | <br>
> Project ID |<br>
> +---------------------------------+------------+---------<br>
> +--------------------------------------<br>
> +----------------------------------+----------------------------------+<br>
> | compute.node.cpu.frequency | gauge | MHz | <br>
> ostest2_ostest2 | None <br>
> | None |<br>
> | compute.node.cpu.idle.percent | gauge | % | <br>
> ostest2_ostest2 | None <br>
> | None |<br>
> | compute.node.cpu.idle.time | cumulative | ns | <br>
> ostest2_ostest2 | None <br>
> | None |<br>
> | compute.node.cpu.iowait.percent | gauge | % | <br>
> ostest2_ostest2 | None <br>
> | None |<br>
> | compute.node.cpu.iowait.time | cumulative | ns | <br>
> ostest2_ostest2 | None <br>
> | None |<br>
> | compute.node.cpu.kernel.percent | gauge | % | <br>
> ostest2_ostest2 | None <br>
> | None |<br>
> | compute.node.cpu.kernel.time | cumulative | ns | <br>
> ostest2_ostest2 | None <br>
> | None |<br>
> | compute.node.cpu.percent | gauge | % | <br>
> ostest2_ostest2 | None <br>
> | None |<br>
> | compute.node.cpu.user.percent | gauge | % | <br>
> ostest2_ostest2 | None <br>
> | None |<br>
> | compute.node.cpu.user.time | cumulative | ns | <br>
> ostest2_ostest2 | None <br>
> <br>
> <br>
> <br>
> "Lu, Lianhao" <<a href="mailto:lianhao.lu@intel.com" target="_blank">lianhao.lu@intel.com</a>> 写于 2014/11/05 15:23:14:<br>
> <br>
> > From: "Lu, Lianhao" <<a href="mailto:lianhao.lu@intel.com" target="_blank">lianhao.lu@intel.com</a>><br>
> > To: "OpenStack Development Mailing List (not for usage questions)"<br>
> > <<a href="mailto:openstack-dev@lists.openstack.org" target="_blank">openstack-dev@lists.openstack.org</a>><br>
> > Date: 2014/11/05 15:31<br>
> > Subject: Re: [openstack-dev] [ceilometer] unable to collect<br>
> > compute.node.cpu.* data<br>
> ><br>
> > Hi Frank,<br>
> > <br>
> > Could you try ‘celometer sample-list’ to see if the compute.node.cpu<br>
> > samples are there?<br>
> > <br>
> > -Lianhao<br>
> > <br>
> > From: Du Jun [<a href="mailto:dj199008@gmail.com" target="_blank">mailto:dj199008@gmail.com</a>]<br>
> > Sent: Wednesday, November 05, 2014 3:44 AM<br>
> > To: <a href="mailto:openstack-dev@lists.openstack.org" target="_blank">openstack-dev@lists.openstack.org</a><br>
> > Subject: [openstack-dev] [ceilometer] unable to collect<br>
> > compute.node.cpu.* data<br>
> > <br>
> > Hi all,<br>
> > <br>
> > I attempt to collect compute.node.cpu as the following link mentions:<br>
> > <br>
> > <a href="http://docs.openstack.org/developer/ceilometer/" target="_blank">http://docs.openstack.org/developer/ceilometer/</a><br>
> measurements.html#compute-nova<br>
> > <br>
> > I set:<br>
> > <br>
> > compute_monitors = ComputeDriverCPUMonitor<br>
> > <br>
> > in /etc/nova/nova.conf and restart nova-compute, nova-scheduler,<br>
> > ceilometer-agent-notification, ceilometer-api, ceilometer-collector.<br>
> > <br>
> > From ceilometer-agent-notification's log, I can see agent transform<br>
> > and publish data samples compute.node.cpu.*<br>
> > <br>
> > What's more, from ceilometer database, I can see all the meters<br>
> > compute.node.cpu.*<br>
> > <br>
> > mysql> select * from meter;<br>
> > +----+---------------------------------+------------+-----------+<br>
> > | id | name | type | unit |<br>
> > +----+---------------------------------+------------+-----------+<br>
> > | 39 | compute.node.cpu.frequency | gauge | MHz |<br>
> > | 41 | compute.node.cpu.idle.percent | gauge | % |<br>
> > | 38 | compute.node.cpu.idle.time | cumulative | ns |<br>
> > | 45 | compute.node.cpu.iowait.percent | gauge | % |<br>
> > | 42 | compute.node.cpu.iowait.time | cumulative | ns |<br>
> > | 36 | compute.node.cpu.kernel.percent | gauge | % |<br>
> > | 44 | compute.node.cpu.kernel.time | cumulative | ns |<br>
> > | 37 | compute.node.cpu.percent | gauge | % |<br>
> > | 43 | compute.node.cpu.user.percent | gauge | % |<br>
> > | 40 | compute.node.cpu.user.time | cumulative | ns |<br>
> > <br>
> > <br>
> > However, when I type<br>
> > <br>
> > ceilometer meter-list<br>
> > <br>
> > It shows nothing about compute.node.cpu.*, so I wonder what's wrong<br>
> > with my steps.<br>
> > <br>
> > --<br>
> > Regards,<br>
> > Frank_______________________________________________<br>
> > OpenStack-dev mailing list<br>
> > <a href="mailto:OpenStack-dev@lists.openstack.org" target="_blank">OpenStack-dev@lists.openstack.org</a><br>
> > <a href="http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev" target="_blank">http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev</a><br>
> _______________________________________________<br>
> OpenStack-dev mailing list<br>
> <a href="mailto:OpenStack-dev@lists.openstack.org" target="_blank">OpenStack-dev@lists.openstack.org</a><br>
> <a href="http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev" target="_blank">http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev</a></font></tt><br>
<tt><font>> _______________________________________________<br>
> OpenStack-dev mailing list<br>
> <a href="mailto:OpenStack-dev@lists.openstack.org" target="_blank">OpenStack-dev@lists.openstack.org</a><br>
> <a href="http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev" target="_blank">http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev</a><br>
</font></tt></div></div><p></p></div><br>_______________________________________________<br>
OpenStack-dev mailing list<br>
<a href="mailto:OpenStack-dev@lists.openstack.org" target="_blank">OpenStack-dev@lists.openstack.org</a><br>
<a href="http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev" target="_blank">http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev</a><br>
<br></blockquote></div><br></div>
</div></div></blockquote></div><br></div>
</div></div><br>_______________________________________________<br>
OpenStack-dev mailing list<br>
<a href="mailto:OpenStack-dev@lists.openstack.org">OpenStack-dev@lists.openstack.org</a><br>
<a href="http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev" target="_blank">http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev</a><br>
<br></blockquote></div><br><br clear="all"><br>-- <br><div class="gmail_signature"><div dir="ltr"><div>blog: <a href="http://zqfan.github.com" target="_blank">zqfan.github.com</a><br></div>git: <a href="http://github.com/zqfan" target="_blank">github.com/zqfan</a><br></div></div>
</div>