custom script

Andreas Ericsson ae at op5.se
Thu Nov 18 16:21:14 CET 2004


Martinus Nel wrote:
> 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
> 

It doesn't. I just didn't read the script properly. Sorry.

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

And a fair bit more obscure.

> 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.
>>
> 

-- 
Andreas Ericsson                   andreas.ericsson at op5.se
OP5 AB                             www.op5.se
Lead Developer


-------------------------------------------------------
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