Re: [Nagios-users] Non obvious 127 plugin error

2011-06-07 Thread Andreas Ericsson
On 06/02/2011 02:43 PM, Craig Stewart wrote:
 All,
 
 SELinux was enabled (DOH!) and has been now disabled.  Didn't fix my
 problem though.  Thanks for that Clint, I don't know HOW many times
 SELinux has bitten me.  Should know by now.
 
 I ran the strace as suggested by Justin and saw THIS little tidbit flash by:
 
 11769 execve(/bin/sh, [sh, -c, /usr/lib/nagios/plugins/check_dig
 -H 142.166.86.18 -l www.xplornet.com -a 142.166.86.46 -w 0.5 -c 1 -t
 5], [/* 189 vars */]) = -1 E2BIG (Argument list too long)
 11751 --- {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=11769,
 si_status=127, si_utime=0, si_stime=0} (Child exited) --
 
 Argument list too long  So, SOMETHING (I suspect the shell) doesn't
 like that many arguments passed.  Well, making progress.
 

Disable environment macros. They will fsck up the memory used for
passing arguments if you have large host- or service-groups. Since
the argument and environment memory space is limited to 128K on
most systems (a hardcoded value that can't be changed with ulimit),
large host or servicegroups can easily consume all of it.

-- 
Andreas Ericsson   andreas.erics...@op5.se
OP5 AB www.op5.se
Tel: +46 8-230225  Fax: +46 8-230231

Considering the successes of the wars on alcohol, poverty, drugs and
terror, I think we should give some serious thought to declaring war
on peace.

--
EditLive Enterprise is the world's most technically advanced content
authoring tool. Experience the power of Track Changes, Inline Image
Editing and ensure content is compliant with Accessibility Checking.
http://p.sf.net/sfu/ephox-dev2dev
___
Nagios-users mailing list
Nagios-users@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


Re: [Nagios-users] Non obvious 127 plugin error

2011-06-03 Thread Justin T Pryzby
The placement of the option may be significant if that option is set
somewhere else in the file, or in another file referenced by
cfg_file or cfg_dir options.

Our nagios-spawned environment has 6K of data, and
NAGIOS_SERVICEGROUPMEMBERS, in particular, is about 1k of that.

Justin

On Thu, Jun 02, 2011 at 02:33:15PM -0300, Craig Stewart wrote:
 This didn't help.  I do have a fairly large config (about 8k hosts and
 12k service checks) but I didn't think it was THAT big.

On Thu, Jun 02, 2011 at 03:53:55PM -0300, Craig Stewart wrote:
 Appending enable_environment_macros=0 to the end of the nagios.cfg
 file as opposed to putting it just after all the file declarations
 appears to have fixed it.  I didn't think it was that sensitive to
 placement in the config file.

On 06/02/2011 02:33 PM, Craig Stewart wrote:
 I ran across that one as well and set the following in nagios.cfg:
 
 enable_environment_macros=0
 
 This didn't help.  I do have a fairly large config (about 8k hosts and
 12k service checks) but I didn't think it was THAT big.

--
Simplify data backup and recovery for your virtual environment with vRanger.
Installation's a snap, and flexible recovery options mean your data is safe,
secure and there when you need it. Discover what all the cheering's about.
Get your free trial download today. 
http://p.sf.net/sfu/quest-dev2dev2 
___
Nagios-users mailing list
Nagios-users@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


Re: [Nagios-users] Non obvious 127 plugin error

2011-06-02 Thread Craig Stewart
All,

SELinux was enabled (DOH!) and has been now disabled.  Didn't fix my
problem though.  Thanks for that Clint, I don't know HOW many times
SELinux has bitten me.  Should know by now.

I ran the strace as suggested by Justin and saw THIS little tidbit flash by:

11769 execve(/bin/sh, [sh, -c, /usr/lib/nagios/plugins/check_dig
-H 142.166.86.18 -l www.xplornet.com -a 142.166.86.46 -w 0.5 -c 1 -t
5], [/* 189 vars */]) = -1 E2BIG (Argument list too long)
11751 --- {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=11769,
si_status=127, si_utime=0, si_stime=0} (Child exited) --

Argument list too long  So, SOMETHING (I suspect the shell) doesn't
like that many arguments passed.  Well, making progress.

By the way, this is a bone stock OS install (Fedora 15 currently) and I
haven't tweaked anything.

Cheers all!

Craig
--
Craig Stewart
Systems Integration Analyst
craig.stew...@corp.xplornet.com
Xplornet - Broadband, Everywhere

On 06/01/2011 05:36 PM, Clint Dilks wrote:
 Hi
 
 Just wondering if SE Linux is disabled on your system?  If not check
 your audit log and see if access to the plugin is being denied
 
 On Thu, Jun 2, 2011 at 8:15 AM, Justin T Pryzby just...@norchemlab.com
 mailto:just...@norchemlab.com wrote:
 
 You can also strace the main nagios process:
 strace -fs999 -e execve -p PID_OF_NAGIOS
 or
 sudo strace -fs999 -e execve -p `ps o pid h -C nagios3 --sort
 start_time |sed q` 21 |grep -Fw execve |grep -Fw check_dig
 
 127 is the return status of the shell when a command isn't found:
 justinp@justinp:~$ asdf; echo $?
 bash: asdf: command not found
 127
 
 man sh = /EXIT STATUS/
 
 Justin
 
 On Wed, Jun 01, 2011 at 04:23:05PM -0300, Craig Stewart wrote:
  Giorgio
 
  As apache user:
 
  bash-4.2$ /usr/lib/nagios/plugins/check_dig -H 72.45.111.250
 tel:72.45.111.250 -l
  www.xplornet.com http://www.xplornet.com -a 142.166.86.46 -w 0.5
 -c 1 -t 5
  DNS OK - 0.096 seconds response time (www.xplornet.com
 http://www.xplornet.com. 864 IN A
  142.166.86.46)|time=0.095553s;0.50;1.00;0.00
 
 
  You understand my confusion.
 
  Craig
 
  Craig Stewart
  Systems Integration Analyst
  craig.stew...@corp.xplornet.com
 mailto:craig.stew...@corp.xplornet.com Tel: (506) 328-1245
 tel:%28506%29%20328-1245 Cell: (506) 425-0111
 tel:%28506%29%20425-0111
  Xplornet - Broadband, Everywhere
 
  On 06/01/2011 04:18 PM, Giorgio Zarrelli wrote:
   Hi,
  
   I'm curious. Please, do a su - as the apache user and execute
 the check
   as that user.
  
   Ciao,
  
   Giorgio
 
 
 
 --
  Simplify data backup and recovery for your virtual environment
 with vRanger.
  Installation's a snap, and flexible recovery options mean your
 data is safe,
  secure and there when you need it. Data protection magic?
  Nope - It's vRanger. Get your free trial download today.
  http://p.sf.net/sfu/quest-sfdev2dev
  ___
  Nagios-users mailing list
  Nagios-users@lists.sourceforge.net
 mailto:Nagios-users@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
 
 
 
 --
 Simplify data backup and recovery for your virtual environment with
 vRanger.
 Installation's a snap, and flexible recovery options mean your data
 is safe,
 secure and there when you need it. Data protection magic?
 Nope - It's vRanger. Get your free trial download today.
 http://p.sf.net/sfu/quest-sfdev2dev
 ___
 Nagios-users mailing list
 Nagios-users@lists.sourceforge.net
 mailto:Nagios-users@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
 
 
 
 -- 
 This message has been scanned for viruses and
 dangerous content by *MailScanner* http://www.mailscanner.info/, and is
 believed to be clean.

--
Simplify data backup and recovery for your virtual environment with vRanger. 
Installation's a snap, and flexible recovery options mean your data is safe,
secure and there when you need it. Data protection magic?
Nope - It's vRanger. Get your free trial download today. 
http://p.sf.net/sfu/quest-sfdev2dev
___

Re: [Nagios-users] Non obvious 127 plugin error

2011-06-02 Thread Giorgio Zarrelli
Check wether your shell is a Dash or a Bash. That means, check where the 
/bin/sh symlink is pointing to.

Ciao,

Giorgio

Il giorno 02/giu/2011, alle ore 14:43, Craig Stewart 
craig.stew...@corp.xplornet.com ha scritto:

 All,
 
 SELinux was enabled (DOH!) and has been now disabled.  Didn't fix my
 problem though.  Thanks for that Clint, I don't know HOW many times
 SELinux has bitten me.  Should know by now.
 
 I ran the strace as suggested by Justin and saw THIS little tidbit flash by:
 
 11769 execve(/bin/sh, [sh, -c, /usr/lib/nagios/plugins/check_dig
 -H 142.166.86.18 -l www.xplornet.com -a 142.166.86.46 -w 0.5 -c 1 -t
 5], [/* 189 vars */]) = -1 E2BIG (Argument list too long)
 11751 --- {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=11769,
 si_status=127, si_utime=0, si_stime=0} (Child exited) --
 
 Argument list too long  So, SOMETHING (I suspect the shell) doesn't
 like that many arguments passed.  Well, making progress.
 
 By the way, this is a bone stock OS install (Fedora 15 currently) and I
 haven't tweaked anything.
 
 Cheers all!
 
 Craig
 --
 Craig Stewart
 Systems Integration Analyst
 craig.stew...@corp.xplornet.com
 Xplornet - Broadband, Everywhere
 
 On 06/01/2011 05:36 PM, Clint Dilks wrote:
 Hi
 
 Just wondering if SE Linux is disabled on your system?  If not check
 your audit log and see if access to the plugin is being denied
 
 On Thu, Jun 2, 2011 at 8:15 AM, Justin T Pryzby just...@norchemlab.com
 mailto:just...@norchemlab.com wrote:
 
You can also strace the main nagios process:
strace -fs999 -e execve -p PID_OF_NAGIOS
or
sudo strace -fs999 -e execve -p `ps o pid h -C nagios3 --sort
start_time |sed q` 21 |grep -Fw execve |grep -Fw check_dig
 
127 is the return status of the shell when a command isn't found:
justinp@justinp:~$ asdf; echo $?
bash: asdf: command not found
127
 
man sh = /EXIT STATUS/
 
Justin
 
On Wed, Jun 01, 2011 at 04:23:05PM -0300, Craig Stewart wrote:
 Giorgio
 
 As apache user:
 
 bash-4.2$ /usr/lib/nagios/plugins/check_dig -H 72.45.111.250
tel:72.45.111.250 -l
 www.xplornet.com http://www.xplornet.com -a 142.166.86.46 -w 0.5
-c 1 -t 5
 DNS OK - 0.096 seconds response time (www.xplornet.com
http://www.xplornet.com. 864 IN A
 142.166.86.46)|time=0.095553s;0.50;1.00;0.00
 
 
 You understand my confusion.
 
 Craig
 
 Craig Stewart
 Systems Integration Analyst
 craig.stew...@corp.xplornet.com
mailto:craig.stew...@corp.xplornet.com Tel: (506) 328-1245
tel:%28506%29%20328-1245 Cell: (506) 425-0111
tel:%28506%29%20425-0111
 Xplornet - Broadband, Everywhere
 
 On 06/01/2011 04:18 PM, Giorgio Zarrelli wrote:
 Hi,
 
 I'm curious. Please, do a su - as the apache user and execute
the check
 as that user.
 
 Ciao,
 
 Giorgio
 
 

 --
 Simplify data backup and recovery for your virtual environment
with vRanger.
 Installation's a snap, and flexible recovery options mean your
data is safe,
 secure and there when you need it. Data protection magic?
 Nope - It's vRanger. Get your free trial download today.
 http://p.sf.net/sfu/quest-sfdev2dev
 ___
 Nagios-users mailing list
 Nagios-users@lists.sourceforge.net
mailto:Nagios-users@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
 
 

 --
Simplify data backup and recovery for your virtual environment with
vRanger.
Installation's a snap, and flexible recovery options mean your data
is safe,
secure and there when you need it. Data protection magic?
Nope - It's vRanger. Get your free trial download today.
http://p.sf.net/sfu/quest-sfdev2dev
___
Nagios-users mailing list
Nagios-users@lists.sourceforge.net
mailto:Nagios-users@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
 
 
 
 -- 
 This message has been scanned for viruses and
 dangerous content by *MailScanner* http://www.mailscanner.info/, and is
 believed to be clean.
 
 --
 Simplify data backup and recovery for your virtual environment with vRanger. 
 Installation's a snap, and flexible recovery options mean your data is safe,
 secure and there when you need it. Data protection magic?
 Nope - It's vRanger. Get your free trial download today. 
 http://p.sf.net/sfu/quest-sfdev2dev
 

Re: [Nagios-users] Non obvious 127 plugin error

2011-06-02 Thread Craig Stewart
Giorgio,

It's bash.

[root@nms tmp]# ls -l /bin/sh
lrwxrwxrwx. 1 root root 4 May 31 11:39 /bin/sh - bash
[root@nms tmp]#

I've been doing a bit of reading and it looks like the maximum arguments
is a kernel setting built at compile time.  I'm having a hard time
wrapping my head around how the check works when run directly and fails
when called by the Nagios process.

I'm starting to wonder if I should point the /bin/sh to something like
csh or some such as a test.

Craig
--
Craig Stewart
Systems Integration Analyst
craig.stew...@corp.xplornet.com Tel: (506) 328-1245 Cell: (506) 425-0111
Xplornet - Broadband, Everywhere

On 06/02/2011 10:43 AM, Giorgio Zarrelli wrote:
 Check wether your shell is a Dash or a Bash. That means, check where the
 /bin/sh symlink is pointing to.
 
 Ciao,
 
 Giorgio
 
 Il giorno 02/giu/2011, alle ore 14:43, Craig Stewart
 craig.stew...@corp.xplornet.com ha scritto:
 
 All,

 SELinux was enabled (DOH!) and has been now disabled.  Didn't fix my
 problem though.  Thanks for that Clint, I don't know HOW many times
 SELinux has bitten me.  Should know by now.

 I ran the strace as suggested by Justin and saw THIS little tidbit
 flash by:

 11769 execve(/bin/sh, [sh, -c, /usr/lib/nagios/plugins/check_dig
 -H 142.166.86.18 -l www.xplornet.com -a 142.166.86.46 -w 0.5 -c 1 -t
 5], [/* 189 vars */]) = -1 E2BIG (Argument list too long)
 11751 --- {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=11769,
 si_status=127, si_utime=0, si_stime=0} (Child exited) --

 Argument list too long  So, SOMETHING (I suspect the shell) doesn't
 like that many arguments passed.  Well, making progress.

 By the way, this is a bone stock OS install (Fedora 15 currently) and I
 haven't tweaked anything.

 Cheers all!

 Craig
 --
 Craig Stewart
 Systems Integration Analyst
 craig.stew...@corp.xplornet.com
 Xplornet - Broadband, Everywhere

 On 06/01/2011 05:36 PM, Clint Dilks wrote:
 Hi

 Just wondering if SE Linux is disabled on your system?  If not check
 your audit log and see if access to the plugin is being denied

 On Thu, Jun 2, 2011 at 8:15 AM, Justin T Pryzby just...@norchemlab.com
 mailto:just...@norchemlab.com wrote:

You can also strace the main nagios process:
strace -fs999 -e execve -p PID_OF_NAGIOS
or
sudo strace -fs999 -e execve -p `ps o pid h -C nagios3 --sort
start_time |sed q` 21 |grep -Fw execve |grep -Fw check_dig

127 is the return status of the shell when a command isn't found:
justinp@justinp:~$ asdf; echo $?
bash: asdf: command not found
127

man sh = /EXIT STATUS/

Justin

On Wed, Jun 01, 2011 at 04:23:05PM -0300, Craig Stewart wrote:
 Giorgio

 As apache user:

 bash-4.2$ /usr/lib/nagios/plugins/check_dig -H 72.45.111.250
tel:72.45.111.250 -l
 www.xplornet.com http://www.xplornet.com -a 142.166.86.46 -w 0.5
-c 1 -t 5
 DNS OK - 0.096 seconds response time (www.xplornet.com
http://www.xplornet.com. 864 IN A
 142.166.86.46)|time=0.095553s;0.50;1.00;0.00


 You understand my confusion.

 Craig

 Craig Stewart
 Systems Integration Analyst
 craig.stew...@corp.xplornet.com
mailto:craig.stew...@corpxplornet.com
 mailto:craig.stew...@corp.xplornet.com Tel: (506) 328-1245
tel:%28506%29%20328-1245 Cell: (506) 425-0111
tel:%28506%29%20425-0111
 Xplornet - Broadband, Everywhere

 On 06/01/2011 04:18 PM, Giorgio Zarrelli wrote:
 Hi,

 I'm curious. Please, do a su - as the apache user and execute
the check
 as that user.

 Ciao,

 Giorgio


   
 --
 Simplify data backup and recovery for your virtual environment
with vRanger.
 Installation's a snap, and flexible recovery options mean your
data is safe,
 secure and there when you need it. Data protection magic?
 Nope - It's vRanger. Get your free trial download today.
 http://p.sf.net/sfu/quest-sfdev2dev
 ___
 Nagios-users mailing list
 Nagios-users@lists.sourceforge.net
mailto:Nagios-users@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


   
 --
Simplify data backup and recovery for your virtual environment with
vRanger.
Installation's a snap, and flexible recovery options mean your data
is safe,
secure and there when you need it. Data protection magic?
Nope - It's vRanger. Get your free trial download today.
http://p.sf.net/sfu/quest-sfdev2dev
___
Nagios-users mailing list
Nagios-users@lists.sourceforge.net
mailto:Nagios-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS 

Re: [Nagios-users] Non obvious 127 plugin error

2011-06-02 Thread Giorgio Zarrelli
We are making guesses, so check ulimits.conf

Ciao,

Giorgio

Il giorno 02/giu/2011, alle ore 15:58, Craig Stewart 
craig.stew...@corp.xplornet.com ha scritto:

 Giorgio,
 
 It's bash.
 
 [root@nms tmp]# ls -l /bin/sh
 lrwxrwxrwx. 1 root root 4 May 31 11:39 /bin/sh - bash
 [root@nms tmp]#
 
 I've been doing a bit of reading and it looks like the maximum arguments
 is a kernel setting built at compile time.  I'm having a hard time
 wrapping my head around how the check works when run directly and fails
 when called by the Nagios process.
 
 I'm starting to wonder if I should point the /bin/sh to something like
 csh or some such as a test.
 
 Craig
 --
 Craig Stewart
 Systems Integration Analyst
 craig.stew...@corp.xplornet.com Tel: (506) 328-1245 Cell: (506) 425-0111
 Xplornet - Broadband, Everywhere
 
 On 06/02/2011 10:43 AM, Giorgio Zarrelli wrote:
 Check wether your shell is a Dash or a Bash. That means, check where the
 /bin/sh symlink is pointing to.
 
 Ciao,
 
 Giorgio
 
 Il giorno 02/giu/2011, alle ore 14:43, Craig Stewart
 craig.stew...@corp.xplornet.com ha scritto:
 
 All,
 
 SELinux was enabled (DOH!) and has been now disabled.  Didn't fix my
 problem though.  Thanks for that Clint, I don't know HOW many times
 SELinux has bitten me.  Should know by now.
 
 I ran the strace as suggested by Justin and saw THIS little tidbit
 flash by:
 
 11769 execve(/bin/sh, [sh, -c, /usr/lib/nagios/plugins/check_dig
 -H 142.166.86.18 -l www.xplornet.com -a 142.166.86.46 -w 0.5 -c 1 -t
 5], [/* 189 vars */]) = -1 E2BIG (Argument list too long)
 11751 --- {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=11769,
 si_status=127, si_utime=0, si_stime=0} (Child exited) --
 
 Argument list too long  So, SOMETHING (I suspect the shell) doesn't
 like that many arguments passed.  Well, making progress.
 
 By the way, this is a bone stock OS install (Fedora 15 currently) and I
 haven't tweaked anything.
 
 Cheers all!
 
 Craig
 --
 Craig Stewart
 Systems Integration Analyst
 craig.stew...@corp.xplornet.com
 Xplornet - Broadband, Everywhere
 
 On 06/01/2011 05:36 PM, Clint Dilks wrote:
 Hi
 
 Just wondering if SE Linux is disabled on your system?  If not check
 your audit log and see if access to the plugin is being denied
 
 On Thu, Jun 2, 2011 at 8:15 AM, Justin T Pryzby just...@norchemlab.com
 mailto:just...@norchemlab.com wrote:
 
   You can also strace the main nagios process:
   strace -fs999 -e execve -p PID_OF_NAGIOS
   or
   sudo strace -fs999 -e execve -p `ps o pid h -C nagios3 --sort
   start_time |sed q` 21 |grep -Fw execve |grep -Fw check_dig
 
   127 is the return status of the shell when a command isn't found:
   justinp@justinp:~$ asdf; echo $?
   bash: asdf: command not found
   127
 
   man sh = /EXIT STATUS/
 
   Justin
 
   On Wed, Jun 01, 2011 at 04:23:05PM -0300, Craig Stewart wrote:
 Giorgio
 
 As apache user:
 
 bash-4.2$ /usr/lib/nagios/plugins/check_dig -H 72.45.111.250
   tel:72.45.111.250 -l
 www.xplornet.com http://www.xplornet.com -a 142.166.86.46 -w 0.5
   -c 1 -t 5
 DNS OK - 0.096 seconds response time (www.xplornet.com
   http://www.xplornet.com. 864 IN A
 142.166.86.46)|time=0.095553s;0.50;1.00;0.00
 
 
 You understand my confusion.
 
 Craig
 
 Craig Stewart
 Systems Integration Analyst
 craig.stew...@corp.xplornet.com
   mailto:craig.stew...@corpxplornet.com
 mailto:craig.stew...@corp.xplornet.com Tel: (506) 328-1245
   tel:%28506%29%20328-1245 Cell: (506) 425-0111
   tel:%28506%29%20425-0111
 Xplornet - Broadband, Everywhere
 
 On 06/01/2011 04:18 PM, Giorgio Zarrelli wrote:
 Hi,
 
 I'm curious. Please, do a su - as the apache user and execute
   the check
 as that user.
 
 Ciao,
 
 Giorgio
 
 
 
 --
 Simplify data backup and recovery for your virtual environment
   with vRanger.
 Installation's a snap, and flexible recovery options mean your
   data is safe,
 secure and there when you need it. Data protection magic?
 Nope - It's vRanger. Get your free trial download today.
 http://p.sf.net/sfu/quest-sfdev2dev
 ___
 Nagios-users mailing list
 Nagios-users@lists.sourceforge.net
   mailto:Nagios-users@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
 
 
 
 --
   Simplify data backup and recovery for your virtual environment with
   vRanger.
   Installation's a snap, and flexible recovery options mean your data
   is safe,
   secure and there when you need it. Data protection magic?
   Nope - It's vRanger. Get your free trial download today.
   http://p.sf.net/sfu/quest-sfdev2dev
   ___
   Nagios-users mailing list
   Nagios-users@lists.sourceforge.net

Re: [Nagios-users] Non obvious 127 plugin error

2011-06-02 Thread Craig Stewart
Giorgio,

I appreciate all your guesses.

As far as the ulimits.conf file was, this system didn't have one!  I did
run the ulimits -a as the nagios user anf got this:

-bash-4.2$ ulimit -a
core file size  (blocks, -c) 0
data seg size   (kbytes, -d) unlimited
scheduling priority (-e) 0
file size   (blocks, -f) unlimited
pending signals (-i) 32100
max locked memory   (kbytes, -l) 64
max memory size (kbytes, -m) unlimited
open files  (-n) 1024
pipe size(512 bytes, -p) 8
POSIX message queues (bytes, -q) 819200
real-time priority  (-r) 0
stack size  (kbytes, -s) 8192
cpu time   (seconds, -t) unlimited
max user processes  (-u) 1024
virtual memory  (kbytes, -v) unlimited
file locks  (-x) unlimited
-bash-4.2$

Craig

Craig Stewart
Systems Integration Analyst
craig.stew...@corp.xplornet.com
Xplornet - Broadband, Everywhere

On 06/02/2011 11:30 AM, Giorgio Zarrelli wrote:
 We are making guesses, so check ulimits.conf
 
 Ciao,
 
 Giorgio
 
 Il giorno 02/giu/2011, alle ore 15:58, Craig Stewart
 craig.stew...@corp.xplornet.com ha scritto:
 
 Giorgio,

 It's bash.

 [root@nms tmp]# ls -l /bin/sh
 lrwxrwxrwx. 1 root root 4 May 31 11:39 /bin/sh - bash
 [root@nms tmp]#

 I've been doing a bit of reading and it looks like the maximum arguments
 is a kernel setting built at compile time.  I'm having a hard time
 wrapping my head around how the check works when run directly and fails
 when called by the Nagios process.

 I'm starting to wonder if I should point the /bin/sh to something like
 csh or some such as a test.

 Craig
 --
 Craig Stewart
 Systems Integration Analyst
 craig.stew...@corp.xplornet.com Tel: (506) 328-1245 Cell: (506) 425-0111
 Xplornet - Broadband, Everywhere

 On 06/02/2011 10:43 AM, Giorgio Zarrelli wrote:
 Check wether your shell is a Dash or a Bash. That means, check where the
 /bin/sh symlink is pointing to.

 Ciao,

 Giorgio

 Il giorno 02/giu/2011, alle ore 14:43, Craig Stewart
 craig.stew...@corp.xplornet.com ha scritto:

 All,

 SELinux was enabled (DOH!) and has been now disabled.  Didn't fix my
 problem though.  Thanks for that Clint, I don't know HOW many times
 SELinux has bitten me.  Should know by now.

 I ran the strace as suggested by Justin and saw THIS little tidbit
 flash by:

 11769 execve(/bin/sh, [sh, -c, /usr/lib/nagios/plugins/check_dig
 -H 142.166.86.18 -l www.xplornet.com -a 142.166.86.46 -w 0.5 -c 1 -t
 5], [/* 189 vars */]) = -1 E2BIG (Argument list too long)
 11751 --- {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=11769,
 si_status=127, si_utime=0, si_stime=0} (Child exited) --

 Argument list too long  So, SOMETHING (I suspect the shell) doesn't
 like that many arguments passed.  Well, making progress.

 By the way, this is a bone stock OS install (Fedora 15 currently) and I
 haven't tweaked anything.

 Cheers all!

 Craig
 --
 Craig Stewart
 Systems Integration Analyst
 craig.stew...@corp.xplornet.com
 Xplornet - Broadband, Everywhere

 On 06/01/2011 05:36 PM, Clint Dilks wrote:
 Hi

 Just wondering if SE Linux is disabled on your system?  If not check
 your audit log and see if access to the plugin is being denied

 On Thu, Jun 2, 2011 at 8:15 AM, Justin T Pryzby just...@norchemlab.com
 mailto:just...@norchemlab.com wrote:

   You can also strace the main nagios process:
   strace -fs999 -e execve -p PID_OF_NAGIOS
   or
   sudo strace -fs999 -e execve -p `ps o pid h -C nagios3 --sort
   start_time |sed q` 21 |grep -Fw execve |grep -Fw check_dig

   127 is the return status of the shell when a command isn't found:
   justinp@justinp:~$ asdf; echo $?
   bash: asdf: command not found
   127

   man sh = /EXIT STATUS/

   Justin

   On Wed, Jun 01, 2011 at 04:23:05PM -0300, Craig Stewart wrote:
 Giorgio

 As apache user:

 bash-4.2$ /usr/lib/nagios/plugins/check_dig -H 72.45.111.250
   tel:72.45.111.250 -l
 www.xplornet.com http://www.xplornet.com -a 142.166.86.46 -w 0.5
   -c 1 -t 5
 DNS OK - 0.096 seconds response time (www.xplornet.com
   http://www.xplornet.com. 864 IN A
 142.166.86.46)|time=0.095553s;0.50;1.00;0.00


 You understand my confusion.

 Craig

 Craig Stewart
 Systems Integration Analyst
 craig.stew...@corp.xplornet.com
   mailto:craig.stew...@corpxplornet.com
 mailto:craig.stew...@corpxplornet.com
 mailto:craig.stew...@corp.xplornet.com Tel: (506) 328-1245
   tel:%28506%29%20328-1245 Cell: (506) 425-0111
   tel:%28506%29%20425-0111
 Xplornet - Broadband, Everywhere

 On 06/01/2011 04:18 PM, Giorgio Zarrelli wrote:
 Hi,

 I'm curious. Please, do a su - as the apache user and execute
   the check
 as that user.

 Ciao,

 Giorgio




 --
 Simplify data backup and recovery for your virtual environment
   with vRanger.
 Installation's a snap, and flexible recovery options mean your
   data is 

Re: [Nagios-users] Non obvious 127 plugin error

2011-06-02 Thread Justin T Pryzby
Ah, I think it may be due to a ngaios setting of
enable_environment_macros:
nagios.sourceforge.net/docs/3_0/configmain.html

Nagios [can] export all sorts of data relating to the state of the
check, and that can be useful, but it seems as if your configuration
is too big or complicated or such to fit.  Do your other checks work?
What if you make their argument list as long as for check_dig?
I think it's possible that some checks are run with bigger inherited
environment than other checks, due to servicegroups and such.  The
execve() E2BIG error is due to a kernel limit on the size of argument
list plus environment.  You could also write a check (or replace the
check_dig command) with something like set
/var/lib/nagios3/nagios-environment or some other nagios-writable
path.  There shouldn't be more than (say) a kilobyte of environment.
It's also possible that you're sourceing something huge like
/etc/bash_completion, but that doesn't explain why it doesn't affect
your user accounts and other nagios checks.  Or you can rerun the
strace with -v to cause the environment to be displayed.

Justin

On Thu, Jun 02, 2011 at 09:43:42AM -0300, Craig Stewart wrote:
 All,
 
 SELinux was enabled (DOH!) and has been now disabled.  Didn't fix my
 problem though.  Thanks for that Clint, I don't know HOW many times
 SELinux has bitten me.  Should know by now.
 
 I ran the strace as suggested by Justin and saw THIS little tidbit flash by:
 
 11769 execve(/bin/sh, [sh, -c, /usr/lib/nagios/plugins/check_dig
 -H 142.166.86.18 -l www.xplornet.com -a 142.166.86.46 -w 0.5 -c 1 -t
 5], [/* 189 vars */]) = -1 E2BIG (Argument list too long)
 11751 --- {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=11769,
 si_status=127, si_utime=0, si_stime=0} (Child exited) --
 
 Argument list too long  So, SOMETHING (I suspect the shell) doesn't
 like that many arguments passed.  Well, making progress.
 
 By the way, this is a bone stock OS install (Fedora 15 currently) and I
 haven't tweaked anything.
 
 Cheers all!
 
 Craig
 --
 Craig Stewart
 Systems Integration Analyst
 craig.stew...@corp.xplornet.com
 Xplornet - Broadband, Everywhere
 
 On 06/01/2011 05:36 PM, Clint Dilks wrote:
  Hi
  
  Just wondering if SE Linux is disabled on your system?  If not check
  your audit log and see if access to the plugin is being denied
  
  On Thu, Jun 2, 2011 at 8:15 AM, Justin T Pryzby just...@norchemlab.com
  mailto:just...@norchemlab.com wrote:
  
  You can also strace the main nagios process:
  strace -fs999 -e execve -p PID_OF_NAGIOS
  or
  sudo strace -fs999 -e execve -p `ps o pid h -C nagios3 --sort
  start_time |sed q` 21 |grep -Fw execve |grep -Fw check_dig
  
  127 is the return status of the shell when a command isn't found:
  justinp@justinp:~$ asdf; echo $?
  bash: asdf: command not found
  127
  
  man sh = /EXIT STATUS/
  
  Justin
  
  On Wed, Jun 01, 2011 at 04:23:05PM -0300, Craig Stewart wrote:
   Giorgio
  
   As apache user:
  
   bash-4.2$ /usr/lib/nagios/plugins/check_dig -H 72.45.111.250
  tel:72.45.111.250 -l
   www.xplornet.com http://www.xplornet.com -a 142.166.86.46 -w 0.5
  -c 1 -t 5
   DNS OK - 0.096 seconds response time (www.xplornet.com
  http://www.xplornet.com. 864 IN A
   142.166.86.46)|time=0.095553s;0.50;1.00;0.00
  
  
   You understand my confusion.
  
   Craig
  
   Craig Stewart
   Systems Integration Analyst
   craig.stew...@corp.xplornet.com
  mailto:craig.stew...@corp.xplornet.com Tel: (506) 328-1245
  tel:%28506%29%20328-1245 Cell: (506) 425-0111
  tel:%28506%29%20425-0111
   Xplornet - Broadband, Everywhere
  
   On 06/01/2011 04:18 PM, Giorgio Zarrelli wrote:
Hi,
   
I'm curious. Please, do a su - as the apache user and execute
  the check
as that user.
   
Ciao,
   
Giorgio
  
  
  
  --
   Simplify data backup and recovery for your virtual environment
  with vRanger.
   Installation's a snap, and flexible recovery options mean your
  data is safe,
   secure and there when you need it. Data protection magic?
   Nope - It's vRanger. Get your free trial download today.
   http://p.sf.net/sfu/quest-sfdev2dev
   ___
   Nagios-users mailing list
   Nagios-users@lists.sourceforge.net
  mailto:Nagios-users@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
  
  
  
  --
  Simplify data backup and recovery for your virtual 

Re: [Nagios-users] Non obvious 127 plugin error

2011-06-02 Thread Craig Stewart
Justin,

I ran across that one as well and set the following in nagios.cfg:

enable_environment_macros=0

This didn't help.  I do have a fairly large config (about 8k hosts and
12k service checks) but I didn't think it was THAT big.

Actually the check_dig command isn't the only one that isn't working.
The service-notify-by-email command also barfs on the output of SOME
checks, not all.  This is simply a printf blah blah blah command
defined in Nagios, not a compiled plug in. The check_ping command works,
but I understand it's just a wrapper for the ping command itself.  A
number of custom bash and perl check commands work, but admittedly I
simply pass the $HOSTNAME$ to them as an argument.

I've rewritten the DNS-Check command so that everything except the
$HOSTNAME$ is hard coded but I don't think this will work.  I'm
admittedly grasping at straws now.  This is what the command line will
look like:

/usr/lib/nagios/plugins/check_dns -s $HOSTADDRESS$ -H www.xplornet.com
-a 142.166.86.46 -w 0.25 -c 5 -t 10

Craig

Craig Stewart
Systems Integration Analyst
craig.stew...@corp.xplornet.com
Xplornet - Broadband, Everywhere

On 06/02/2011 02:07 PM, Justin T Pryzby wrote:
 Ah, I think it may be due to a ngaios setting of
 enable_environment_macros:
 nagios.sourceforge.net/docs/3_0/configmain.html
 
 Nagios [can] export all sorts of data relating to the state of the
 check, and that can be useful, but it seems as if your configuration
 is too big or complicated or such to fit.  Do your other checks work?
 What if you make their argument list as long as for check_dig?
 I think it's possible that some checks are run with bigger inherited
 environment than other checks, due to servicegroups and such.  The
 execve() E2BIG error is due to a kernel limit on the size of argument
 list plus environment.  You could also write a check (or replace the
 check_dig command) with something like set
/var/lib/nagios3/nagios-environment or some other nagios-writable
 path.  There shouldn't be more than (say) a kilobyte of environment.
 It's also possible that you're sourceing something huge like
 /etc/bash_completion, but that doesn't explain why it doesn't affect
 your user accounts and other nagios checks.  Or you can rerun the
 strace with -v to cause the environment to be displayed.
 
 Justin
 

--
Simplify data backup and recovery for your virtual environment with vRanger.
Installation's a snap, and flexible recovery options mean your data is safe,
secure and there when you need it. Discover what all the cheering's about.
Get your free trial download today. 
http://p.sf.net/sfu/quest-dev2dev2 
___
Nagios-users mailing list
Nagios-users@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


Re: [Nagios-users] Non obvious 127 plugin error

2011-06-02 Thread Craig Stewart
All,

Just an update:

Appending enable_environment_macros=0 to the end of the nagios.cfg
file as opposed to putting it just after all the file declarations
appears to have fixed it.  I didn't think it was that sensitive to
placement in the config file.

Thanks all!

Craig
--
Craig Stewart
Systems Integration Analyst
craig.stew...@corp.xplornet.com Tel: (506) 328-1245 Cell: (506) 425-0111
Xplornet - Broadband, Everywhere

On 06/02/2011 02:33 PM, Craig Stewart wrote:
 Justin,
 
 I ran across that one as well and set the following in nagios.cfg:
 
 enable_environment_macros=0
 
 This didn't help.  I do have a fairly large config (about 8k hosts and
 12k service checks) but I didn't think it was THAT big.

--
Simplify data backup and recovery for your virtual environment with vRanger.
Installation's a snap, and flexible recovery options mean your data is safe,
secure and there when you need it. Discover what all the cheering's about.
Get your free trial download today. 
http://p.sf.net/sfu/quest-dev2dev2 
___
Nagios-users mailing list
Nagios-users@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


Re: [Nagios-users] Non obvious 127 plugin error

2011-06-01 Thread Martin Hugo
Hi Craig,

Not sure if it will help you but when I had a check reporting a similar plug-in 
error that ran just fine from the terminal I removed the password variable from 
the comd def and hard-coded the pwd in there instead.  Worked for me.

Martin T. Hugo
Network Administrator
Hilliard City Schools
614-921-7102 (Ph)
614-771-7243 (Fax)

-Original Message-
From: Craig Stewart [mailto:craig.stew...@corp.xplornet.com] 
Sent: Wednesday, June 01, 2011 10:48 AM
To: nagios-users@lists.sourceforge.net
Subject: [Nagios-users] Non obvious 127 plugin error

Good day folks,

I've spent the better part of a week using Google and combing forums for
an answer to this question without much luck.  First the specs:

Nagios version 3.2.3
Nagios and associated plugins installed on CentOS 5.6 and Fedora 15
servers via package management (i.e. yum)

I have a couple plugins that simply won't execute.  One of which is the
check_dig command.  I'll use this for an example.

From the commands.cfg file for Nagios:

define command{
command_namecheck_dns
command_line/usr/lib/nagios/plugins/check_dig -H $HOSTADDRESS$ -l
$ARG1$ -a $ARG2$ -w $ARG3$ -c $ARG4$ -t $ARG5$
}

From the Nagios log file:

[1306863226] Warning: Return code of 127 for check of service
'DNS-Check' on host 'TS-TOR-DNS-1' was out of bounds. Make sure the
plugin you're trying to run actually exists.


Okay, first to see if it exists:

[root@nms ~]# locate check_dig
/usr/lib/nagios/plugins/check_dig
[root@nms ~]#

Ownership and permissions check:

[root@nms ~]# ls -l /usr/lib/nagios/plugins/check_dig
-rwxr-xr-x. 1 nagios nagios 43292 Mar 23 15:42
/usr/lib/nagios/plugins/check_dig
[root@nms ~]#

Try running it as root:
[root@nms ~]# /usr/lib/nagios/plugins/check_dig *BLANKED* -l *BLANKED*
-a *BLANKED* -c 5 -w 0.25
DNS OK - 0.005 seconds response time (*BLANKED*. 900 IN A
*BLANKED*)|time=0.004967s;0.25;5.00;0.00

So it works as root.  Now to try as Nagios user:
[root@nms ~]# su - nagios
-bash-4.2$ /usr/lib/nagios/plugins/check_dig *BLANKED* -l *BLANKED* -a
*BLANKED* -c 5 -w 0.25
DNS OK - 0.005 seconds response time (*BLANKED*. 900 IN A
*BLANKED*)|time=0.004967s;0.25;5.00;0.00

It works as the Nagios user as well.

So, I'm sure you can see my confusion.  The plugin exists and is
executable for a user on the system, but even when called directly as
opposed to using the $USER1$ macro, the Nagios process can't run it.

Any thoughts anyone?

Cheers!

Craig

-- 
Craig Stewart
Systems Integration Analyst
craig.stew...@corp.xplornet.com
Xplornet - Broadband, Everywhere

--
Simplify data backup and recovery for your virtual environment with vRanger. 
Installation's a snap, and flexible recovery options mean your data is safe,
secure and there when you need it. Data protection magic?
Nope - It's vRanger. Get your free trial download today. 
http://p.sf.net/sfu/quest-sfdev2dev
___
Nagios-users mailing list
Nagios-users@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



--
Simplify data backup and recovery for your virtual environment with vRanger. 
Installation's a snap, and flexible recovery options mean your data is safe,
secure and there when you need it. Data protection magic?
Nope - It's vRanger. Get your free trial download today. 
http://p.sf.net/sfu/quest-sfdev2dev
___
Nagios-users mailing list
Nagios-users@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


Re: [Nagios-users] Non obvious 127 plugin error

2011-06-01 Thread Giorgio Zarrelli
Please,

Switch on debug and paste here the final command

Ciao,

Giorgio

Il giorno 01/giu/2011, alle ore 16:47, Craig Stewart 
craig.stew...@corp.xplornet.com ha scritto:

 Good day folks,
 
 I've spent the better part of a week using Google and combing forums for
 an answer to this question without much luck.  First the specs:
 
 Nagios version 3.2.3
 Nagios and associated plugins installed on CentOS 5.6 and Fedora 15
 servers via package management (i.e. yum)
 
 I have a couple plugins that simply won't execute.  One of which is the
 check_dig command.  I'll use this for an example.
 
 From the commands.cfg file for Nagios:
 
 define command{
command_namecheck_dns
command_line/usr/lib/nagios/plugins/check_dig -H $HOSTADDRESS$ -l
 $ARG1$ -a $ARG2$ -w $ARG3$ -c $ARG4$ -t $ARG5$
}
 
 From the Nagios log file:
 
 [1306863226] Warning: Return code of 127 for check of service
 'DNS-Check' on host 'TS-TOR-DNS-1' was out of bounds. Make sure the
 plugin you're trying to run actually exists.
 
 
 Okay, first to see if it exists:
 
 [root@nms ~]# locate check_dig
 /usr/lib/nagios/plugins/check_dig
 [root@nms ~]#
 
 Ownership and permissions check:
 
 [root@nms ~]# ls -l /usr/lib/nagios/plugins/check_dig
 -rwxr-xr-x. 1 nagios nagios 43292 Mar 23 15:42
 /usr/lib/nagios/plugins/check_dig
 [root@nms ~]#
 
 Try running it as root:
 [root@nms ~]# /usr/lib/nagios/plugins/check_dig *BLANKED* -l *BLANKED*
 -a *BLANKED* -c 5 -w 0.25
 DNS OK - 0.005 seconds response time (*BLANKED*. 900 IN A
 *BLANKED*)|time=0.004967s;0.25;5.00;0.00
 
 So it works as root.  Now to try as Nagios user:
 [root@nms ~]# su - nagios
 -bash-4.2$ /usr/lib/nagios/plugins/check_dig *BLANKED* -l *BLANKED* -a
 *BLANKED* -c 5 -w 0.25
 DNS OK - 0.005 seconds response time (*BLANKED*. 900 IN A
 *BLANKED*)|time=0.004967s;0.25;5.00;0.00
 
 It works as the Nagios user as well.
 
 So, I'm sure you can see my confusion.  The plugin exists and is
 executable for a user on the system, but even when called directly as
 opposed to using the $USER1$ macro, the Nagios process can't run it.
 
 Any thoughts anyone?
 
 Cheers!
 
 Craig
 
 -- 
 Craig Stewart
 Systems Integration Analyst
 craig.stew...@corp.xplornet.com
 Xplornet - Broadband, Everywhere
 
 --
 Simplify data backup and recovery for your virtual environment with vRanger. 
 Installation's a snap, and flexible recovery options mean your data is safe,
 secure and there when you need it. Data protection magic?
 Nope - It's vRanger. Get your free trial download today. 
 http://p.sf.net/sfu/quest-sfdev2dev
 ___
 Nagios-users mailing list
 Nagios-users@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

--
Simplify data backup and recovery for your virtual environment with vRanger. 
Installation's a snap, and flexible recovery options mean your data is safe,
secure and there when you need it. Data protection magic?
Nope - It's vRanger. Get your free trial download today. 
http://p.sf.net/sfu/quest-sfdev2dev
___
Nagios-users mailing list
Nagios-users@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


Re: [Nagios-users] Non obvious 127 plugin error

2011-06-01 Thread Craig Stewart
Giorgio,

Here's the final command:

[1306952706.565337] [2048.1] [pid=3753]   Done.  Final output:
'/usr/lib/nagios/plugins/check_dig -H 72.45.111.250 -l www.xplornet.com
-a 142.166.86.46 -w 0.5 -c 1 -t 5'

I assume that's what you meant?

I'm also seeing this in the debug log:

[1306952721.202757] [016.1] [pid=3753] HOST: TS-WIN-DNS-1, SERVICE:
DNS-Check, CHECK TYPE: Active, OPTIONS: 0, SCHEDULED: Yes, RESCHEDULE:
Yes, EXITED OK: Yes, RETURN CODE: 127, OUTPUT: (null)



Craig Stewart
Systems Integration Analyst
craig.stew...@corp.xplornet.com
Xplornet - Broadband, Everywhere

On 06/01/2011 02:20 PM, Giorgio Zarrelli wrote:
 Please,
 
 Switch on debug and paste here the final command
 
 Ciao,
 
 Giorgio
 
 Il giorno 01/giu/2011, alle ore 16:47, Craig Stewart
 craig.stew...@corp.xplornet.com ha scritto:
 
 Good day folks,

 I've spent the better part of a week using Google and combing forums for
 an answer to this question without much luck.  First the specs:

 Nagios version 3.2.3
 Nagios and associated plugins installed on CentOS 5.6 and Fedora 15
 servers via package management (i.e. yum)

 I have a couple plugins that simply won't execute.  One of which is the
 check_dig command.  I'll use this for an example.

 From the commands.cfg file for Nagios:

 define command{
command_namecheck_dns
command_line/usr/lib/nagios/plugins/check_dig -H $HOSTADDRESS$ -l
 $ARG1$ -a $ARG2$ -w $ARG3$ -c $ARG4$ -t $ARG5$
}

 From the Nagios log file:

 [1306863226] Warning: Return code of 127 for check of service
 'DNS-Check' on host 'TS-TOR-DNS-1' was out of bounds. Make sure the
 plugin you're trying to run actually exists.


 Okay, first to see if it exists:

 [root@nms ~]# locate check_dig
 /usr/lib/nagios/plugins/check_dig
 [root@nms ~]#

 Ownership and permissions check:

 [root@nms ~]# ls -l /usr/lib/nagios/plugins/check_dig
 -rwxr-xr-x. 1 nagios nagios 43292 Mar 23 15:42
 /usr/lib/nagios/plugins/check_dig
 [root@nms ~]#

 Try running it as root:
 [root@nms ~]# /usr/lib/nagios/plugins/check_dig *BLANKED* -l *BLANKED*
 -a *BLANKED* -c 5 -w 0.25
 DNS OK - 0.005 seconds response time (*BLANKED*. 900 IN A
 *BLANKED*)|time=0.004967s;0.25;5.00;0.00

 So it works as root.  Now to try as Nagios user:
 [root@nms ~]# su - nagios
 -bash-4.2$ /usr/lib/nagios/plugins/check_dig *BLANKED* -l *BLANKED* -a
 *BLANKED* -c 5 -w 0.25
 DNS OK - 0.005 seconds response time (*BLANKED*. 900 IN A
 *BLANKED*)|time=0.004967s;0.25;5.00;0.00

 It works as the Nagios user as well.

 So, I'm sure you can see my confusion.  The plugin exists and is
 executable for a user on the system, but even when called directly as
 opposed to using the $USER1$ macro, the Nagios process can't run it.

 Any thoughts anyone?

 Cheers!

 Craig

 --
 Craig Stewart
 Systems Integration Analyst
 craig.stew...@corp.xplornet.com
 Xplornet - Broadband, Everywhere


 --
 Simplify data backup and recovery for your virtual environment with
 vRanger.
 Installation's a snap, and flexible recovery options mean your data is
 safe,
 secure and there when you need it. Data protection magic?
 Nope - It's vRanger. Get your free trial download today.
 http://p.sf.net/sfu/quest-sfdev2dev
 ___
 Nagios-users mailing list
 Nagios-users@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
 
 --
 Simplify data backup and recovery for your virtual environment with vRanger.
 Installation's a snap, and flexible recovery options mean your data is safe,
 secure and there when you need it. Data protection magic?
 Nope - It's vRanger. Get your free trial download today.
 http://p.sf.net/sfu/quest-sfdev2dev
 ___
 Nagios-users mailing list
 Nagios-users@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
 
 --
 This message has been scanned by MailScanner
 

--
Simplify data backup and recovery for your virtual environment with vRanger. 
Installation's a snap, and flexible recovery options mean your data is safe,
secure and there when you need it. Data protection magic?
Nope - It's vRanger. Get your free trial download today. 
http://p.sf.net/sfu/quest-sfdev2dev
___
Nagios-users mailing list
Nagios-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin 

Re: [Nagios-users] Non obvious 127 plugin error

2011-06-01 Thread Giorgio Zarrelli
Hi,

I'm curious. Please, do a su - as the apache user and execute the check as that 
user.

Ciao,

Giorgio

Il giorno 01/giu/2011, alle ore 20:50, Craig Stewart 
craig.stew...@corp.xplornet.com ha scritto:

 Giorgio,
 
 Here's the final command:
 
 [1306952706.565337] [2048.1] [pid=3753]   Done.  Final output:
 '/usr/lib/nagios/plugins/check_dig -H 72.45.111.250 -l www.xplornet.com
 -a 142.166.86.46 -w 0.5 -c 1 -t 5'
 
 I assume that's what you meant?
 
 I'm also seeing this in the debug log:
 
 [1306952721.202757] [016.1] [pid=3753] HOST: TS-WIN-DNS-1, SERVICE:
 DNS-Check, CHECK TYPE: Active, OPTIONS: 0, SCHEDULED: Yes, RESCHEDULE:
 Yes, EXITED OK: Yes, RETURN CODE: 127, OUTPUT: (null)
 
 
 
 Craig Stewart
 Systems Integration Analyst
 craig.stew...@corp.xplornet.com
 Xplornet - Broadband, Everywhere
 
 On 06/01/2011 02:20 PM, Giorgio Zarrelli wrote:
 Please,
 
 Switch on debug and paste here the final command
 
 Ciao,
 
 Giorgio
 
 Il giorno 01/giu/2011, alle ore 16:47, Craig Stewart
 craig.stew...@corp.xplornet.com ha scritto:
 
 Good day folks,
 
 I've spent the better part of a week using Google and combing forums for
 an answer to this question without much luck.  First the specs:
 
 Nagios version 3.2.3
 Nagios and associated plugins installed on CentOS 5.6 and Fedora 15
 servers via package management (i.e. yum)
 
 I have a couple plugins that simply won't execute.  One of which is the
 check_dig command.  I'll use this for an example.
 
 From the commands.cfg file for Nagios:
 
 define command{
   command_namecheck_dns
   command_line/usr/lib/nagios/plugins/check_dig -H $HOSTADDRESS$ -l
 $ARG1$ -a $ARG2$ -w $ARG3$ -c $ARG4$ -t $ARG5$
   }
 
 From the Nagios log file:
 
 [1306863226] Warning: Return code of 127 for check of service
 'DNS-Check' on host 'TS-TOR-DNS-1' was out of bounds. Make sure the
 plugin you're trying to run actually exists.
 
 
 Okay, first to see if it exists:
 
 [root@nms ~]# locate check_dig
 /usr/lib/nagios/plugins/check_dig
 [root@nms ~]#
 
 Ownership and permissions check:
 
 [root@nms ~]# ls -l /usr/lib/nagios/plugins/check_dig
 -rwxr-xr-x. 1 nagios nagios 43292 Mar 23 15:42
 /usr/lib/nagios/plugins/check_dig
 [root@nms ~]#
 
 Try running it as root:
 [root@nms ~]# /usr/lib/nagios/plugins/check_dig *BLANKED* -l *BLANKED*
 -a *BLANKED* -c 5 -w 0.25
 DNS OK - 0.005 seconds response time (*BLANKED*. 900 IN A
 *BLANKED*)|time=0.004967s;0.25;5.00;0.00
 
 So it works as root.  Now to try as Nagios user:
 [root@nms ~]# su - nagios
 -bash-4.2$ /usr/lib/nagios/plugins/check_dig *BLANKED* -l *BLANKED* -a
 *BLANKED* -c 5 -w 0.25
 DNS OK - 0.005 seconds response time (*BLANKED*. 900 IN A
 *BLANKED*)|time=0.004967s;0.25;5.00;0.00
 
 It works as the Nagios user as well.
 
 So, I'm sure you can see my confusion.  The plugin exists and is
 executable for a user on the system, but even when called directly as
 opposed to using the $USER1$ macro, the Nagios process can't run it.
 
 Any thoughts anyone?
 
 Cheers!
 
 Craig
 
 --
 Craig Stewart
 Systems Integration Analyst
 craig.stew...@corp.xplornet.com
 Xplornet - Broadband, Everywhere
 
 
 --
 Simplify data backup and recovery for your virtual environment with
 vRanger.
 Installation's a snap, and flexible recovery options mean your data is
 safe,
 secure and there when you need it. Data protection magic?
 Nope - It's vRanger. Get your free trial download today.
 http://p.sf.net/sfu/quest-sfdev2dev
 ___
 Nagios-users mailing list
 Nagios-users@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
 
 --
 Simplify data backup and recovery for your virtual environment with vRanger.
 Installation's a snap, and flexible recovery options mean your data is safe,
 secure and there when you need it. Data protection magic?
 Nope - It's vRanger. Get your free trial download today.
 http://p.sf.net/sfu/quest-sfdev2dev
 ___
 Nagios-users mailing list
 Nagios-users@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
 
 --
 This message has been scanned by MailScanner
 

--
Simplify data backup and recovery for your virtual environment with vRanger. 
Installation's a snap, and flexible recovery options mean your data is safe,
secure and there when you need it. Data protection magic?
Nope - It's vRanger. Get your free trial download 

Re: [Nagios-users] Non obvious 127 plugin error

2011-06-01 Thread Craig Stewart
Giorgio

As apache user:

bash-4.2$ /usr/lib/nagios/plugins/check_dig -H 72.45.111.250 -l
www.xplornet.com -a 142.166.86.46 -w 0.5 -c 1 -t 5
DNS OK - 0.096 seconds response time (www.xplornet.com. 864 IN A
142.166.86.46)|time=0.095553s;0.50;1.00;0.00


You understand my confusion.

Craig

Craig Stewart
Systems Integration Analyst
craig.stew...@corp.xplornet.com Tel: (506) 328-1245 Cell: (506) 425-0111
Xplornet - Broadband, Everywhere

On 06/01/2011 04:18 PM, Giorgio Zarrelli wrote:
 Hi,
 
 I'm curious. Please, do a su - as the apache user and execute the check
 as that user.
 
 Ciao,
 
 Giorgio

--
Simplify data backup and recovery for your virtual environment with vRanger. 
Installation's a snap, and flexible recovery options mean your data is safe,
secure and there when you need it. Data protection magic?
Nope - It's vRanger. Get your free trial download today. 
http://p.sf.net/sfu/quest-sfdev2dev
___
Nagios-users mailing list
Nagios-users@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


Re: [Nagios-users] Non obvious 127 plugin error

2011-06-01 Thread Craig Stewart
Matin,

Not quite sure what you mean.  As far as I know I don't have a password
variable in my command definition.

Craig
--
Craig Stewart
Systems Integration Analyst
craig.stew...@corp.xplornet.com Tel: (506) 328-1245 Cell: (506) 425-0111
Xplornet - Broadband, Everywhere

On 06/01/2011 02:11 PM, Martin Hugo wrote:
 Hi Craig,
 
 Not sure if it will help you but when I had a check reporting a similar
 plug-in error that ran just fine from the terminal I removed the
 password variable from the comd def and hard-coded the pwd in there
 instead.  Worked for me.
 
 Martin T. Hugo
 Network Administrator
 Hilliard City Schools
 614-921-7102 (Ph)
 614-771-7243 (Fax)
 
 -Original Message-
 From: Craig Stewart [mailto:craig.stew...@corpxplornet.com
 mailto:craig.stew...@corp.xplornet.com]
 Sent: Wednesday, June 01, 2011 10:48 AM
 To: nagios-users@lists.sourceforge.net
 Subject: [Nagios-users] Non obvious 127 plugin error
 
 Good day folks,
 
 I've spent the better part of a week using Google and combing forums for
 an answer to this question without much luck.  First the specs:
 
 Nagios version 3.2.3
 Nagios and associated plugins installed on CentOS 5.6 and Fedora 15
 servers via package management (i.e. yum)
 
 I have a couple plugins that simply won't execute.  One of which is the
 check_dig command.  I'll use this for an example.
 
From the commands.cfg file for Nagios:
 
 define command{
 command_namecheck_dns
 command_line/usr/lib/nagios/plugins/check_dig -H
 $HOSTADDRESS$ -l
 $ARG1$ -a $ARG2$ -w $ARG3$ -c $ARG4$ -t $ARG5$
 }
 
From the Nagios log file:
 
 [1306863226] Warning: Return code of 127 for check of service
 'DNS-Check' on host 'TS-TOR-DNS-1' was out of bounds. Make sure the
 plugin you're trying to run actually exists.
 
 
 Okay, first to see if it exists:
 
 [root@nms ~]# locate check_dig
 /usr/lib/nagios/plugins/check_dig
 [root@nms ~]#
 
 Ownership and permissions check:
 
 [root@nms ~]# ls -l /usr/lib/nagios/plugins/check_dig
 -rwxr-xr-x. 1 nagios nagios 43292 Mar 23 15:42
 /usr/lib/nagios/plugins/check_dig
 [root@nms ~]#
 
 Try running it as root:
 [root@nms ~]# /usr/lib/nagios/plugins/check_dig *BLANKED* -l *BLANKED*
 -a *BLANKED* -c 5 -w 0.25
 DNS OK - 0.005 seconds response time (*BLANKED*. 900 IN A
 *BLANKED*)|time=0.004967s;0.25;5.00;0.00
 
 So it works as root.  Now to try as Nagios user:
 [root@nms ~]# su - nagios
 -bash-4.2$ /usr/lib/nagios/plugins/check_dig *BLANKED* -l *BLANKED* -a
 *BLANKED* -c 5 -w 0.25
 DNS OK - 0.005 seconds response time (*BLANKED*. 900 IN A
 *BLANKED*)|time=0.004967s;0.25;5.00;0.00
 
 It works as the Nagios user as well.
 
 So, I'm sure you can see my confusion.  The plugin exists and is
 executable for a user on the system, but even when called directly as
 opposed to using the $USER1$ macro, the Nagios process can't run it.
 
 Any thoughts anyone?
 
 Cheers!
 
 Craig
 
 --
 Craig Stewart
 Systems Integration Analyst
 craig.stew...@corp.xplornet.com
 Xplornet - Broadband, Everywhere
 
 --
 Simplify data backup and recovery for your virtual environment with vRanger.
 Installation's a snap, and flexible recovery options mean your data is safe,
 secure and there when you need it. Data protection magic?
 Nope - It's vRanger. Get your free trial download today.
 http://p.sf.net/sfu/quest-sfdev2dev
 ___
 Nagios-users mailing list
 Nagios-users@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
 
 
 
 --
 Simplify data backup and recovery for your virtual environment with vRanger.
 Installation's a snap, and flexible recovery options mean your data is safe,
 secure and there when you need it. Data protection magic?
 Nope - It's vRanger. Get your free trial download today.
 http://p.sf.net/sfu/quest-sfdev2dev
 ___
 Nagios-users mailing list
 Nagios-users@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
 
 --
 This message has been scanned by MailScanner
 

--
Simplify data backup and recovery for your virtual environment with vRanger. 
Installation's a snap, and flexible recovery options mean your data is safe,
secure and there when you need it. Data protection magic?
Nope - It's vRanger. Get your free trial download today. 
http://p.sf.net/sfu/quest-sfdev2dev
___

Re: [Nagios-users] Non obvious 127 plugin error

2011-06-01 Thread Giorgio Zarrelli
I understand your confusion. Undortunately I will be om holiday until monday 
and I won't be able to use a real computer for some tests.

Anyway, I will think about it.

Ciao,

Giorgio

Il giorno 01/giu/2011, alle ore 21:23, Craig Stewart 
craig.stew...@corp.xplornet.com ha scritto:

 Giorgio
 
 As apache user:
 
 bash-4.2$ /usr/lib/nagios/plugins/check_dig -H 72.45.111.250 -l
 www.xplornet.com -a 142.166.86.46 -w 0.5 -c 1 -t 5
 DNS OK - 0.096 seconds response time (www.xplornet.com. 864 IN A
 142.166.86.46)|time=0.095553s;0.50;1.00;0.00
 
 
 You understand my confusion.
 
 Craig
 
 Craig Stewart
 Systems Integration Analyst
 craig.stew...@corp.xplornet.com Tel: (506) 328-1245 Cell: (506) 425-0111
 Xplornet - Broadband, Everywhere
 
 On 06/01/2011 04:18 PM, Giorgio Zarrelli wrote:
 Hi,
 
 I'm curious. Please, do a su - as the apache user and execute the check
 as that user.
 
 Ciao,
 
 Giorgio

--
Simplify data backup and recovery for your virtual environment with vRanger. 
Installation's a snap, and flexible recovery options mean your data is safe,
secure and there when you need it. Data protection magic?
Nope - It's vRanger. Get your free trial download today. 
http://p.sf.net/sfu/quest-sfdev2dev
___
Nagios-users mailing list
Nagios-users@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


Re: [Nagios-users] Non obvious 127 plugin error

2011-06-01 Thread Justin T Pryzby
You can also strace the main nagios process:
strace -fs999 -e execve -p PID_OF_NAGIOS
or
sudo strace -fs999 -e execve -p `ps o pid h -C nagios3 --sort start_time |sed 
q` 21 |grep -Fw execve |grep -Fw check_dig

127 is the return status of the shell when a command isn't found:
justinp@justinp:~$ asdf; echo $?
bash: asdf: command not found
127

man sh = /EXIT STATUS/

Justin

On Wed, Jun 01, 2011 at 04:23:05PM -0300, Craig Stewart wrote:
 Giorgio
 
 As apache user:
 
 bash-4.2$ /usr/lib/nagios/plugins/check_dig -H 72.45.111.250 -l
 www.xplornet.com -a 142.166.86.46 -w 0.5 -c 1 -t 5
 DNS OK - 0.096 seconds response time (www.xplornet.com. 864 IN A
 142.166.86.46)|time=0.095553s;0.50;1.00;0.00
 
 
 You understand my confusion.
 
 Craig
 
 Craig Stewart
 Systems Integration Analyst
 craig.stew...@corp.xplornet.com Tel: (506) 328-1245 Cell: (506) 425-0111
 Xplornet - Broadband, Everywhere
 
 On 06/01/2011 04:18 PM, Giorgio Zarrelli wrote:
  Hi,
  
  I'm curious. Please, do a su - as the apache user and execute the check
  as that user.
  
  Ciao,
  
  Giorgio
 
 --
 Simplify data backup and recovery for your virtual environment with vRanger. 
 Installation's a snap, and flexible recovery options mean your data is safe,
 secure and there when you need it. Data protection magic?
 Nope - It's vRanger. Get your free trial download today. 
 http://p.sf.net/sfu/quest-sfdev2dev
 ___
 Nagios-users mailing list
 Nagios-users@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
 

--
Simplify data backup and recovery for your virtual environment with vRanger. 
Installation's a snap, and flexible recovery options mean your data is safe,
secure and there when you need it. Data protection magic?
Nope - It's vRanger. Get your free trial download today. 
http://p.sf.net/sfu/quest-sfdev2dev
___
Nagios-users mailing list
Nagios-users@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


Re: [Nagios-users] Non obvious 127 plugin error

2011-06-01 Thread Clint Dilks
Hi

Just wondering if SE Linux is disabled on your system?  If not check your
audit log and see if access to the plugin is being denied

On Thu, Jun 2, 2011 at 8:15 AM, Justin T Pryzby just...@norchemlab.comwrote:

 You can also strace the main nagios process:
 strace -fs999 -e execve -p PID_OF_NAGIOS
 or
 sudo strace -fs999 -e execve -p `ps o pid h -C nagios3 --sort start_time
 |sed q` 21 |grep -Fw execve |grep -Fw check_dig

 127 is the return status of the shell when a command isn't found:
 justinp@justinp:~$ asdf; echo $?
 bash: asdf: command not found
 127

 man sh = /EXIT STATUS/

 Justin

 On Wed, Jun 01, 2011 at 04:23:05PM -0300, Craig Stewart wrote:
  Giorgio
 
  As apache user:
 
  bash-4.2$ /usr/lib/nagios/plugins/check_dig -H 72.45.111.250 -l
  www.xplornet.com -a 142.166.86.46 -w 0.5 -c 1 -t 5
  DNS OK - 0.096 seconds response time (www.xplornet.com. 864 IN A
  142.166.86.46)|time=0.095553s;0.50;1.00;0.00
 
 
  You understand my confusion.
 
  Craig
 
  Craig Stewart
  Systems Integration Analyst
  craig.stew...@corp.xplornet.com Tel: (506) 328-1245 Cell: (506) 425-0111
  Xplornet - Broadband, Everywhere
 
  On 06/01/2011 04:18 PM, Giorgio Zarrelli wrote:
   Hi,
  
   I'm curious. Please, do a su - as the apache user and execute the check
   as that user.
  
   Ciao,
  
   Giorgio
 
 
 --
  Simplify data backup and recovery for your virtual environment with
 vRanger.
  Installation's a snap, and flexible recovery options mean your data is
 safe,
  secure and there when you need it. Data protection magic?
  Nope - It's vRanger. Get your free trial download today.
  http://p.sf.net/sfu/quest-sfdev2dev
  ___
  Nagios-users mailing list
  Nagios-users@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
 


 --
 Simplify data backup and recovery for your virtual environment with
 vRanger.
 Installation's a snap, and flexible recovery options mean your data is
 safe,
 secure and there when you need it. Data protection magic?
 Nope - It's vRanger. Get your free trial download today.
 http://p.sf.net/sfu/quest-sfdev2dev
 ___
 Nagios-users mailing list
 Nagios-users@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

--
Simplify data backup and recovery for your virtual environment with vRanger. 
Installation's a snap, and flexible recovery options mean your data is safe,
secure and there when you need it. Data protection magic?
Nope - It's vRanger. Get your free trial download today. 
http://p.sf.net/sfu/quest-sfdev2dev___
Nagios-users mailing list
Nagios-users@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