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    


Superlinks - Perl support?

 
Post new topic   Reply to topic    Cacti Forum Index -> Plugin General
Author Message
miguel.gr



Joined: 21 Oct 2008
Posts: 4

PostPosted: Fri Oct 31, 2008 6:07 am    Post subject: Superlinks - Perl support? Reply with quote

Hi all,

I created one perl script to create a table using snmp values to keep an inventory of my network equipment (versions, ha status, etc.). Then I tried to include it in one tab in Cacti using superlinks but it seems it doesnt support perl.

Then I created a php page to execute the perl script and present the results but it seems that the superlink php cant execute commands inside the perls script.

To give you an example, I created a very simple .php

test.php
Code:

<?php
exec('/usr/local/share/cacti/plugins/superlinks/content/test.pl');
?>


test.pl
Code:

#!/usr/bin/perl
print "Content-Type: text/plain", "\n\n";
print "Hi there! This is a sample perl program!!!", "\n";
$foo = `touch AAAAAAA.txt`;


I did some tests:
1) I go to the tab created with the "superlinks" plugin, nothing happens
2) If I execute the following /usr/bin/php /usr/local/share/cacti/plugins/superlinks/content/test.php it shows the line "Hi there...." and a file AAAAAAA.txt is created in that folder
3) I commented the variable $foo and I clicked on the tab created with "superlinks" (pointing to the php "test.php") and then I saw the message "Hi there! This....".

With these tests I assume that there is something "wrong" (or something that can be improved) in the "superlinks.php" why it can't handle properly the ` chars used in perl to execute commands.

Did anybody have the same problem as me?

Do anyone know how to fix it?

Thanks in advance.

//Miguel
Back to top
Display posts from previous:   
Post new topic   Reply to topic    Cacti Forum Index -> Plugin General All times are GMT - 5 Hours
Page 1 of 1

 



Powered by phpBB © 2001, 2005 phpBB Group