[go: up one dir, main page]

Menu

[r1]: / cgi.pl  Maximize  Restore  History

Download this file

134 lines (124 with data), 5.0 kB

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
#!C:\Perl\bin\perl.exe -w
#
# Copyright 2008 Samuel Borsutzky
#
# This file is part of PerlForms.
#
# PerlForms 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 3 of the License, or
# (at your option) any later version.
#
# PerlForms 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.
#
# You should have received a copy of the GNU General Public License
# along with PerlForms. If not, see <http://www.gnu.org/licenses/>.
#
#
#
#
# Dieses CGI verwaltet Services (Produkte) und deren technische
# Abhaengigkeiten, z.B. verfuegbarkeit gewisser Geraete, und bestimmte
# Eigenschaften dieser.
#
# Dises CGI zeigt je nach URL mit der es aufgerufen wurde z.B. Listen aller
# gespeicherten Gearaete, oder ein Formular zur Aenderung dieser Daten.
#
# Formulare werden durch Funktionen ::form zurueckgegeben.
#
# Listen durch Funktionen ::show
#
# Weiter unten gibt es eine laengere 'if'-Klausel, die anhand der URL eine
# entsprechende Ausgabe generiert/aufruft (z.B. Device::form)
#
#
# Add new object checklist: (what=name der neuen perlforms-klasse)
#
# - PerlForms::Dictionary: %dict: idattrib
# - PerlForms::Dictionary: %dict: pm
# - PerlForms::Dictionary: %dict: schoen (optional, default: capitalized what)
# - PerlForms::Dictionary: %dict: storage (optional, default: perlformsdb)
# - PerlForms::Dictionary: %dict: tablename (optional, default: what)
# - PerlForms::Dictionary: %dict: parent (optional)
# - PerlForms::Dictionary: %dict: child (optional)
# - PerlForms::Dictionary: %dict: attribs: min. id, name, <abkuerz>, <what>
# - PerlForms::Dictionary: %dict: attribs: order: alle atribute eintragen (für PerlForms->form)
# - PerlForms::Dict::Apps: %prgs: objects (wird für class->legal und somit für object->show benötigt)
# - PerlForms::Dict::Apps: %prgs: navlinks (optional, wenn ein link in der navbar stehen soll)
# - package <what> (.pm) anlegen (optional; use base qw(PerlForms::Object);)
# - Query: subs <what> und <what>_list (optional, falls default und default_list
# nicht ausreichen)
# - add .pm to REMOTE_INSTALLL* and INSTALL*
#
#
#
# Todo todolist:
#
# - funcdep-nag.pl soll automatisch einen Monitor fuer den angegebenen
# "Monitoring Access" anlegen. Ist z.B. SNMPv2 ausgwaehlt, dann soll autom.
# ein Monitor "SNMPv2 available" oder vielleicht "Monitorable" angelegt
# werden.
#
# - Deviceklassen, bei Dkl. "DedFW-Module" z.B. soll dann automatisch ein
# requirement "dfw-sa-fra-Xxxx up", "...: monitorable", "...: SSH available",
# etc. angelegt werden. Ausserdem koennten gleich ein paar Functionalities
# angelegt werden. Z.B: "DedFW-Module-XYZ Access to the Internet", etc.
# Jedenfalls sollen Monitore automatisch angelegt werden. z.B: "Swap Space"
# oder "Interface Status eth2c0 IP Layer", "System Time", etc.
#
# - Status des Service muss einstellbar sein.
#
#
#
# todo Policy: undef=unbekannt, ""=leer/n.n.definiert
#
#
#
# Style-Guide
#
# - Einrückung: Vier Leerzeichen (nicht Tab) pro Ebene.
#
# - "new"-Syntax: Klasse->new();
# Bei syntax "new Form" kommt fehlermldg, es gebe keine sub Form PerlForms..
# das hat damit zu tun, dass Perl die syntax "new Form" nicht richtig parsen
# kann, da damit ja auch &new(Form) gemeint sein könnte, also das sub new
# weiter unten.
#
# - my: my$test my%bla ... aber: my($a,$b)
#
# - if/while/foreach-Blöcke: Öffnende { am Ende der der if/while/foreach-Zeile.
# Schließende } auf neuer Zeile bündig mit dem if/while/foreach.
#
#
#
#
# Design-Policy
#
# - pfmodules(Funcdep,IPLS::Ldap,NagUtil(,PerlForms=Root))
# - apps(ldap,funcdep,logdb)
#
#
#
#
use strict;
#use lib 'C:\cygwin\lib\perl5\site_perl\5.8'; #hush
use lib "D:/Documents and Settings/sborsutz/My Documents/Entwicklung/eclipse-workspace/perlforms"; #dell
use lib "D:/Documents and Settings/sborsutz/My Documents/Entwicklung/eclipse-workspace/funcdep"; #dell
use lib "D:/Documents and Settings/sborsutz/My Documents/Entwicklung/eclipse-workspace/nagutil"; #dell
use PerlForms::HTML::REQ;
use PerlForms::Util qw(&epoch2date);
use vars qw($debug);
$debug=1 unless(defined($debug));
my($starttime)=time();
if($debug) {
print(STDERR "\n######### cgi.pl called at ".&epoch2date($starttime)." #########\n");
print(STDERR "URI: ".$ENV{REQUEST_URI}."\n");
}
PerlForms::HTML::REQ->new(scriptname=>__FILE__)->process_httpreq;
if($debug or $starttime) {
my($endtime)=time();
print(STDERR "######### cgi.pl ended at ".&epoch2date($endtime)." (duration: ".($endtime-$starttime)."s) #########\n");
}