Hallo, I have a simple shell script (for sending an e-mail) and I need to create a Cacti tab (superlink) with it. The idea is to have a link in the Cacti tab and when you press the link, the shell script is executed. Can someone help me do that?
Thank you!
Shell script as Cacti Tab
Moderators: Developers, Moderators
- Howie
- Cacti Guru User
- Posts: 5508
- Joined: Thu Sep 16, 2004 5:53 am
- Location: United Kingdom
- Contact:
Re: Shell script as Cacti Tab
This is what CGI is. Google around for "CGI shell script", but the basic version would be:akalaidjieva wrote:Hallo, I have a simple shell script (for sending an e-mail) and I need to create a Cacti tab (superlink) with it. The idea is to have a link in the Cacti tab and when you press the link, the shell script is executed. Can someone help me do that?
Thank you!
Code: Select all
#!/bin/sh
echo "Content-type: text/html"
echo
# your script here - output goes to the browser
I'd do it in php with the mail() function personally, but if you already have the script...
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!)
-
- Posts: 5
- Joined: Thu Nov 12, 2009 5:47 am
- Howie
- Cacti Guru User
- Posts: 5508
- Joined: Thu Sep 16, 2004 5:53 am
- Location: United Kingdom
- Contact:
Care to post the script? Or some of it? Or the contents of the httpd error log?akalaidjieva wrote:OK, I rewrote the script with the PHP mail() function and it works perfectly when executed from the console. But when I add it as a Cacti tab nothing happens- just a blank page and no e-mail.
Can anyone give me a hint what I am doing wrong?
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!)
-
- Posts: 5
- Joined: Thu Nov 12, 2009 5:47 am
<?php
$txt = "Test e-mail\nPlease ignore";
mail("akalaidzhieva@abv.bg","Test",$txt);
?>
As simple as that but I don't know what to do with it
$txt = "Test e-mail\nPlease ignore";
mail("akalaidzhieva@abv.bg","Test",$txt);
?>
As simple as that but I don't know what to do with it
Who is online
Users browsing this forum: No registered users and 5 guests