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: Select all
<?php
exec('/usr/local/share/cacti/plugins/superlinks/content/test.pl');
?>
Code: Select all
#!/usr/bin/perl
print "Content-Type: text/plain", "\n\n";
print "Hi there! This is a sample perl program!!!", "\n";
$foo = `touch AAAAAAA.txt`;
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