, 1 April 1989
Ty Coon, President of Vice
This General Public License does not permit incorporating your program into
proprietary programs. If your program is a subroutine library, you may
consider it more useful to permit linking proprietary applications with the
library. If this is what you want to do, use the GNU Library General
Public License instead of this License.
mrtg/defaultacl 0000644 0001750 0001001 00000000032 07635465000 012632 0 ustar Jrn Kein noconfig=0
allow_config=1
mrtg/edit.cgi 0000640 0001750 0001001 00000003746 07640167526 012237 0 ustar Jrn Kein #!/usr/bin/perl
#
# MRTG Webmin Module Edit Configuration file
#
# Copyright (C) 2000 by Joern Lammers, KIM Systemhaus GmbH, Braunschweig
# parts of this are borrowed from init module
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# Created : 2000-12-14
# Changed : 2001-10-31
# replaced 'File' with $text{'edit_file'} for obvious reason
# replaced 'Written by..' for same reason
# Changed : 2003-02-28
# header will not break with MSC theme anymore
# acl support added
require './mrtg-lib.pl';
$access{'allow_config'} || &error($text{'acl_err'});
# this is saving and loading in one cgi
# do the saving bit first
&ReadParse();
$file = "$config{'mrtg_cfg_path'}/webmin.cfg";
if ($in{save} == 1 ) {
open OUT,">$file";
print OUT $in{data};
close OUT;
}
# now we can read, show and edit
$data = `cat $file`;
$fs = ""; $fe = "";
&header($text{'edit_title'}, undef, "help_$text{'lang'}", 1);
print "
\n";
print "\n";
print "| $text{'edit_file'}: $file |
\n";
print "| \n";
print " |
\n";
print "
";
print "
\n";
&footer("configure.cgi",$text{'configure_title'});
mrtg/help/ 0000750 0001750 0001001 00000000000 10640045025 011522 5 ustar Jrn Kein mrtg/help/help_de.html 0000640 0001750 0001001 00000004416 10640045025 014016 0 ustar Jrn Kein Multi Router Traffic Grapher Modul Version 0.2
Allgemeine Hinweise
Dies ist ein Webmin Modul für das SNMP Überwachungssystem MRTG.
Wenn Sie Hilfe zu MRTG benötigen, lesen Sie bitte die mitgelieferte Dokumentation oder suchen Sie auf der Seite www.mrtg.org.
Dieses Modul unterstützt nur einen kleinen Teil der MRTG Features.
Um dieses Modul zu benutzen, müssen Sie zunächst MRTG installieren und Verzeichnisse für Konfigurations- und html-Daten anlegen.
Das Modul erzeugt einen Link auf das html-Verzeichnis. Dieses ist dann ber http erreichbar.
Für einige Systeme sind Verzeichnisse und weitere Konfigurationsdaten voreingestellt, diese müssen aber bei Abweichungen manuell gendert werden.
Danach sollten automatisch die MRTG Version erkannt, benötigte Dateien kopiert sowie ein Crontab-Eintrag und der Symlink auf die Daten erzeugt werden.
Eine Neukonfiguration erfolgt bei Änderungen ebenfalls automatisch.
Crontab-Eintrge werden nie gelscht. Bei doppelten Eintrgen wird eine Warnung ausgegeben.
Das Modul verwendet eine Konfigurationsdatei. Mit dieser werden mehrere Hosts abgefragt.
Durch das Klonen des Moduls knnen die Hosts in Gruppen zusammengefasst werden.
Mit ACLs wird bestimmten Benutzern die MRTG Konfiguration verboten.
Bedeutung der Felder der Modulkonfiguration
Pfad für MRTG Skripte:
Das Feld braucht nicht ausgefllt werden, wenn die Programme mrtg, cfgmaker, indexmaker und rateup über PATH erreichbar sind.
Pfad für MRTG Bilder:
Die *.png bzw. *.gif Dateien werden von hier in das html Verzeichnis kopiert.
Pfad für Konfigurationsdateien:
Das Verzeichnis muss vom Benutzer angelegt werden.
Pfad für HTML Ausgabe:
Das Verzeichnis muss vom Benutzer angelegt werden, es kann mit dem Verzeichnis der Konfigurationsdateien identisch sein.
MRTG Version:
Wird das Feld nicht ausgefllt, dann werden neuere MRTG Versionen automatisch erkannt.
MRTG Modus:
Im Daemon Modus wird kein Crontab-Eintrag erzeugt.
Senden Sie Kommentare und Patches bitte an: j.lammers@t-online.de
Jörn Lammers, Juni 2007
mrtg/help/help_en.html 0000640 0001750 0001001 00000003650 10640045004 014024 0 ustar Jrn Kein Multi Router Traffic Grapher Module Version 0.2
About this module
This is the Webmin Interface for the SNMP monitoring system MRTG.
If you need help on MRTG please read the docs that come with MRTG or go to their website at www.mrtg.org.
This module supports only a small number of MRTGs features.
To use this module you must have MRTG installed and you need directories for configuration and html data.
Please be aware that this module creates a link to the html path which is then accessible via http.
For some systems configurations have been predefined but you need to supply paths if they are special.
After that everything including detecting the MRTG version, copying the necessary files, setting up a crontab entry and the symlink to the data will work automatically.
Reconfiguration should work the same. Crontab entries will never be deleted.
You will be warned about duplicates.
The module supports one configuration file which contains multiple hosts. You can clone the module to separate different groups of monitored hosts.
ACLs can be set up to keep a user from configuring MRTG.
Explanation of module configuration parameters
Path for MRTG Scripts:
You don't need to supply this if mrtg, cfgmaker, indexmaker and rateup can be reached with PATH.
Path for MRTG Images:
*.png or *.gif files are copied from here to the html directory.
Path for Configuration Files:
You have to create this directory.
Path for HTML Output:
You have to create this directory. It can be the same as above.
MRTG Version:
If you leave this empty, newer versions will be detected automatically.
MRTG Mode:
In daemon mode no crontab entry will be created.
Please send comments and patches via email to j.lammers@t-online.de
Jörn Lammers, June 2007
mrtg/images/ 0000750 0001750 0001001 00000000000 07634724444 012061 5 ustar Jrn Kein mrtg/images/icon-2.gif 0000640 0001750 0001001 00000002124 07634724444 013637 0 ustar Jrn Kein GIF89a0 0 f3 f3 ̙f3 fffff3f f333f333 3 f 3 ̙f3 ̙f3 ̙̙f3 ff̙fff3f f33̙3f333 3 ̙ f 3 f3 ̙̙̙f̙3̙ ̙̙f3 fffff3f f333f333 3 f 3 fffff3f ffffff3f ff̙ffff3f ffffffffff3ff ff3f3f3ff3f33f 3f f f ff f3 f f333f333 3333f333 33̙33f333 3f3f3f3ff33f3 f3333333f33333 33 3 3 3f 33 3 3 f 3 f 3 ̙ f 3 f f f ff 3f f 3 3 3 f3 33 3 f 3 ! , 0 0 H*\ȰÇ#JHŋ GF7RHD^E&̛̼2G^jtc6zѨA ɒgǝ^6Rz.Dȳץ:av+K?O_
'ϰT5i_}voPt7'PNy6pi+|W@|NK&?|I2[nԸ92}lrI~|p'M>IPcuMJNu|jh3|Nӫ'˟OϿ (h&~ mrtg/images/icon.gif 0000640 0001750 0001001 00000003064 07634724444 013504 0 ustar Jrn Kein GIF89a/ / f3 f3 ̙f3 fffff3f f333f333 3 f 3 ̙f3 ̙f3 ̙̙f3 ff̙fff3f f33̙3f333 3 ̙ f 3 f3 ̙̙̙f̙3̙ ̙̙f3 fffff3f f333f333 3 f 3 fffff3f ffffff3f ff̙ffff3f ffffffffff3ff ff3f3f3ff3f33f 3f f f ff f3 f f333f333 3333f333 33̙33f333 3f3f3f3ff33f3 f3333333f33333 33 3 3 3f 33 3 3 f 3 f 3 ̙ f 3 f f f ff 3f f 3 3 3 f3 33 3 f 3 ! , / / Wd
@
*,B )`e@+ɰȏE.|8pƂತM3oN
JѣH*]ZTӧPJJ)ӫXjU$ˆ>H2MhӪ]$ȩ;,.QKBW]_ʵ%uTWh X(xpLjLfN 4e%&7fYvPB}{bOf3%@IsMW`8 9@oC_=+ϋMrVo_T ]~1[IFT :_t-$NC2x
^2`[Ց[n'vGr TA@ApX(E@%80PF8?Vp@AGDԡIQKRW?PFq,2h2jewYsQxEJ§bRY_YǢ>ZL: , ei^ C,:fOs|_l$F]#(G@[ۺ} 1[/чP >`:[&o(˼WEŤ1~pGRC%e Lr_byr{J2\L&ʿ\I͡2J{t3:i+@G+PG<4C}DM~n2]V7Vԝ]ޤ|Z`v ; mrtg/index.cgi 0000640 0001750 0001001 00000002720 07640167526 012410 0 ustar Jrn Kein #!/usr/bin/perl
#
# MRTG Webmin Module
# Copyright (C) 2000 by Joern Lammers, KIM Systemhaus GmbH, Braunschweig
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# Created : 2000-11-02
# Changed : 2001-10-31
# moved 'Written by...' to lang for obvious reasons
# Changed : 2003-02-28
# header will not break with MSC theme anymore
# added acl support
require "./mrtg-lib.pl";
&header($text{'index_title'}, undef, "help_$text{'lang'}", 1, 1, undef, undef, undef, undef, "$text{'l_version'} $config{'mrtg_ver'}; $text{'l_moduleversion'} $text{'version'}");
print "
\n";
if ($err_msg) {
print $err_msg;
print "
\n" };
if ($access{'allow_config'}) { @wlinks = ( "configure.cgi", "view.cgi" ) } else { @wlinks = ( "", "view.cgi" ) };
@wtitles = ( $text{'configure_title'}, $text{'view_title'} );
@wicons = ( "images/icon.gif", "images/icon.gif" );
&icons_table(\@wlinks, \@wtitles, \@wicons, 2);
print "
\n";
&footer("/", $text{'index'});
mrtg/lang/ 0000750 0001750 0001001 00000000000 07634724446 011537 5 ustar Jrn Kein mrtg/lang/de 0000640 0001750 0001001 00000003164 07637175440 012054 0 ustar Jrn Kein lang=de
author=Jörn Lammers
homepage=http://www.kim-systeme.de
copyright=(C) 2000 by Jörn Lammers
license=GPL
version=0.2
config_link=Zur Modul Konfiguration
l_version=MRTG-Version
l_moduleversion=Modulversion
index_title=MultiRouterTrafficGrapher
index_short=MRTG Index
configure_title=MRTG Konfiguration
view_title=MRTG Überblick
view_title_1=MRTG
edit_title=Konfiguration
edit_file=Datei
errors=kritische Fehler
err_miss_ex=MRTG Skript nicht gefunden! Ist MRTG installiert?
err_miss_img_p=Pfad für Bilddateien nicht gefunden!
err_miss_cfg_p=Konfigurationspfad nicht gefunden!
err_miss_htm_p=HTML-Pfad nicht gefunden!
err_miss_cfgmaker=cfgmaker Skript nicht gefunden!
err_miss_indexmaker=indexmaker Skript nicht gefunden!
err_miss_cron=Cron-Modul für Webmin (benötigt) fehlt!
err_htm_change=Symlink zur MRTG-Ausgabe automatisch erzeugt nach
err_cron_add=Standard Cron-Eintrag hinzugefügt. Alte Einträge bitte mit dem Cron-Modul ändern!
err_cron_mult=Mehrere gleiche Cron-Einträge gefunden! Bitte mit Cron-Modul ändern oder seltsame Dinge geschehen!
err_gif_copy=MRTG gif Dateien kopiert
err_png_copy=MRTG png Dateien kopiert
err_vers=Erkannte MRTG Version ist
submit_button=Submit
mrtg_cfg=Ändern der MRTG Konfigurationsdatei
mrtg_cfg_add=Host hinzufügen
mrtg_cfg_del=Konfigurationsdatei löschen
mrtg_index=Überblick mit indexmaker erzeugen
mrtg_index_run=Start
mrtg_cfg_edit=Ansehen/Editieren
mrtg_cfg_err=Fehlerausgabe der letzten Operation
acl_config=Darf MRTG Konfiguration bearbeiten
acl_err=Zugriff verweigert! mrtg/lang/en 0000640 0001750 0001001 00000003014 07637175433 012062 0 ustar Jrn Kein lang=en
author=Jörn Lammers
homepage=http://www.kim-systeme.de
copyright=(C) 2000 by Jörn Lammers
license=GPL
version=0.2
l_version=MRTG Version
l_moduleversion=Module Version
config_link=Check Module Configuration first!
index_title=MultiRouterTrafficGrapher
index_short=MRTG Index
configure_title=MRTG Configuration
view_title=MRTG Overview
view_title_1=MRTG
edit_title=Edit Configuration
edit_file=File
errors=Critical Errors
err_miss_ex=Can't find MRTG executable! Did You install MRTG?
err_miss_img_p=Can't access images path!
err_miss_cfg_p=Can't access configuration path!
err_miss_htm_p=Can't access HTML output path!
err_miss_cfgmaker=Can't find cfgmaker script!
err_miss_indexmaker=Can't find indexmaker script!
err_miss_cron=Cron module for Webmin is required!
err_htm_change=Symlink to MRTG output automatically changed to
err_cron_add=Standard cron entry was added. Delete old entries using the cron module!
err_cron_mult=Multiple cron entries for this configuration found! Change using the cron module or expect strange results!
err_gif_copy=MRTG gif files copied to output path
err_png_copy=MRTG png files copied to output path
err_vers=MRTG detected version is
submit_button=Submit
mrtg_cfg=Change configuration file
mrtg_cfg_add=Add Host
mrtg_cfg_del=Delete file
mrtg_index=Create Overview with indexmaker
mrtg_index_run=Run
mrtg_cfg_edit=View / Edit
mrtg_cfg_err=Error Output of last operation
acl_config=Can change MRTG configuration?
acl_err=Access forbidden! mrtg/module.info 0000640 0001750 0001001 00000000325 07642545773 012764 0 ustar Jrn Kein name=mrtg
desc=Multi Router Traffic Grapher
desc_de=MRTG
category=net
os_support=redhat-linux debian-linux slackware-linux suse-linux open-linux mandrake-linux united-linux freebsd solaris hpux macos
depends=0.80
mrtg/mrtg-lib.pl 0000640 0001750 0001001 00000017202 10640044142 012646 0 ustar Jrn Kein #
# MRTG Webmin Module Library
# Copyright (C) 2000 by Joern Lammers, KIM Systemhaus GmbH, Braunschweig
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# Created : 2000-11-02
# Changed : 2001-10-31
# mrtg executable, cfgmaker an indexmaker may all be either in searchpath or mrtg_scr_path
# indexmaker syntax has changed again (latest version now 2.9.17)
# added use_cron option
# Changed : 2003-03-16
# MRTG version autodetect added
# support module clones
# remove "mrtg" from init_config
# use $module_name for links
# added acl support
# Changed : 2007-06-23
# use icondir with indexmaker
# flush_files_lines was called with wrong parameter (resulting in a broken cfg)
# $debug=1;
do '../web-lib.pl';
&init_config();
%access = &get_module_acl();
# check, check, testing, 1, 2.......
# critical errors
# look if everything we need is there (or somewhere else)
$err=0;
$err_msg="";
# the executables may be in a standard path or the provided scripts path
foreach (split(/:/, "$ENV{PATH}:$config{'mrtg_scr_path'}")) {
if (-x "$_/mrtg") {$mrtg_cmd=$_};
if (-x "$_/cfgmaker") {$cfgm_cmd=$_};
if (-x "$_/indexmaker") {$idxm_cmd=$_};
}
if (!$mrtg_cmd) {
$err_msg.=&text('err_miss_ex')."
";
$err++ }
if (!$cfgm_cmd) {
$err_msg.=&text('err_miss_cfgmaker')."
";
$err++ }
if (!$idxm_cmd) {
$err_msg.=&text('err_miss_indexmaker')."
";
$err++ }
# mrtg images path
if (!-d "$config{'mrtg_img_path'}") {
$err_msg.=&text('err_miss_img_p')."
";
$err++ }
# mrtg configuration path (configuration file will be webmin.cfg)
if (!-d "$config{'mrtg_cfg_path'}") {
$err_msg.=&text('err_miss_cfg_p')."
";
$err++ }
# mrtg output path
if (!-d "$config{'mrtg_htm_path'}") {
$err_msg.=&text('err_miss_htm_p')."
";
$err++ }
# we need the cron module
if ((&foreign_check("cron")==0) && ($config{use_cron}==1)){
$err_msg.=&text('err_miss_cron')."
";
$err++ }
# stop on critical errors
if ($err>0) {
$err_msg=$err." ".&text('errors')."
".$err_msg." ".&text('config_link')."";
&error($err_msg) }
#
# non critical
#
#
# try to guess mrtg version if not supplied and set config
#
if ($config{'mrtg_ver'} eq "") {
system("$mrtg_cmd/mrtg 2>&1 >$config{'mrtg_cfg_path'}/err.cfg");
$ver=(grep {/^mrtg-/} &mrtg_err_get)[0];
$ver=(split / /, substr($ver,5,10))[0];
# hope it's safe to use read_file and write_file for config.....
&read_file("$module_config_directory/config", \%lines);
if (exists $lines{'mrtg_ver'}) {
$lines{'mrtg_ver'}=$ver;
&write_file("$module_config_directory/config", \%lines);
$config{'mrtg_ver'}=$ver;
$err_msg.=&text('err_vers')." $ver
";
}
}
@l=split /\./,$config{'mrtg_ver'};
$ver=1000000*$l[0]+1000*$l[1]+$l[2];
#
# automatic reconfiguration of symlink to html data
# also set WorkDir in MRTG configuration
$s_link="./data-$module_name";
$o_link=readlink($s_link);
$n_link=$config{'mrtg_htm_path'};
if ( $o_link ne $n_link) {
$err_msg.=&text('err_htm_change')." ".$n_link."
";
unlink($s_link);
symlink($n_link,$s_link);
&mrtg_cfg_setwdir;
}
#
# automatic cron management
# if cron is to be used
if ($config{use_cron}==1){
$mrtg_cmd.="/mrtg $config{'mrtg_cfg_path'}/webmin.cfg";
&foreign_require("cron", "cron-lib.pl");
@jobs = &foreign_call( "cron", "list_cron_jobs");
$i=0;
foreach (map{$$_{'command'}} @jobs){
if ($_ eq $mrtg_cmd) {$i++};
}
# too many correct cron entries
if ($i>1) {
$err_msg.=&text('err_cron_mult')."
";
}
# add cron entry for current configuration
# we don't delete old entries. the user will have to do that
if ($i==0) {
$mrtg_job={'mins' =>"1,6,11,16,21,26,31,36,41,46,51,56",
'hours' =>"*",
'days' =>"*",
'months' =>"*",
'weekdays'=>"*",
'user' =>"root",
'active' =>1,
'type' =>0,
'command' =>$mrtg_cmd};
&foreign_call("cron", "create_cron_job", $mrtg_job);
$err_msg.=&text('err_cron_add')."
";
}
}
#
# copy mrtg images if needed
if ($ver < 2009000) {
if (! glob("$config{'mrtg_htm_path'}/mrtg-*.gif")) {
foreach $in (glob("$config{'mrtg_img_path'}/mrtg-*.gif")) {
@list=split /\//,$in;
$out="$config{'mrtg_htm_path'}/$list[@list-1]";
open IN, "<$in";
open OUT,">$out";
©data(IN,OUT);
close OUT;
close IN;
}
$err_msg.=&text('err_gif_copy')."
";
}
}
if ($ver > 2008008) {
if (! glob("$config{'mrtg_htm_path'}/mrtg-*.png")) {
foreach $in (glob("$config{'mrtg_img_path'}/mrtg-*.png")) {
@list=split /\//,$in;
$out="$config{'mrtg_htm_path'}/$list[@list-1]";
open IN, "<$in";
open OUT,">$out";
©data(IN,OUT);
close OUT;
close IN;
}
$err_msg.=&text('err_png_copy')."
";
}
}
##########
# MRTG subs
#
# remove all WorkDir entries and set WorkDir
sub mrtg_cfg_setwdir {
$cfg=&read_file_lines("$config{'mrtg_cfg_path'}/webmin.cfg");
@$cfg=grep {!/^WorkDir:/} @$cfg;
unshift @$cfg,"WorkDir:$config{'mrtg_htm_path'}";
&flush_file_lines("$config{'mrtg_cfg_path'}/webmin.cfg");
}
# delete current configuration
sub mrtg_cfg_del {
$cfg=&read_file_lines("$config{'mrtg_cfg_path'}/webmin.cfg");
@$cfg=("WorkDir:$config{'mrtg_htm_path'}");
&flush_file_lines("$config{'mrtg_cfg_path'}/webmin.cfg");
}
# add snmp host with cfgmaker
# mrtg_cfg_addhost(community,hostname)
sub mrtg_cfg_addhost {
system("$cfgm_cmd/cfgmaker $_[0]\@$_[1] >>$config{'mrtg_cfg_path'}/webmin.cfg 2>$config{'mrtg_cfg_path'}/err.cfg");
&mrtg_cfg_setwdir;
}
# run indexmaker
# indexmaker does not return errors in STDERR check!!
sub mrtg_cfg_makeindex {
$title=&text('view_title');
$title_1=&text('view_title_1');
if ($ver >= 2010013) {
system("$idxm_cmd/indexmaker --columns=1 --icondir=. --title=\"$title\" $config{'mrtg_cfg_path'}/webmin.cfg >$config{'mrtg_htm_path'}/index.html 2>$config{'mrtg_cfg_path'}/err.cfg");
} elsif ($ver >= 2009000) {
system("$idxm_cmd/indexmaker --columns=1 --title=\"$title\" $config{'mrtg_cfg_path'}/webmin.cfg >$config{'mrtg_htm_path'}/index.html 2>$config{'mrtg_cfg_path'}/err.cfg");
} elsif ($ver >= 2007000) {
system("$idxm_cmd/indexmaker -1 -t \"$title_1\" $config{'mrtg_cfg_path'}/webmin.cfg >$config{'mrtg_htm_path'}/index.html 2>$config{'mrtg_cfg_path'}/err.cfg");
} else {
system("$idxm_cmd/indexmaker $config{'mrtg_cfg_path'}/webmin.cfg \"$title\" ^ >$config{'mrtg_htm_path'}/index.html 2>$config{'mrtg_cfg_path'}/err.cfg");
}
}
# return list containing error output
sub mrtg_err_get {
@list=();
$in="$config{'mrtg_cfg_path'}/err.cfg";
if (-e $in) {
open IN,"<$in";
while($line=) {push @list,$line};
close IN;
}
return @list;
}
###########################################################################
# DEBUGGING STUFF.... ignore if I forget to delete this
#
#
#
if ($debug){
$err_msg.="";
$err_msg.="";
$err_msg.="| ACL: ".$access{'allow_config'}." | ";
$err_msg.= "
";
$err_msg.= "| Module Name: ".$module_name." | ";
$err_msg.= "
";
$err_msg.= "
";
}
#
#
###########################################################################
1;
mrtg/mrtg.cgi 0000640 0001750 0001001 00000002204 07640167526 012247 0 ustar Jrn Kein #!/usr/bin/perl
#
# MRTG Webmin Module
# Copyright (C) 2000 by Joern Lammers, KIM Systemhaus GmbH, Braunschweig
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# Created : 2000-12-11
# Changed : 2003-03-22
# acl support added
require './mrtg-lib.pl';
$access{'allow_config'} || &error($text{'acl_err'});
# this cgi calls MRTG scripts
&ReadParse();
if ($in{'cmd'} == 0) {
&mrtg_cfg_addhost($in{'community'},$in{'host'});
&redirect("configure.cgi");
}
if ($in{'cmd'} == 2) {
&mrtg_cfg_del;
&redirect("configure.cgi");
}
if ($in{'cmd'} == 3) {
&mrtg_cfg_makeindex;
&redirect("configure.cgi");
}
if ($in{'cmd'} == 1) {&redirect("edit.cgi")};
mrtg/view.cgi 0000640 0001750 0001001 00000002531 07640167526 012253 0 ustar Jrn Kein #!/usr/bin/perl
#
# MRTG Webmin Module
# Copyright (C) 2000 by Joern Lammers, KIM Systemhaus GmbH, Braunschweig
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# Created : 2000-11-06
# Changed : 2001-10-31
# added 'index.html' to target for IE 5.5 compatibility
# Changed : 2003-03-22
# use $module_name to enable clones
# header will not break with MSC theme anymore
require './mrtg-lib.pl';
if ($config{multi_window}==0) {&redirect("/$module_name/data-$module_name/index.html") }
else {
$html_head="";
$html_body="onload='window.open(\"/$module_name/data-$module_name/index.html\")'";
&header($text{'view_title'}, undef, "help_$text{'lang'}", 1, undef, undef, undef, $html_head, $html_body);
print "
\n";
&footer("index.cgi", $text{'index_short'});
};