hi
this sounds faq, but i didnt find any pointers, so if someone cares to comment....
im migrating to cacti - good job to all who code it, and in my older system ive got a bunch of perl scripts doing some monitoring and output-ing to a html to view by NOC staff.
how do i go about using the links plugin, so that the output of the links tab will be whats generated by the perl script - in fact the links tab will run the perl script, to avoid having to recode the stuff to php.
thanks
running perl script from links plugin
Moderators: Developers, Moderators
- Howie
- Cacti Guru User
- Posts: 5508
- Joined: Thu Sep 16, 2004 5:53 am
- Location: United Kingdom
- Contact:
Re: running perl script from links plugin
If the perl scripts just generate some HTML, then you should be able to use the PHP popen() function to capture the output of that script, and print it inside the PHP code...mpb wrote:hi
this sounds faq, but i didnt find any pointers, so if someone cares to comment....
im migrating to cacti - good job to all who code it, and in my older system ive got a bunch of perl scripts doing some monitoring and output-ing to a html to view by NOC staff.
how do i go about using the links plugin, so that the output of the links tab will be whats generated by the perl script - in fact the links tab will run the perl script, to avoid having to recode the stuff to php.
thanks
Code: Select all
<?php
$handle = popen('/path/to/your/script', 'r');
while(!feof($handle))
{
$read = fread($handle, 2096);
echo $read;
}
pclose($handle);
?>
Obviously, you are skipping all the nice framework that Cacti provides by using your old script this way, but I guess there's a good reason
Weathermap 0.98a is out! & QuickTree 1.0. Superlinks is over there now (and built-in to Cacti 1.x).
Some Other Cacti tweaks, including strip-graphs, icons and snmp/netflow stuff.
(Let me know if you have UK DevOps or Network Ops opportunities, too!)
Some Other Cacti tweaks, including strip-graphs, icons and snmp/netflow stuff.
(Let me know if you have UK DevOps or Network Ops opportunities, too!)
Who is online
Users browsing this forum: No registered users and 2 guests