# Check-process.sh gives a different result in the server and in uchiwa

**URL:** https://discourse.sensu.io/t/check-process-sh-gives-a-different-result-in-the-server-and-in-uchiwa/559
**Category:** Sensu Classic (EOL)
**Created:** [March 17, 2016, 2:11pm UTC](https://discourse.sensu.io/t/check-process-sh-gives-a-different-result-in-the-server-and-in-uchiwa/559 "2016-03-17T14:11:23Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Ruben\_Ortiz](https://avatars.discourse-cdn.com/v4/letter/r/a9a28c/32.png) [@Ruben\_Ortiz](https://discourse.sensu.io/u/Ruben_Ortiz)
#### Post date: [March 17, 2016, 2:11pm UTC](https://discourse.sensu.io/t/check-process-sh-gives-a-different-result-in-the-server-and-in-uchiwa/559/1 "2016-03-17T14:11:23Z")

</div>

Hi

I’ve noticed that in one of my servers that I monitoring with Sensu gives me an error detecting a process:

{“timestamp”:“2016-03-17T15:07:38.062126+0100”,“level”:“info”,“message”:“publishing check result”,“payload”:{“client”:“[xxxx.kimsufi.com](http://xxxx.kimsufi.com)”,“check”:{“name”:“cron”,“issued”:1458223705,“command”:"/etc/sensu/plugins/system/check-process.sh -p cron",“executed”:1458223658,“duration”:0.061,“output”:“CRITICAL - process cron does not exist\n”,“status”:2}}}

``

but If I run same script in the server the sh file shows another result!

[root@xxxx ~]# /etc/sensu/plugins/system/check-process.sh -p cron  
PROCESS OK - cron

``

Server is a CentOS 6.X

Why this happens? Can I fix this in someway?

Thanks!

---

<div class="post-metadata">

### Author: ![Joel\_Smith1](https://avatars.discourse-cdn.com/v4/letter/j/a698b9/32.png) [@Joel\_Smith1](https://discourse.sensu.io/u/Joel_Smith1)
#### Post date: [March 17, 2016, 3:17pm UTC](https://discourse.sensu.io/t/check-process-sh-gives-a-different-result-in-the-server-and-in-uchiwa/559/2 "2016-03-17T15:17:56Z")

</div>

I notice that when you manually run the check you are doing so as root. Does it make a difference if you run it as the sensu user? One difference is that the sensu user doesn’t have a shell. I use the ruby version, so can’t directly compare.

> **···**
>
> On Thursday, 17 March 2016 14:11:23 UTC, Rubén Ortiz wrote:
> 
> > Hi
> 
> > I’ve noticed that in one of my servers that I monitoring with Sensu gives me an error detecting a process:
> 
> > 
> 
> > {“timestamp”:“2016-03-17T15:07:38.062126+0100”,“level”:“info”,“message”:“publishing check result”,“payload”:{“client”:“[xxxx.kimsufi.com](http://xxxx.kimsufi.com)”,“check”:{“name”:“cron”,“issued”:1458223705,“command”:“/etc/sensu/plugins/system/check-process.sh -p cron”,“executed”:1458223658,“duration”:0.061,“output”:“CRITICAL - process cron does not exist\n”,“status”:2}}}
> 
> > ``
> 
> > 
> 
> > but If I run same script in the server the sh file shows another result!
> 
> > 
> 
> > [root@xxxx ~]# /etc/sensu/plugins/system/check-process.sh -p cron  
> > PROCESS OK - cron
> 
> > ``
> 
> > 
> 
> > 
> 
> > Server is a CentOS 6.X
> 
> > 
> 
> > Why this happens? Can I fix this in someway?
> 
> > 
> 
> > Thanks!

---

<div class="post-metadata">

### Author: ![Ruben\_Ortiz](https://avatars.discourse-cdn.com/v4/letter/r/a9a28c/32.png) [@Ruben\_Ortiz](https://discourse.sensu.io/u/Ruben_Ortiz)
#### Post date: [March 18, 2016, 7:34am UTC](https://discourse.sensu.io/t/check-process-sh-gives-a-different-result-in-the-server-and-in-uchiwa/559/3 "2016-03-18T07:34:43Z")

</div>

Hi!

that’s the point … I could not check as sensu because sensu does not have a valid bash. Anyway…it’s weird, I have other Centos 6x same setup and don’t show this kind of wrong result.

Can I don something to purge the client? Or I don’t know, something to reset sensu server at some level?

: /

Thanks!

> **···**
>
> On Thursday, March 17, 2016 at 4:17:56 PM UTC+1, [joel....@nhs.net](mailto:joel....@nhs.net) wrote:
> 
> > I notice that when you manually run the check you are doing so as root. Does it make a difference if you run it as the sensu user? One difference is that the sensu user doesn’t have a shell. I use the ruby version, so can’t directly compare.
> > 
> > On Thursday, 17 March 2016 14:11:23 UTC, Rubén Ortiz wrote:
> > 
> > > Hi
> 
> > > I’ve noticed that in one of my servers that I monitoring with Sensu gives me an error detecting a process:
> 
> > >
> 
> > > {“timestamp”:“2016-03-17T15:07:38.062126+0100”,“level”:“info”,“message”:“publishing check result”,“payload”:{“client”:“[xxxx.kimsufi.com](http://xxxx.kimsufi.com)”,“check”:{“name”:“cron”,“issued”:1458223705,“command”:“/etc/sensu/plugins/system/check-process.sh -p cron”,“executed”:1458223658,“duration”:0.061,“output”:“CRITICAL - process cron does not exist\n”,“status”:2}}}
> 
> > > ``
> 
> > >
> 
> > > but If I run same script in the server the sh file shows another result!
> 
> > >
> 
> > > [root@xxxx ~]# /etc/sensu/plugins/system/check-process.sh -p cron  
> > > PROCESS OK - cron
> 
> > > ``
> 
> > >
> 
> > >
> 
> > > Server is a CentOS 6.X
> 
> > >
> 
> > > Why this happens? Can I fix this in someway?
> 
> > >
> 
> > > Thanks!
