VMware Cloud Community
davidk_hyperic
Contributor
Contributor
Jump to solution

Trouble Getting Output from rails stats ksh script on opensolaris

Hello,

I have trouble getting my own stat collection script to work on opensolaris:

$ pdk/scripts/report-stats.ksh
processed=0
twitterq=0

=====
script:
=====
#!/bin/ksh

Processed=$(cat /var/tmp/processed-5min.out)
TwitterQ=$(cat /var/tmp/twitter-queries-5min.out)

echo processed=$Processed
echo twitterq=$TwitterQ

====
rails-stats-plugin.xml:
====
<plugin>

<service name="I/O Device">

<config>
<option name="script"
description="Collector script"
default="pdk/scripts/report-stats.ksh"/>
</config>

<filter name="template"
value="exec:file=%script%"/>

<metric name="Availability"
template="${template}:Availability" />

<metric name="Items Processed Last 5 Minutes"
category="THROUGHPUT"
template="${template}:processed"/>

<metric name="Twitter Queries Last 5 Minutes"
category="THROUGHPUT"
template="${template}:twitterq"/>

</service>

</plugin>


----

$ java -version
java version "1.6.0_06"
Java(TM) Platform, Standard Edition for Business (build 1.6.0_06-b02)
Java HotSpot(TM) Server VM (build 10.0-b22, mixed mode)

Agent seems to be behaving, othewise.

Any pointers are greatly appreciated.

Thank you,

/David

Message was edited by: davidk
Reply
0 Kudos
1 Solution

Accepted Solutions
excowboy
Virtuoso
Virtuoso
Jump to solution

David,

pluging looks fine.
Did you deploy the plugin to the hq-plugins directory and follow the other hints ?
http://support.hyperic.com/display/DOCSHQ32/Deploy+Plugin

Mirko

View solution in original post

Reply
0 Kudos
4 Replies
excowboy
Virtuoso
Virtuoso
Jump to solution

David,

I think you're missing the following line beneath <service name="I/O Device">


<plugin type="measurement" class="org.hyperic.hq.product.MeasurementPlugin"/>

Documentation is right here:
http://support.hyperic.com/display/DOC/Measurement+Plugin

Don't forget to restart your agent after deploying the new plugin version, to create a new instance of the service and set a default collection interval for your custom plugin ( default is none, so this could be a trap too) in the Administration menu or for your instance or add the default interval in your plugin descriptor:


<plugin>

<service name="I/O Device">

<plugin type="measurement" class="org.hyperic.hq.product.MeasurementPlugin"/>

<config>
<option name="script"
description="Collector script"
default="pdk/scripts/report-stats.ksh"/>
</config>

<filter name="template"
value="exec:file=%script%"/>

<metric name="Availability"
template="${template}:Availability"
interval="60000"
/>

<metric name="Items Processed Last 5 Minutes"
category="THROUGHPUT"
template="${template}:processed"
interval="60000"
/>

<metric name="Twitter Queries Last 5 Minutes"
category="THROUGHPUT"
template="${template}:twitterq"
interval="60000"
/>

</service>

</plugin>

Best,
Mirko
davidk_hyperic
Contributor
Contributor
Jump to solution

Thank you Mirko - I am still fighting it 🙂

I can't get the plugin to output anything:

$ java -jar pdk/lib/hq-product.jar -Dplugins.include=monitor-stats
$

After I restarted the agent, I am not seeing "Stats Monitor" when I try to create a new platform service.

Something is amiss....

Thank you,

/David

My plugin looks like this:

<plugin>

<service name="Stats Monitor">

<plugin type="measurement" class="org.hyperic.hq.product.MeasurementPlugin"/>

<config>
<option name="script"
description="Collector script"
default="pdk/scripts/report-stats.ksh"/>
</config>

<filter name="template"
value="exec:file=%script%"/>

<metric name="Availability"
template="${template}:Availability"
interval="60000"
/>

<metric name="Items Processed Last 5 Minutes"
category="THROUGHPUT"
template="${template}:processed"
interval="60000"
/>

<metric name="Twitter Queries Last 5 Minutes"
category="THROUGHPUT"
template="${template}:twitterq"
interval="60000"
/>

</service>

</plugin>
Reply
0 Kudos
excowboy
Virtuoso
Virtuoso
Jump to solution

David,

pluging looks fine.
Did you deploy the plugin to the hq-plugins directory and follow the other hints ?
http://support.hyperic.com/display/DOCSHQ32/Deploy+Plugin

Mirko
Reply
0 Kudos
davidk_hyperic
Contributor
Contributor
Jump to solution

Mirko,

I didn't realize I had to install the custom plugin on the server as well. Once I did that and bounced the server, I am seeing the metrics!

Thank you,

David
Reply
0 Kudos