NRPE return values

Marc Powell marc at ena.com
Wed Mar 18 16:29:02 CET 2009


On Mar 18, 2009, at 9:45 AM, Assaf Flatto wrote:
> if [ "$1" = "2598" ]; then
>
> W=`lsof -Pn -i | grep squid | grep ESTABLISHED | grep -v 127.0.0.1 |  
> grep 2598 | wc -l`
>

A couple possible problems here...
	- use full paths to every program (lsof, grep, wc). The environment  
available to the script when run by NRPE may not have the $PATH you  
expect.
	- are you sure that lsof is returning results you expect when run by  
a non-root user? From my own testing, running '/usr/sbin/lsof -Pn -i'  
as root returns results but when run as a normal user, nothing is  
returned.
> echo "Number of connections is "$W
>
> exit 0
>
> fi
>
>
> from the messages log :
>
> Running command: /usr/lib/nagios/plugins/check_squid_citrix.sh 2598
>
> Mar 18 14:18:46 host nrpe[3869]: Command completed with return code  
> 3 and output: Number of connections is 0
>

Your script is exiting with an exit code of 3. In the script above you  
always exit with a 0. Why the difference? Under what conditions does  
your script 'exit 3'?

> Manual execution on tartget server:
>
> sh -x /usr/lib/nagios/plugins/check_squid_citrix.sh 2598
>

As the NRPE user?

--
Marc


------------------------------------------------------------------------------
Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are
powering Web 2.0 with engaging, cross-platform capabilities. Quickly and
easily build your RIAs with Flex Builder, the Eclipse(TM)based development
software that enables intelligent coding and step-through debugging.
Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com
_______________________________________________
Nagios-users mailing list
Nagios-users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue. 
::: Messages without supporting info will risk being sent to /dev/null





More information about the Users mailing list