# sensu checks-error

**URL:** <https://discourse.sensu.io/t/sensu-checks-error/514>\
**Category:** Sensu Classic (EOL)\
**Created:** [December 8, 2015, 9:10am UTC](https://discourse.sensu.io/t/sensu-checks-error/514 "2015-12-08T09:10:19Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Hari\_krishna\_kumar](https://avatars.discourse-cdn.com/v4/letter/h/a9a28c/32.png) [@Hari\_krishna\_kumar](https://discourse.sensu.io/u/Hari_krishna_kumar)\
**Post date:** [December 8, 2015, 9:10am UTC](https://discourse.sensu.io/t/sensu-checks-error/514/1 "2015-12-08T09:10:19Z")

</div>

Hi ,I had wrote shell script for checking the port status fro tomcat,mysql,etc.

below the script in client machine:

#!/bin/bash

value=(netstat -tuplen | grep 3306) if ["?" -eq 0]  
then  
echo “mysql running on port 3306”

else  
echo “port not open”  
fi

When executed from client ,it is working as expected.

But when Sensu Server is checking the checks ,it is throwing alert and output as below:

“(Not all processes could be identified, non-owned process info will not be shown, you would have to be root to see it all.) tomcat running on port 8080”.

Sensu server,rabbitmq,client ,redis are running on four different Linux boxes

Request anyone to help me out.

thanks in advance

---

<div class="post-metadata">

**Author:** ![Kyle\_Anderson](https://avatars.discourse-cdn.com/v4/letter/k/e5b9ba/32.png) [@Kyle\_Anderson](https://discourse.sensu.io/u/Kyle_Anderson)\
**Post date:** [December 8, 2015, 3:46pm UTC](https://discourse.sensu.io/t/sensu-checks-error/514/2 "2015-12-08T15:46:02Z")

</div>

Netstat requires root privs if you have -p in the netstat invocation.

Additionally you should exit the proper return codes upon OK and Critical:  
[https://sensuapp.org/docs/latest/getting-started-with-checks#what-are-sensu-checks](https://sensuapp.org/docs/latest/getting-started-with-checks#what-are-sensu-checks)

Longer term I recommend using existing solutions for this ilke the  
sensu-plugin here:

> <https://github.com/sensu-plugins/sensu-plugins-network-checks/blob/master/bin/check-ports.rb>

Or nagios' check\_tcp script.

> **···**
>
> On Tue, Dec 8, 2015 at 1:10 AM, kumar kittu \<dvrkittu@gmail.com\> wrote:
> 
> > Hi ,I had wrote shell script for checking the port status fro  
> > tomcat,mysql,etc.
> > 
> > below the script in client machine:  
> > #!/bin/bash
> > 
> > value=$(netstat -tuplen | grep 3306)  
> > if ["$?" -eq 0]  
> > then  
> > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo "mysql running on port 3306"  
> > else  
> > &nbsp;&nbsp;&nbsp;echo "port not open"  
> > fi
> > 
> > When executed from client ,it is working as expected.  
> > But when Sensu Server is checking the checks ,it is throwing alert and  
> > output as below:
> > 
> > "(Not all processes could be identified, non-owned process info will not be  
> > shown, you would have to be root to see it all.) tomcat running on port  
> > 8080".
> > 
> > Sensu server,rabbitmq,client ,redis are running on four different Linux  
> > boxes
> > 
> > Request anyone to help me out.  
> > thanks in advance

---

<div class="post-metadata">

**Author:** ![Hari\_krishna\_kumar](https://avatars.discourse-cdn.com/v4/letter/h/a9a28c/32.png) [@Hari\_krishna\_kumar](https://discourse.sensu.io/u/Hari_krishna_kumar)\
**Post date:** [December 9, 2015, 7:19am UTC](https://discourse.sensu.io/t/sensu-checks-error/514/3 "2015-12-09T07:19:26Z")

</div>

Thanks

> **···**
>
> On Tue, Dec 8, 2015 at 9:16 PM, Kyle Anderson [kyle@xkyle.com](mailto:kyle@xkyle.com) wrote:
> 
> > Netstat requires root privs if you have -p in the netstat invocation.
> > 
> > Additionally you should exit the proper return codes upon OK and Critical:
> > 
> > [https://sensuapp.org/docs/latest/getting-started-with-checks#what-are-sensu-checks](https://sensuapp.org/docs/latest/getting-started-with-checks#what-are-sensu-checks)
> > 
> > Longer term I recommend using existing solutions for this ilke the
> > 
> > sensu-plugin here:
> > 
> > [https://github.com/sensu-plugins/sensu-plugins-network-checks/blob/master/bin/check-ports.rb](https://github.com/sensu-plugins/sensu-plugins-network-checks/blob/master/bin/check-ports.rb)
> > 
> > Or nagios’ check\_tcp script.
> > 
> > On Tue, Dec 8, 2015 at 1:10 AM, kumar kittu [dvrkittu@gmail.com](mailto:dvrkittu@gmail.com) wrote:
> > 
> > > Hi ,I had wrote shell script for checking the port status fro
> > 
> > > tomcat,mysql,etc.
> > 
> > > 
> > 
> > > below the script in client machine:
> > 
> > > #!/bin/bash
> > 
> > > 
> > 
> > > value=$(netstat -tuplen | grep 3306)
> > 
> > > if [“$?” -eq 0]
> > 
> > > then
> > 
> > > ```
> > > echo "mysql running on port 3306"
> > > 
> > > ```
> > 
> > > else
> > 
> > > echo “port not open”
> > 
> > > fi
> > 
> > > 
> > 
> > > When executed from client ,it is working as expected.
> > 
> > > But when Sensu Server is checking the checks ,it is throwing alert and
> > 
> > > output as below:
> > 
> > > 
> > 
> > > "(Not all processes could be identified, non-owned process info will not be
> > 
> > > shown, you would have to be root to see it all.) tomcat running on port
> > 
> > > 8080".
> > 
> > > 
> > 
> > > Sensu server,rabbitmq,client ,redis are running on four different Linux
> > 
> > > boxes
> > 
> > > 
> > 
> > > Request anyone to help me out.
> > 
> > > thanks in advance

---

<div class="post-metadata">

**Author:** ![Hari\_krishna\_kumar](https://avatars.discourse-cdn.com/v4/letter/h/a9a28c/32.png) [@Hari\_krishna\_kumar](https://discourse.sensu.io/u/Hari_krishna_kumar)\
**Post date:** [January 29, 2016, 6:09am UTC](https://discourse.sensu.io/t/sensu-checks-error/514/4 "2016-01-29T06:09:36Z")

</div>

Thanks Kyle .

I have been using [https://github.com/sensu-plugins/sensu-plugins-network-checks/blob/master/bin/check-ports.rb](https://github.com/sensu-plugins/sensu-plugins-network-checks/blob/master/bin/check-ports.rb) and working fine in uchiwa dashboard.But the same in graphite is not working ,as output is not in graphite format.Could you please suggest how can this be overcome in graphite.Please suggest

> **···**
>
> On Tuesday, December 8, 2015 at 9:16:03 PM UTC+5:30, Kyle Anderson wrote:
> 
> > Netstat requires root privs if you have -p in the netstat invocation.
> > 
> > Additionally you should exit the proper return codes upon OK and Critical:  
> > [https://sensuapp.org/docs/latest/getting-started-with-checks#what-are-sensu-checks](https://sensuapp.org/docs/latest/getting-started-with-checks#what-are-sensu-checks)
> > 
> > Longer term I recommend using existing solutions for this ilke the  
> > sensu-plugin here:  
> > [https://github.com/sensu-plugins/sensu-plugins-network-checks/blob/master/bin/check-ports.rb](https://github.com/sensu-plugins/sensu-plugins-network-checks/blob/master/bin/check-ports.rb)
> > 
> > Or nagios’ check\_tcp script.
> > 
> > On Tue, Dec 8, 2015 at 1:10 AM, kumar kittu [dvrk...@gmail.com](mailto:dvrk...@gmail.com) wrote:
> > 
> > > Hi ,I had wrote shell script for checking the port status fro  
> > > tomcat,mysql,etc.
> > > 
> > > below the script in client machine:  
> > > #!/bin/bash
> > > 
> > > value=$(netstat -tuplen | grep 3306)  
> > > if [“$?” -eq 0]  
> > > then  
> > > echo “mysql running on port 3306”  
> > > else  
> > > echo “port not open”  
> > > fi
> > > 
> > > When executed from client ,it is working as expected.  
> > > But when Sensu Server is checking the checks ,it is throwing alert and  
> > > output as below:
> > > 
> > > “(Not all processes could be identified, non-owned process info will not be  
> > > shown, you would have to be root to see it all.) tomcat running on port  
> > > 8080”.
> > > 
> > > Sensu server,rabbitmq,client ,redis are running on four different Linux  
> > > boxes
> > > 
> > > Request anyone to help me out.  
> > > thanks in advance
