> -----Original Message----- > From: [EMAIL PROTECTED] [mailto:nagios-users- > [EMAIL PROTECTED] On Behalf Of Frank Thyes > Sent: Friday, February 17, 2006 1:30 PM > To: [email protected] > Subject: [Nagios-users] check_nrpe 2.0 and simple shell scripting > > > Dear list, > im expieriencing a strange behaviour with check_nrpe in conjunction > with a simple shell script. The script does nothing exceptionally. > The script should check the files which hang around in the > postfic mailq. Sure for this purpose exists a special plugin called > check_mailq, but this plugin just calls the program mailq. Supposed > we have 20k mails in there the command needs a lot of time to > comlete. Its faster to count the files in active and deferred to get > the whole queue. Unfortunately each time i use something like the > example among, the script just return exit code 3, unkonw... > > ACTIVE=`find /var/spool/postfix/active/ -type f | wc -l` > .. > if [ $AMOUNT -ge 0 ]; then > .. > > Writing the output from find to a tmp file doesnt work too > > /usr/bin/find /var/spool/postfix/active/ -type f > /tmp/active > ACTIVE=`cat /tmp/active| wc -l` > > The general functionality has been verified with statical values. > > Any ideas?
Typically mail queues are only readable by root. Have you modified permissions on the queue directory, the script or are you using sudo to run it successfully as a non-root user? The mailq command typically has the required permissions and that's why it's used by check_mailq. Are you exiting with the proper output and exit code that nagios requires? See the Developer Guidelines at http://nagiosplug.sf.net if you haven't already. As to why your script always exits with code 3, we can't tell you since we didn't write the script and you didn't post enough of it to tell anything really useful. If that's not what it should be exiting with, then change the script to return the proper exit code. -- Marc ------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! http://sel.as-us.falkag.net/sel?cmd=lnk&kid3432&bid#0486&dat1642 _______________________________________________ Nagios-users mailing list [email protected] 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
