[Nagiosplug-help] Nagios 2 writes wrong number of files

Petr Hudeček pheek at seznam.cz
Tue Feb 24 09:39:03 CET 2009


When I run it manually, I see corectly OK number and Critical number. When I run it Nagios, it writes corect only Critical number and OK number is 0.

Log:
Feb 24 09:05:59 ubuntu nrpe[3080]: Handling the connection...
Feb 24 09:05:59 ubuntu nrpe[3080]: Host is asking for command 'check_nger' to be run...
Feb 24 09:05:59 ubuntu nrpe[3080]: Running command: /usr/lib/nagios/plugins/check_nger
Feb 24 09:05:59 ubuntu nrpe[3080]: Command completed with return code 2 and output: CRITICAL, number of files is 1563 
Feb 24 09:05:59 ubuntu nrpe[3080]: Return Code: 2, Output: CRITICAL, number of files is 1563
Feb 24 09:05:59 ubuntu nrpe[3080]: Connection from 10.0.10.32 closed.

This write is, when change script - soubory=`find /etc/ -follow -type f | wc -l`

and 

Feb 24 09:00:59 ubuntu nrpe[2813]: Handling the connection...
Feb 24 09:00:59 ubuntu nrpe[2813]: Host is asking for command 'check_nger' to be run...
Feb 24 09:00:59 ubuntu nrpe[2813]: Running command: /usr/lib/nagios/plugins/check_nger
Feb 24 09:00:59 ubuntu nrpe[2813]: Command completed with return code 0 and output: OK, number of files is 0 \@
Feb 24 09:00:59 ubuntu nrpe[2813]: Return Code: 0, Output: OK, number of files is 0 \@
Feb 24 09:00:59 ubuntu nrpe[2813]: Connection from 10.0.10.32 closed.

write is, when change script - soubory=`find /home/yeti/Maildir/ -follow -type f | wc -l`

Yes,  user nagios doesn't have permission to go to Maildir/.  How I make ?

Sorry for me english, I am from czech.

> ------------ Původní zpráva ------------
> Od: Olivier 'Babar' Raginel <nagios at babar.us>
> Předmět: Re: [Nagiosplug-help] Nagios 2 writes wrong number of files
> Datum: 24.2.2009 09:17:45
> ----------------------------------------
> On Tue, Feb 24, 2009 at 09:12:22AM +0100, Petr Hudeček wrote:
> > I have problem with my script, here it is: 
> > soubory=`find /home/yeti/Maildir/ -follow -type f | wc -l`
> 
> > When I run it manually, it writes concrete number of files. But when 
> > Nagios runs it, there is always written 0. Could anyone help me? 
> 
> Have you tried running your script as the nagios user?
> Most probably, the user nagios doesn't have permission to go to your 
> Maildir/, which is probably something sane enough to do (you don't want 
> the world to read your mail, do you?)
> 
> -- 
> Babar.
> 
> ------------------------------------------------------------------------------
> Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
> -OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
> -Strategies to boost innovation and cut costs with open source participation
> -Receive a $600 discount off the registration fee with the source code: SFAD
> http://p.sf.net/sfu/XcvMzF8H
> _______________________________________________
> Nagiosplug-help mailing list
> Nagiosplug-help at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/nagiosplug-help
> ::: Please include plugins version (-v) and OS when reporting any issue. 
> ::: Messages without supporting info will risk being sent to /dev/null
> 
> 
> 




More information about the Help mailing list