On 11-11-08 12:07 AM, Tim Serong wrote:
> On 11/08/2011 12:24 PM, mike wrote:
>> So I'm putting together a quick little perl script to monitor HA by
>> running a few crm commands.
>>
>> When I run the script from the command line as root, it works perfectly.
>> However, when I put it in root's crontab I get the following errors show
>> up in root's mail:
>>
>> cibadmin not available, check your installation
>>
>> crm is in root's path (i.e. /usr/sbin) so that shouldn't have any
>> bearing on it. Anyone have any ideas why the following command will work
>> from the command line but not from cron?
>>      $LVS = `/usr/sbin/crm resource status UAT_LVS_Cluster`;
>>
>>    From the command line, it picks up the correct value for use later in
>> the script. From cron, the same script errs out with the msg above.
> /usr/sbin might be in root's path, but it's probably not in the path
> cron is using.  Try adding the following at the top of your crontab:
>
> PATH=/usr/sbin:/usr/bin:/bin
>
> If in doubt, check the X-Cron-Env headers in the email cron sends you.
>
> Regards,
>
> Tim
Give that man a cigar!

Thanks Tim.
_______________________________________________
Linux-HA mailing list
[email protected]
http://lists.linux-ha.org/mailman/listinfo/linux-ha
See also: http://linux-ha.org/ReportingProblems

Reply via email to