custom script

Martinus Nel martinus.nel at scarceskills.com
Thu Nov 18 16:15:26 CET 2004


Andreas,

What I don't understand is how it differs from what's in the script at 
the moment:

# Check if file exists.
if [ ! -f $LOG_FILE ]
then
        echo "File does not exist."
        exit $CRITICAL
fi

Apart from the fact that your is 4 lines less :-)

Martinus.

Andreas Ericsson wrote:

> Martinus Nel wrote:
>
>> Andreas,
>>
>> Thank you.  Yes, my bad I tested with root.  Normally users such as 
>> nagios is set on /bin/false...
>>
>> I don't fully understand the line you suggested:
>>
>> [ -f "$LOG_FILE" ] || (echo "CRITICAL - $LOG_FILE is not a file"; 
>> exit 2)
>>
>
> It will exit with state critical if the specified file is not, in 
> fact, a file. You should add it before grep turns up and throws 
> hard-to-debug errors.
>

-- 
Martinus Nel
System Administrator
Scarce Skills Ltd.
http://www.scarceskills.com
Tel: +44 (0) 1633 225461

---------------------------------------------------------------------------
DISCLAIMER
This e-mail message and any attachments are confidential and may also be a
privileged communication. It is intended solely for the person(s) to whom it
is addressed. If you are not the intended addressee of the message you must
take no action based on it. Please reply to this message to let us know you
received it in error and also delete the message from your system.
Internet e-mails are not necessarily secure and you should be mindful of
this when e-mailing us.

The contents of an attachment to this e-mail may contain software viruses
which could damage your own computer system. Whilst we have taken every
reasonable precaution to minimise this risk, we cannot accept liability for
any damage which you sustain as a result of software viruses. You should
carry out your own virus checks before opening the attachment.
---------------------------------------------------------------------------




-------------------------------------------------------
This SF.Net email is sponsored by: InterSystems CACHE
FREE OODBMS DOWNLOAD - A multidimensional database that combines
robust object and relational technologies, making it a perfect match
for Java, C++,COM, XML, ODBC and JDBC. www.intersystems.com/match8
_______________________________________________
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