sensu checks-error


#1

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


#2

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

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


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 \[ &quot;?" -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


#3

Thanks

···

On Tue, Dec 8, 2015 at 9:16 PM, Kyle Anderson 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

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

 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


#4

Thanks Kyle .

I have been using 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

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 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