[mrtg] Re: Problems with customized perl scripts in MRTG

Larry Sheldon lsheldon at creighton.edu
Sun Aug 5 23:08:18 MEST 2001


> I am sure of it now.... when MRTG is started by the cron, then the perl scripts are giving zeros. Why o why???
> As user root it is ok.... as the cron does is as user root it is NOT OK!!!
> 
> Help?? 

SROT (Sheldon's Rules of Thumb) (First rule, move thumb before swinging hammer
at nail) say in this situation  (where things "work" at the command line
and "don't work" from "cron) the problem is almost certainly due to a
failure to account for the fact that "cron" has practically no "environment"
and in particular, practically no path.

If you depend on something being set some way in particular, set it that
way in in your cron-run script.  Keep in mind that calling another
script (like /etc/profile) will probably not have the desired effect unless
you use the construct:

. /etc/profile

or in some other way make it run in the main cron-run shell.
--
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
.                                                                       .
- L. F. (Larry) Sheldon, Jr.                                            -
. Unix Systems and Network Administration                               .
- Creighton University Computer Center-Old Gym                          -
. 2500 California Plaza                                                 .
- Omaha, Nebraska, U.S.A.  68178       Two identifying characteristics  -
. lsheldon at creighton.edu                  of System Administrators:     .
- 402 280-2254 (work)                Infallibility, and the ability to  -
. 402 681-4726 (cellular)               learn from their mistakes.      .
- 402 332-4622 (residence)                                              -
. http://www.creighton.edu/~lsheldon    Adapted from Stephen Pinker     .
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-

--
Unsubscribe mailto:mrtg-request at list.ee.ethz.ch?subject=unsubscribe
Archive     http://www.ee.ethz.ch/~slist/mrtg
FAQ         http://faq.mrtg.org    Homepage     http://www.mrtg.org
WebAdmin    http://www.ee.ethz.ch/~slist/lsg2.cgi



More information about the mrtg mailing list