psyber
Joined: 02 Aug 2005 Posts: 46
|
Posted: Sat Mar 25, 2006 8:42 pm Post subject: Re: Cactid 0.8.6g Beta Request |
|
|
| TheWitness wrote: | IMPORTANT NOTE: Please note that with this version of Cactid, all Data Input Methods that are calling scripts or executables, need to include the full path to the executable. For example, instead of "perl" you would include "/bin/perl". Instead of "php.exe", you would have to include "c:/php.exe".
|
It seems to me the best way to avoid having to hax0r every script (which can be a real pain if you are hopping distributions/platforms) is to make cactid smarter by means of its conf file
perl /usr/bin/perl
php /usr/bin/php
sh /bin/sh
in your scripts you have...
<script_path>perl |path_cacti|/scripts/beer.pl</script_path>
so you match on the first word in script_path /^(w+).*?/ and then replace it with the coresponding path before actually running. It shouldn't break any scripts that have already been modified ("perl" doesn't match "/usr/bin/perl") and would make scripts that haven't been modified work plus thay then become more portable/universal.
I could easily do it in perl, unfortunately my C-foo is at least 10 years old
~p
just my 2 cents (actual worth may vary) |
|