[mrtg] AW: Re: Problems with mrtg and external script in cfg
"Helmert, Jörg"
Joerg.Helmert at EINSTEINet.de
Tue Jun 4 11:29:01 MEST 2002
Hi,
Target[chgeduld]: `c:/mrtg/cfg/sanitized/chgeduld.cmd`
works for me.
If it plays a role:
I use Active Perl from Active State.
In the perldoc which comes with Active Perl, you find hints
regarding use of slashes for paths in MS-DOS/Windows
<A=C=T=I=V=E=S=T=A=T=E=P=E=R=L=D=O=C>
Why can't I use ``C:\temp\foo'' in DOS paths?
What doesn't `C:\temp\foo.exe` work?
Whoops! You just put a tab and a formfeed into that filename!
Remember that within double quoted strings (``like\this''),
the backslash is an escape character. The full list of these is in
Quote and Quote-like Operators in the perlop manpage.
Unsurprisingly, you don't have a file called ``c:(tab)emp(formfeed)oo''
or ``c:(tab)emp(formfeed)oo.exe'' on your legacy DOS filesystem.
Either single-quote your strings, or (preferably) use forward slashes.
Since all DOS and Windows versions since something like MS-DOS 2.0 or
so have treated / and \ the same in a path, you might as well use the
one that doesn't clash with Perl--or the POSIX shell, ANSI C and C++,
awk, Tcl, Java, or Python, just to mention a few.
POSIX paths are more portable, too.
</A=C=T=I=V=E=S=T=A=T=E=P=E=R=L=D=O=C>
I suggest the use of slashes instead of backslashes in perlscripts
for pathnames whenever possible.
For me its "best practice" now.
bye,
Joerg Helmert
-----Ursprüngliche Nachricht-----
Von: Alex van den Bogaerdt [mailto:alex at slot.hollandcasino.nl]
Gesendet: Dienstag, 4. Juni 2002 09:51
An: jimjones at oct.net
Cc: mrtg at list.ee.ethz.ch
Betreff: [mrtg] Re: Problems with mrtg and external script in cfg
Jim Jones, Jr. wrote:
> The things that I am unsure of are to do with paths and win2k and mrtg...
> within the config, should i use the drive:\path\ ? or just the \path\ ?
AFAIK you can use forward slashes (and you have to use forward slashes
only) or you use backslashes. If you use backslashes, you need to tell
perl that you want a real backslahs --> you need to escape a backslash.
I think something like 'C:\\path\\to\\mrtg' will work.
Maybe you also need to escape the colon, I don't know.
There are some sites that specialize in mrtg on windows. I think
there are a few pointers on faq.mrtg.org
HTH
--
__________________________________________________________________
/ alex at slot.hollandcasino.nl alex at ergens.op.het.net \
| work private |
| My employer is capable of speaking therefore I speak only for myself |
+----------------------------------------------------------------------+
| Technical questions sent directly to me will be nuked. Use the list. |
+----------------------------------------------------------------------+
| http://faq.mrtg.org/ |
| http://rrdtool.eu.org --> tutorial |
+----------------------------------------------------------------------+
--
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
--
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