# sensu check for java process

**URL:** <https://discourse.sensu.io/t/sensu-check-for-java-process/132>\
**Category:** Sensu Classic (EOL)\
**Created:** [January 29, 2014, 4:26pm UTC](https://discourse.sensu.io/t/sensu-check-for-java-process/132 "2014-01-29T16:26:23Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Subhadip\_Bagui](https://avatars.discourse-cdn.com/v4/letter/s/b5e925/32.png) [@Subhadip\_Bagui](https://discourse.sensu.io/u/Subhadip_Bagui)\
**Post date:** [January 29, 2014, 4:26pm UTC](https://discourse.sensu.io/t/sensu-check-for-java-process/132/1 "2014-01-29T16:26:23Z")

</div>

Hi,

I’m new in sensu and using a check like below in sensu server

{  
“checks”: {  
“java\_metrics”: {  
“type”: “metric”,  
“command”: “java-heap.sh -n Bootstrap”,  
“subscribers”: [  
“production”  
],  
“interval”: 20  
}  
}  
}

whenever sense server running this checks it gives an error like “jps: command not found” “jstat: command not found”  
I’m using the plugin [java-heap-pcnt.sh](https://github.com/sensu/sensu-community-plugins/blob/master/plugins/java/java-heap-pcnt.sh) from sensu-community [https://github.com/sensu/sensu-community-plugins/tree/master/plugins/java](https://github.com/sensu/sensu-community-plugins/tree/master/plugins/java)

The same is working fine from my sensu-client m/c. I have given sensu user root privilege in case of any sudo issues.  
Please help on the same as I’m stuck with this checks execution.

Thanks,  
Subhadip

---

<div class="post-metadata">

**Author:** ![Sean\_Porter](https://avatars.discourse-cdn.com/v4/letter/s/7feea3/32.png) [@Sean\_Porter](https://discourse.sensu.io/u/Sean_Porter)\
**Post date:** [January 29, 2014, 5:24pm UTC](https://discourse.sensu.io/t/sensu-check-for-java-process/132/2 "2014-01-29T17:24:52Z")

</div>

Perhaps `jps` and `jstat` are not in PATH for the Sensu client. You can adjust PATH globally or in /etc/default/sensu, the Sensu client will need a restart.

Sean.

> **···**
>
> On Wed, Jan 29, 2014 at 8:26 AM, Subhadip Bagui [i.bagui@gmail.com](mailto:i.bagui@gmail.com) wrote:
> 
> > Hi,
> > 
> > I’m new in sensu and using a check like below in sensu server
> > 
> > {  
> > “checks”: {
> > 
> > ```
> > "java_metrics": {
> > "type": "metric",
> > "command": "java-heap.sh -n Bootstrap",
> > "subscribers": [
> > "production"
> > 
> > ],
> > "interval": 20
> > }
> > 
> > ```
> > 
> > }  
> > }
> > 
> > whenever sense server running this checks it gives an error like “jps: command not found” “jstat: command not found”  
> > I’m using the plugin [java-heap-pcnt.sh](https://github.com/sensu/sensu-community-plugins/blob/master/plugins/java/java-heap-pcnt.sh) from sensu-community [https://github.com/sensu/sensu-community-plugins/tree/master/plugins/java](https://github.com/sensu/sensu-community-plugins/tree/master/plugins/java)
> > 
> > The same is working fine from my sensu-client m/c. I have given sensu user root privilege in case of any sudo issues.  
> > Please help on the same as I’m stuck with this checks execution.
> > 
> > Thanks,  
> > Subhadip

---

<div class="post-metadata">

**Author:** ![jspaleta](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.sensu.io/jspaleta/32/141_2.png) [@jspaleta](https://discourse.sensu.io/u/jspaleta)\
**Post date:** [November 22, 2018, 2:05am UTC](https://discourse.sensu.io/t/sensu-check-for-java-process/132/3 "2018-11-22T02:05:06Z")

</div>


