[SunHELP] Running Sar out of cron

Edward Chase echase at postoffice.providence.edu
Fri Apr 12 15:26:36 CDT 2002


I don't have an exact answer for you, but I have an idea what might be 
happening...

I'd bet it's got something to do with environment variables that aren't 
getting set when the cron job runs.

The way I'd approach it is to look at the environment variables that are 
set when logged in and then create a script to set these variables (or a 
subset) and run sar, then cron up the script.

You could also cron up an env and see what it shows for environment 
variables to compare with the environment variables when logged on.

Let us know how you make out.


At 03:02 PM 4/12/2002 -0500, Ben Ricker wrote:
>I have run into this weird problem when running sar on a Solaris 8 box
>(5.8 Generic_108528-09 sun4u sparc SUNW,UltraAX-i2). I am running it out
>of root's cron (I ran into permission issues running it out of sys'
>cron). Here is the line in cron:
>
>0       *       *       *       0-6     /usr/lib/sa/sa1
>20,40   8-17    *       *       1-5     /usr/lib/sa/sa1
>5       18      *       *       1-5     /usr/lib/sa/sa2 -s 8:00 -e 18:01 
>-i 1200 -A
>
>Here is the error logged to /var/cron/log:
>
>! cron audit problem. job failed (/usr/lib/sa/sa1) for user root Fri Apr 
>12 14:40:00 2002
> >  CMD: /usr/lib/sa/sa1
>
>I can run it as root from command line, but as you can see, the error is
>MOST unhelpful. I have setup sar on a number of Solaris boxes and had no
>problem. Any suggestions?
>
>One more thing: I tried running it from a script using 'su' to root but
>the error was the same.
>
>Ben Ricker
>Web Security System Administrator
>Wellinx.com
>_______________________________________________
>SunHELP maillist  -  SunHELP at sunhelp.org
>http://www.sunhelp.org/mailman/listinfo/sunhelp



More information about the SunHELP mailing list