<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<body link="#355491" alink="#4262a1" vlink="#355491" style="background: #e2e2e2; margin: 0; padding: 20px;">

<div>
        <table cellpadding="0" bgcolor="#FFFFFF" border="0" cellspacing="0" style="border: 1px solid #dadada; margin-bottom: 30px; width: 100%; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
                <tbody>
                        <tr>

                                <td>

                                        <table border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF" style="border: solid 2px #ccc; background: #dadada; width: 100%; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
                                                <tbody>
                                                        <tr>
                                                                <td bgcolor="#000000" valign="middle" height="58px" style="border-bottom: 1px solid #ccc; padding: 20px; -moz-border-radius-topleft: 3px; -moz-border-radius-topright: 3px; -webkit-border-top-right-radius: 5px; -webkit-border-top-left-radius: 5px;">
                                                                        <h1 style="color: #333333; font: bold 22px Arial, Helvetica, sans-serif; margin: 0; display: block !important;">
                                                                        <!-- To have a header image/logo replace the name below with your img tag -->
                                                                        <!-- Email clients will render the images when the message is read so any image -->
                                                                        <!-- must be made available on a public server, so that all recipients can load the image. -->
                                                                        <a href="https://community.jboss.org/index.jspa" style="text-decoration: none; color: #E1E1E1">JBoss Community</a></h1>
                                                                </td>

                                                        </tr>
                                                        <tr>
                                                                <td bgcolor="#FFFFFF" style="font: normal 12px Arial, Helvetica, sans-serif; color:#333333; padding: 20px;  -moz-border-radius-bottomleft: 4px; -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 5px; -webkit-border-bottom-left-radius: 5px;"><h3 style="margin: 10px 0 5px; font-size: 17px; font-weight: normal;">
    Using jps and jstat with jboss
</h3>
<span style="margin-bottom: 10px;">
    created by <a href="https://community.jboss.org/people/willemnoorduin">Willem Noorduin</a> in <i>Beginner's Corner</i> - <a href="https://community.jboss.org/message/791429#791429">View the full discussion</a>
</span>
<hr style="margin: 20px 0; border: none; background-color: #dadada; height: 1px;">

<div class="jive-rendered-content"><p>We are trying to set up some basic monitoring with jps and jstat and we are running into a problem. For usage of these tools there is a hsperfdata_${user} directory created by the jvm, by default in /tmp. Only in our case, it is not created. Hence we cannot use jps, jstat or the other jvm tools. Some information:</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>root@nlptc27b09:/tmp# cat /etc/redhat-release </p><p>Red Hat Enterprise Linux Server release 6.3 (Santiago)</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>root@nlptc27b09:/tmp# uname -a</p><p>Linux nlptc27b09 2.6.32-279.11.1.el6.x86_64 #1 SMP Sat Sep 22 07:10:26 EDT 2012 x86_64 x86_64 x86_64 GNU/Linux</p><p>root@nlptc27b09:/tmp# /distr/jdk/bin/java -version</p><p>java version "1.6.0_27"</p><p>Java(TM) SE Runtime Environment (build 1.6.0_27-b07)</p><p>Java HotSpot(TM) Server VM (build 20.2-b06, mixed mode)</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>root@nlptc27b09:/tmp# ls -ls /tmp</p><p>total 16</p><p> 0 drwxr-xr-x. 2 root&#160;&#160;&#160;&#160; root&#160;&#160;&#160;&#160;&#160;&#160; 40 Jan 14 07:21 hsperfdata_root</p><p>12 -rwxr-xr-x. 1 root&#160;&#160;&#160;&#160; root&#160;&#160;&#160;&#160; 8630 Dec 13 15:30 iptables</p><p> 4 -rwxr-xr-x. 1 root&#160;&#160;&#160;&#160; root&#160;&#160;&#160;&#160;&#160; 324 Dec 13 12:53 iptables-ctl.sh</p><p> 0 drwxr-xr-x. 2 wnoordui users&#160;&#160;&#160;&#160;&#160; 40 Dec 12 10:20 iptables.d</p><p> 0 drwx------. 2 root&#160;&#160;&#160;&#160; root&#160;&#160;&#160;&#160;&#160;&#160; 40 Dec 18 11:46 mc-root</p><p> 0 drwx------. 2 wnoordui wnoordui&#160;&#160; 40 Dec&#160; 3 09:44 mc-wnoordui</p><p> 0 drwx------. 2 root&#160;&#160;&#160;&#160; root&#160;&#160;&#160;&#160;&#160;&#160; 40 Nov 14 10:53 vmware-root</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>root@nlptc27b09:/tmp# ls -ld /tmp</p><p>drwxrwxrwt. 8 root root 200 Jan 14 07:18 /tmp</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>We are running jboss under a non-root user (as it should) named jboss.&#160; We have tried the next things, with different results:</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><ul><li style="text-align: start;">Running jboss under root. =&gt; Then the directory hsperdata_root is used and we get results (but you don't want that).</li><li style="text-align: start;">Putting <strong>-XX:+UsePerfData -Djava.io.tmpdir=/tmp </strong>as Java options =&gt; has no results (there is no hsperdata_jboss, in our case, created).</li><li style="text-align: start;">Switching to the last stable release of SUN/Oracle SDK =&gt; has no results (there is no hsperdata_jboss, in our case, created).</li><li style="text-align: start;">Switching to OpenJDK on Redhat =&gt; Now we get a /tmp/hsperfdata_jboss (but we don't want to use OpenJDK for our production JBoss).</li><li style="text-align: start;">Switching to another OS (Debian 6.0.6) and the same SUN JDK =&gt; Is working fine.</li><li style="text-align: start;">Putting <strong>-XX:+UsePerfData -Djava.io.tmpdir=/home/jboss/tmp</strong> (where this last directory is writeable by user jboss)&#160; as Java options =&gt; has no results (there is no hsperdata_jboss, in our case, created).</li></ul><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="text-align: start;">I am communicating with Redhat on this, since the swritch from SUN to OpenJDK or/and Redhat to another Linux OS seemed to do the trick, but all I learned was that it might be a permission issue. But:</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>root@nlptc27b09:/apps/jboss/test/configs# su - jboss</p><p>jboss@nlptc27b09:~$ cd /tmp</p><p>jboss@nlptc27b09:/tmp$ mkdir i-am-a-directory</p><p>jboss@nlptc27b09:/tmp$ touch i-am-a-directory/i-am-a-file</p><p>jboss@nlptc27b09:/tmp$ ls -lR i-am-a-directory/</p><p>i-am-a-directory/:</p><p>total 0</p><p>-rw-rw-r--. 1 jboss jboss 0 Jan 14 07:38 i-am-a-file</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>on Redhat says otherwise. Also, you can google all you want on this problem, all I found was ways to turn the perfstats off, not on. Can someone tell me where I went wrong ?&#160; Also, the residental Linux Gurus on our team seems to point that this is really a java issue.</p></div>

<div style="background-color: #f4f4f4; padding: 10px; margin-top: 20px;">
    <p style="margin: 0;">Reply to this message by <a href="https://community.jboss.org/message/791429#791429">going to Community</a></p>
        <p style="margin: 0;">Start a new discussion in Beginner's Corner at <a href="https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2075">Community</a></p>
</div></td>
                        </tr>
                    </tbody>
                </table>


                </td>
            </tr>
        </tbody>
    </table>

</div>

</body>
</html>