Cacti (home)ForumsRepositoryDocumentation
Cacti: offical forums and support  

 FAQFAQ   SearchSearch   MemberlistMemberlist    RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in    


Cactid 0.8.6g Beta Request
Goto page Previous  1, 2
 
Post new topic   Reply to topic    Cacti Forum Index -> Announcements
Author Message
psyber



Joined: 02 Aug 2005
Posts: 46

PostPosted: Sat Mar 25, 2006 8:42 pm    Post subject: Re: Cactid 0.8.6g Beta Request Reply with quote

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)
Back to top
Display posts from previous:   
Post new topic   Reply to topic    Cacti Forum Index -> Announcements All times are GMT - 5 Hours
Goto page Previous  1, 2
Page 2 of 2

 



Powered by phpBB © 2001, 2005 phpBB Group