[% IF network.parent %]
[% ELSE %]
[% IF editTree %]
[% IF network.fillNet %]
[% END %]
[% END %]
[% END %]
[% IF editTree %]
[% UNLESS network.fillNet %]
[% END %]
[% END %]
[% INCLUDE HaCiBox.tmpl
menu = settingsMenu
formName = settingsMenuFormName
hiddens = settingsMenuHiddens
%]
[% IF settingsSubMenu %]
[% END %]
[% IF settingsSubMenu == 'chOwnPW' %]
[% INCLUDE HaCiChanceOwnPW.tmpl %]
[% ELSIF settingsSubMenu == 'showViewSettings' %]
[% INCLUDE HaCiShowViewSettings.tmpl %]
[% END %]
HaCi - IP Address Administration
Copyright (C) 2006-2010 by Lars Wildemann
Author: Lars Wildemann <HaCi@larsux.de>
HaCi is an IP Address / Network Administration Tool with IPv6 Support.
It stores its data efficiently in a relational Database and uses a
treelike Strukture to illustrate supernets and subnets.
This program is free software; you can redistribute it andor 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.
HaCi/Template/HaCi.tmpl 0000644 0001750 0001750 00000002144 11336301620 014775 0 ustar fighter fighter [% UNLESS noHeader %]
[% titlelong %]
[% FOREACH style IN layouts %]
[% IF style.descr != styleDescr %]
[% END %]
[% END %]
[% END %]
[% IF page == 'main' %]
[% INCLUDE HaCiMain.tmpl %]
[% ELSIF page == 'login' %]
[% INCLUDE HaCiLogin.tmpl %]
[% ELSIF page == 'showStatus' %]
[% INCLUDE HaCiShowStatus.tmpl %]
[% ELSIF page == 'treeNetworkTable' %]
[% INCLUDE HaCiTreeNetwork.tmpl %]
[% ELSIF page == 'treeRootNetworkTable' %]
[% INCLUDE HaCiTreeRoot.tmpl %]
[% INCLUDE HaCiTreeNetwork.tmpl %]
[% ELSIF page == 'showPlugin' %]
[% INCLUDE HaCiShowPlugin.tmpl %]
[% END %]
[% UNLESS noHeader %]
[% END %]
HaCi/Template/HaCiDelRoot.tmpl 0000644 0001750 0001750 00000000420 10704777333 016301 0 ustar fighter fighter
[% delRootHeader %]
[% INCLUDE HaCiBox.tmpl
menu = delRootMenu
formName = delRootFormName
hiddens = delRootHiddens
%]
[% IF showTreeStructure %]
[% IF network.GUINetCache %]
[% FOR entry in network.GUINetCache %]
[% name = entry.level %]
[% noLine.$name = entry.value %]
[% END %]
[% END %]
[% IF network.lastParent %]
[% name = network.lastParent %]
[% noLine.$name = 1 %]
[% END %]
[% level = 1 %]
[% WHILE level <= network.level %]
[% level = level + 1 %]
[% END %]
[% ELSE %]
[% END %]
[% IF network.parent %]
[% ELSE %]
[% IF showTreeStructure %]
[% ELSE %]
[% END %]
[% IF editTree %]
[% IF network.fillNet %]
[% END %]
[% END %]
[% END %]
[% IF editTree %]
[% UNLESS network.fillNet %]
[% END %]
[% END %]
[% IF network.netUrl %]
[% network.network %]
[% ELSE %]
[% network.network %]
[% END %]
[% IF network.statePic %]
[% END %]
[% IF network.defSubnetSize %]
[/[% network.defSubnetSize %]]
[% END %]
[% IF network.invisible %]
[% network.descr %]
[% ELSE %]
[% network.descr %]
[% END %]
[% IF directaccess %]
[% UNLESS network.fillNet OR network.invisible %]
[% END %]
[% END %]
[% IF network.parent %][% UNLESS network.expanded %]
[% END %][% END %]
[% IF network.parentBroadcast %]
[% i = [ 1 .. network.parentBroadcast ] %]
[% FOREACH i %]
[% END %]
[% END %]
[% END %]
HaCi/COPYING 0000644 0001750 0001750 00000043110 10527616642 012567 0 ustar fighter fighter GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
License is intended to guarantee your freedom to share and change free
software--to make sure the software is free for all its users. This
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it. (Some other Free Software Foundation software is covered by
the GNU Library General Public License instead.) You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
this service if you wish), that you receive source code or can get it
if you want it, that you can change the software or use pieces of it
in new free programs; and that you know you can do these things.
To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must give the recipients all the rights that
you have. You must make sure that they, too, receive or can get the
source code. And you must show them these terms so they know their
rights.
We protect your rights with two steps: (1) copyright the software, and
(2) offer you this license which gives you legal permission to copy,
distribute and/or modify the software.
Also, for each author's protection and ours, we want to make certain
that everyone understands that there is no warranty for this free
software. If the software is modified by someone else and passed on, we
want its recipients to know that what they have is not the original, so
that any problems introduced by others will not reflect on the original
authors' reputations.
Finally, any free program is threatened constantly by software
patents. We wish to avoid the danger that redistributors of a free
program will individually obtain patent licenses, in effect making the
program proprietary. To prevent this, we have made it clear that any
patent must be licensed for everyone's free use or not licensed at all.
The precise terms and conditions for copying, distribution and
modification follow.
GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License applies to any program or other work which contains
a notice placed by the copyright holder saying it may be distributed
under the terms of this General Public License. The "Program", below,
refers to any such program or work, and a "work based on the Program"
means either the Program or any derivative work under copyright law:
that is to say, a work containing the Program or a portion of it,
either verbatim or with modifications and/or translated into another
language. (Hereinafter, translation is included without limitation in
the term "modification".) Each licensee is addressed as "you".
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running the Program is not restricted, and the output from the Program
is covered only if its contents constitute a work based on the
Program (independent of having been made by running the Program).
Whether that is true depends on what the Program does.
1. You may copy and distribute verbatim copies of the Program's
source code as you receive it, in any medium, provided that you
conspicuously and appropriately publish on each copy an appropriate
copyright notice and disclaimer of warranty; keep intact all the
notices that refer to this License and to the absence of any warranty;
and give any other recipients of the Program a copy of this License
along with the Program.
You may charge a fee for the physical act of transferring a copy, and
you may at your option offer warranty protection in exchange for a fee.
2. You may modify your copy or copies of the Program or any portion
of it, thus forming a work based on the Program, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) You must cause the modified files to carry prominent notices
stating that you changed the files and the date of any change.
b) You must cause any work that you distribute or publish, that in
whole or in part contains or is derived from the Program or any
part thereof, to be licensed as a whole at no charge to all third
parties under the terms of this License.
c) If the modified program normally reads commands interactively
when run, you must cause it, when started running for such
interactive use in the most ordinary way, to print or display an
announcement including an appropriate copyright notice and a
notice that there is no warranty (or else, saying that you provide
a warranty) and that users may redistribute the program under
these conditions, and telling the user how to view a copy of this
License. (Exception: if the Program itself is interactive but
does not normally print such an announcement, your work based on
the Program is not required to print an announcement.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Program, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Program.
In addition, mere aggregation of another work not based on the Program
with the Program (or with a work based on the Program) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may copy and distribute the Program (or a work based on it,
under Section 2) in object code or executable form under the terms of
Sections 1 and 2 above provided that you also do one of the following:
a) Accompany it with the complete corresponding machine-readable
source code, which must be distributed under the terms of Sections
1 and 2 above on a medium customarily used for software interchange; or,
b) Accompany it with a written offer, valid for at least three
years, to give any third party, for a charge no more than your
cost of physically performing source distribution, a complete
machine-readable copy of the corresponding source code, to be
distributed under the terms of Sections 1 and 2 above on a medium
customarily used for software interchange; or,
c) Accompany it with the information you received as to the offer
to distribute corresponding source code. (This alternative is
allowed only for noncommercial distribution and only if you
received the program in object code or executable form with such
an offer, in accord with Subsection b above.)
The source code for a work means the preferred form of the work for
making modifications to it. For an executable work, complete source
code means all the source code for all modules it contains, plus any
associated interface definition files, plus the scripts used to
control compilation and installation of the executable. However, as a
special exception, the source code distributed need not include
anything that is normally distributed (in either source or binary
form) with the major components (compiler, kernel, and so on) of the
operating system on which the executable runs, unless that component
itself accompanies the executable.
If distribution of executable or object code is made by offering
access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.
4. You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense or distribute the Program is
void, and will automatically terminate your rights under this License.
However, parties who have received copies, or rights, from you under
this License will not have their licenses terminated so long as such
parties remain in full compliance.
5. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Program or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Program (or any work based on the
Program), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Program or works based on it.
6. Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the
original licensor to copy, distribute or modify the Program subject to
these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to
this License.
7. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Program at all. For example, if a patent
license would not permit royalty-free redistribution of the Program by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Program.
If any portion of this section is held invalid or unenforceable under
any particular circumstance, the balance of the section is intended to
apply and the section as a whole is intended to apply in other
circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system, which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
8. If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License
may add an explicit geographical distribution limitation excluding
those countries, so that distribution is permitted only in or among
countries not thus excluded. In such case, this License incorporates
the limitation as if written in the body of this License.
9. The Free Software Foundation may publish revised and/or new versions
of the General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the Program
specifies a version number of this License which applies to it and "any
later version", you have the option of following the terms and conditions
either of that version or of any later version published by the Free
Software Foundation. If the Program does not specify a version number of
this License, you may choose any version ever published by the Free Software
Foundation.
10. If you wish to incorporate parts of the Program into other free
programs whose distribution conditions are different, write to the author
to ask for permission. For software which is copyrighted by the Free
Software Foundation, write to the Free Software Foundation; we sometimes
make exceptions for this. Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.
NO WARRANTY
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
REPAIR OR CORRECTION.
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
Copyright (C)
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.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Also add information on how to contact you by electronic and paper mail.
If the program is interactive, make it output a short notice like this
when it starts in an interactive mode:
Gnomovision version 69, Copyright (C) year name of author
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, the commands you use may
be called something other than `show w' and `show c'; they could even be
mouse-clicks or menu items--whatever suits your program.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the program, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
`Gnomovision' (which makes passes at compilers) written by James Hacker.
, 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.
HaCi/cgi-bin/ 0000755 0001750 0001750 00000000000 11410502172 013025 5 ustar fighter fighter HaCi/cgi-bin/HaCi.cgi 0000755 0001750 0001750 00000005200 11322231572 014322 0 ustar fighter fighter #!/usr/bin/perl -w
###############################################################################
## HaCi - IP Address Administration #
## Copyright (C) 2006-2010 by Lars Wildemann #
## Author: Lars Wildemann #
## #
## HaCi is an IP Address / Network Administration Tool with IPv6 Support. #
## It stores its data efficiently in a relational Database and uses a #
## treelike Strukture to illustrate supernets and subnets. #
## #
## 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. #
###############################################################################
use strict;
use Carp ();
local $SIG{__WARN__} = \&Carp::cluck if 0;
$| = 1;
sub getWorkDir {
my $currDir = `pwd`;
chomp($currDir);
my $scriptFile = $0;
$scriptFile = $ENV{SCRIPT_FILENAME} if exists $ENV{SCRIPT_FILENAME};
(my $scriptDir = $scriptFile) =~ s/\/[^\/]+$//;
my $destDir = ($scriptDir =~ /^\//) ? $scriptDir : $currDir . '/' . $scriptDir;
chdir "$destDir/../" or die "Cannot change into workdir '$destDir/../': $!\n";
my $workDir = `pwd`;
chomp($workDir);
return $workDir;
}
BEGIN {
my $workDir = &getWorkDir();
$ENV{workdir} = $workDir;
unshift @INC, $ENV{workdir} . '/modules';
}
# Polluting Environment for Config::General
$ENV{script_name} = $ENV{SCRIPT_NAME};
my $workDir = &getWorkDir();
$ENV{workdir} = $workDir;
unshift @INC, $ENV{workdir} . '/modules';
use HaCi::HaCi;
use HaCi::Conf;
my $startTime = time;
&HaCi::Conf::init($workDir);
&HaCi::HaCi::run();
my $endTime = time;
warn "Processtime (" , localtime($startTime) . " - ". localtime($endTime) . "): " . ($endTime - $startTime) . "\n" if 0;
warn "Processtime : " . ($endTime - $startTime) . "\n" if 0;
exit 0;
# vim:ts=2:sw=2:sws=2
HaCi/cgi-bin/test.cgi 0000755 0001750 0001750 00000004324 11345231162 014503 0 ustar fighter fighter #!/usr/bin/perl
use strict;
use warnings;
use CGI;
sub getWorkDir {
my $currDir = `pwd`;
chomp($currDir);
my $scriptFile = $0;
$scriptFile = $ENV{SCRIPT_FILENAME} if exists $ENV{SCRIPT_FILENAME};
(my $scriptDir = $scriptFile) =~ s/\/[^\/]+$//;
my $destDir = ($scriptDir =~ /^\//) ? $scriptDir : $currDir . '/' . $scriptDir;
chdir "$destDir/../" or die "Cannot change into workdir '$destDir/../': $!\n";
my $workDir = `pwd`;
chomp($workDir);
return $workDir;
}
BEGIN {
my $workDir = &getWorkDir();
$ENV{workdir} = $workDir;
unshift @INC, $ENV{workdir} . '/modules';
}
$| = 1;
my $workDir = &getWorkDir();
$ENV{workdir} = $workDir;
unshift @INC, $ENV{workdir} . '/modules';
my $q = new CGI(@_);
my $title = 'HaCi - IP Address Administration';
my $ver = '0.9.7a';
my
@mands = qw/CGI CGI::Ajax CGI::Carp CGI::Cookie CGI::Session Class::Accessor Class::MakeMethods Config::General DBD::mysql Digest::MD5 Digest::SHA Encode Encode::Guess File::Temp HTML::Entities Locale::gettext Log::LogLite Math::Base85 Math::BigInt#1.87 Net::CIDR Net::IMAP::Simple Net::IPv6Addr Net::SNMP Storable Template Time::Local/;
my
@opts = qw/Cache::FastMmap Cache::FileCache DNS::ZoneParse IO::Socket::INET6 Math::BigInt::GMP Net::DNS Net::Nslookup Net::Ping Pod::WSDL SOAP::Transport::HTTP SQL::Translator#0.09000 SQL::Translator::Diff Text::CSV_XS Apache::DBI/;
print $q->header(-charset=>'UTF-8');
print $q->start_html({
title => $title
});
print $q->h1($title);
print $q->h2("Version: " . $ver . (($ENV{MOD_PERL}) ? ' (running under mod-perl)' : ''));
print $q->h6($ENV{SERVER_SOFTWARE});
print $q->br, $q->h3("Mandatory Modules:");
print $q->start_table({cellpadding=>3, rules=>'all'});
foreach (sort @mands) {
s/#/ /g;
eval "use $_";
warn $@ if $@;
print $q->Tr($q->th({align=>'left'}, $_), $q->td({bgcolor=>(($@) ? '#FFAAAA' : '#AAFFAA')}, (($@) ? 'NOT' : '') . ' available'));
}
print $q->end_table;
print $q->start_table({cellpadding=>3, rules=>'all'});
print $q->br, $q->h3("Recommended Modules:");
foreach (sort @opts) {
s/#/ /g;
eval "use $_";
warn $@ if $@;
print $q->Tr($q->th({align=>'left'}, $_), $q->td({bgcolor=>(($@) ? '#FFAAAA' : '#AAFFAA')}, (($@) ? 'NOT' : '') . ' available'));
}
exit 0;
# vim:ts=4:sw=4
HaCi/cgi-bin/HaCiAPI.cgi 0000644 0001750 0001750 00000006220 11322231572 014654 0 ustar fighter fighter #!/usr/bin/perl
###############################################################################
## HaCi - IP Address Administration #
## Copyright (C) 2006-2010 by Lars Wildemann #
## Author: Lars Wildemann #
## #
## HaCi is an IP Address / Network Administration Tool with IPv6 Support. #
## It stores its data efficiently in a relational Database and uses a #
## treelike Strukture to illustrate supernets and subnets. #
## #
## 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. #
###############################################################################
sub getWorkDir {
my $currDir = `pwd`;
chomp($currDir);
my $scriptFile = $0;
$scriptFile = $ENV{SCRIPT_FILENAME} if exists $ENV{SCRIPT_FILENAME};
(my $scriptDir = $scriptFile) =~ s/\/[^\/]+$//;
my $destDir = ($scriptDir =~ /^\//) ? $scriptDir : $currDir . '/' . $scriptDir;
chdir "$destDir/../" or die "Cannot change into workdir '$destDir/../': $!\n";
my $workDir = `pwd`;
chomp($workDir);
return $workDir;
}
BEGIN {
$workDir = &getWorkDir();
$ENV{workdir} = $workDir;
unshift @INC, $ENV{workdir} . '/modules';
}
use strict;
use warnings;
use Carp ();
local $SIG{__WARN__} = \&Carp::cluck if 0;
$| = 1;
use vars qw/$workDir/;
use SOAP::Transport::HTTP;
use HaCi::HaCiAPI;
map { warn " $_ => $ENV{$_}\n"; } keys %ENV if 0;
$workDir = &getWorkDir();
$ENV{workdir} = $workDir;
unshift @INC, $ENV{workdir} . '/modules';
my $query = $ENV{'QUERY_STRING'};
my $startTime = time;
warn "Start: " . localtime() . "\n";
if (defined $query && $query =~ /getWSDL/) {
&prWSDL();
} else {
SOAP::Transport::HTTP::CGI
-> dispatch_to('HaCi::HaCiAPI')
-> handle;
}
warn "End: " . localtime() . "\n";
my $endTime = time;
warn "Running: " . ($endTime - $startTime) . "s\n";
#--------------------------------
sub prWSDL {
eval {
require Pod::WSDL;
};
if ($@) {
die "Cannot print WSDL: $@\n";
}
use CGI;
my $q = new CGI;
my $pod = new Pod::WSDL(
source => 'HaCi::HaCiAPI',
location => ((($ENV{'HTTPS'} && $ENV{'HTTPS'} !~ /off/i) ? 'https' : 'http') . '://' . $ENV{'SERVER_NAME'} . $ENV{'SCRIPT_NAME'}),
pretty => 1,
withDocumentation => 1
);
print $q->header();
print $pod->WSDL;
}
exit 0;
# vim:ts=2:sw=2:sws=2
HaCi/README 0000644 0001750 0001750 00000016160 11410134302 012375 0 ustar fighter fighter ###############################################################################
## HaCi - IP Address Administration #
## Copyright (C) 2006-2010 by Lars Wildemann #
## Author: Lars Wildemann #
## #
## HaCi is an IP Address / Network Administration Tool with IPv6 Support. #
## It stores its data efficiently in a relational Database and uses a #
## treelike Strukture to illustrate supernets and subnets. #
## #
## 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. #
###############################################################################
OVERVIEW
HaCi is a web frontend for administrating networks. It consist of a (perl) CGI and a (mySQL) database as backend.
REQUIRERMENTS
All you need is a webserver (e.g.: Apache), a database (e.g.: mySQL) and an OS which supports perl.
- Perl (check with `perl -M -e 1 2>/dev/null && echo "Ok" || echo "Failed"`)
- Cache::Cache
- CGI
- CGI::Ajax
- CGI::Carp
- CGI::Cookie
- CGI::Session
- Class::Accessor
- Class::MakeMethods
- Config::General
- DBD::mysql
- Digest::MD5
- Digest::SHA
- DNS::ZoneParse (optional for importing Zonefiles)
- Encode
- Encode::Guess
- File::Temp
- HTML::Entities
- IO::Socket::INET6 (optional for IMAP authentication support)
- Locale::gettext
- Log::LogLite
- Math::BigInt::GMP (optional, but proposed for more performance!)
- Math::BigInt v1.87
- Net::CIDR
- Net::DNS (optional for importing Zonefiles)
- Net::IPv6Addr
- Net::Ping (optional for Ping-Plugin)
- Net::SNMP
- Pod::WSDL (optional for SAOP support)
- SOAP::Transport::HTTP (optional for SAOP support)
- SQL::Translator::Diff (optional for automatic database upgrade support)
- SQL::Translator v0.09000 (optional for automatic database upgrade support)
- Storable
- Template
- Text::CSV_XS (optional for importing CSV-Files)
- Time::Local
- Apache::DBI (optional for getting connection persistence when using mod-perl)
- HTTP Server
- SQL Database
You can use the scripts 'bin/checkPerlDependencies.bash', 'bin/checkPerlOptionals.bash' or the testpage "/cgi-bin/test.cgi" to check for dependencies.
INSTALLATION
1)
First, extract the archiv into a directory, from which the HTTP server will process it and check dependencies.
2)
If needed, accommodate the file/directory permissions, so the HTTP server will have no problems.
/logs : HTTPServer (rwx)
/spool : HTTPServer (rwx)
3)
Modify the HaCi.conf.sample (/etc) for your needs.
It can be stored either in '/etc/HaCi.conf' or '/etc/HaCi.conf'.
'/etc/HaCi.conf' has precedence.
4)
Configure your database and webserver, for serving your new tool.
e.g.:
- MySQL
---------------------- 8< ---------------------
CREATE USER 'HaCi'@'localhost' IDENTIFIED BY '';
GRANT USAGE ON *.* TO 'HaCi'@'localhost' IDENTIFIED BY '';
CREATE DATABASE `HaCi`;
GRANT ALL PRIVILEGES ON `HaCi`.* TO 'HaCi'@'localhost' WITH GRANT OPTION;
---------------------- 8< ---------------------
- Apache (httpd.conf)
---------------------- 8< ---------------------
ServerName haci.domain.tld
DocumentRoot /var/www/HaCi/html
ScriptAlias /cgi-bin/ /var/www/HaCi/cgi-bin/
# If you want to use Mod-Perl ---
PerlRequire /var/www/HaCi/etc/startup.pl
SetHandler perl-script
PerlHandler Apache::Registry # mod-perl1
PerlResponseHandler ModPerl::Registry # mod-perl2
#--------------------------------
Options +ExecCGI
AllowOverride All
Order allow,deny
allow from all
---------------------- 8< ---------------------
- lighttpd
- standalone (/etc/lighttpd/lighttpd.conf):
---------------------- 8< ---------------------
server.document-root = "/var/www/HaCi/html"
server.errorlog = "/var/www/HaCi/logs/error.log"
alias.url += ("/cgi-bin/" => "/var/www/HaCi/cgi-bin/")
---------------------- 8< ---------------------
- VHost (/etc/lighttpd/conf-available/20-HaCi.conf):
---------------------- 8< ---------------------
server.modules += ( "mod_simple_vhost" )
simple-vhost.server-root = "/var/www"
simple-vhost.document-root = "/html/"
simple-vhost.default-host = "HaCi"
alias.url += ( "/cgi-bin/" => "/var/www/HaCi/cgi-bin/" )
---------------------- 8< ---------------------
- activate CGI
- Debian:
ln -s /etc/lighttpd/conf-available/10-cgi.conf /etc/lighttpd/conf-enabled/
Edit '/etc/lighttpd/conf-available/10-cgi.conf' and comment the alias-Line out:
# alias.url += ( "/cgi-bin/" => "/usr/lib/cgi-bin/" )
#
- SuSE:
Edit '/etc/lighttpd/modules.conf' and enable following line:
include "conf.d/cgi.conf"
5)
HaCi Daemon (bin/HaCid.pl)
The HaCi daemon is responsible for the recurrent plugins. It runs them in defined intervals.
You can start it with the parameter '-c' therewith it exists after one full run and you can start it by crontab.
The daemon stores its PID in 'spool' and writes its logfile in 'logs'. So it must have write permissions to this directories.
6)
HaCiAPI
HaCi supports a SOAP-Interface for accessing the data not only from the webfrontend but also from a perl/php/... script.
You can find a short description and a demo perl script in the 'docs' directory.
7)
Look at 'http://sourceforge.net/projects/haci/' for new releases and
'http://haci.larsux.de' for a wiki and the latest infos about HaCi.
For exporting the last CVS version call
$ cvs -z3 -d:pserver:anonymous@haci.cvs.sourceforge.net:/cvsroot/haci export -D NOW HaCi
8)
FINISH
9) Additional comments
Cleanup Database
'bin/cleanupDatabase.pl'
This tool checks the database for stale and broken entries. Pass '-c' as parameter in order to cleanup found issues. Please make sure to backup your database before.
AUTHOR
Lars Wildemann
haci@larsux.de
# vim:ts=8
HaCi/bin/ 0000755 0001750 0001750 00000000000 11410502172 012265 5 ustar fighter fighter HaCi/bin/checkPerlOptionals.bash 0000755 0001750 0001750 00000005446 11345231162 016736 0 ustar fighter fighter #!/usr/bin/env bash
#
# Checking for optional Perl module dependencies
# It can try to install them automatically on demand
modules="Cache::FastMmap Cache::FileCache DNS::ZoneParse IO::Socket::INET6 Math::BigInt::GMP Net::DNS Net::Ping Pod::WSDL SOAP::Transport::HTTP SQL::Translator#0.09000 SQL::Translator::Diff Text::CSV_XS Apache::DBI"
aptget=`which apt-get 2>/dev/null`
yast2=`which yast2 2>/dev/null`
zypper=`which zypper 2>/dev/null`
cpan=`which cpan 2>/dev/null`
checkModules() {
index=0
echo "Checking if all optional Perl dependencies are available..."
for modt in $modules
do
if echo $modt | grep -q '#'; then
mod=`echo $modt|cut -d '#' -f 1`;
ver=`echo $modt|cut -d '#' -f 2`;
else
mod=$modt
ver=''
fi
echo -n "$mod"
if echo $modt | grep -q '#'; then echo -n " v$ver"; fi
echo -n ': '
if perl -e "use $mod $ver" 2>/dev/null;
then
echo "OK";
else
echo "NO";
failed[$index]=$mod
((index++))
fi
done
if [ "$index" -eq "0" ]
then
return 0
else
return 1
fi
}
showMissing() {
echo; echo "The following are missing:"
modIndex=0
while [ ${modIndex} -lt ${#failed[@]} ]
do
echo "${failed[$modIndex]}"
modIndex=$((${modIndex}+1))
done
}
checkModules
if [ "$?" -eq "0" ]; then echo; echo "Everything fine. All Dependencies are installed."; exit 0; fi
showMissing
if ( test -f /etc/debian_version && [ "$aptget" != "" ] && test -x $aptget); then bDebian=1; else bDebian=0; fi
if ( [ "$cpan" != "" ] && test -x $cpan); then bCpan=1; else bCpan=0; fi
if ( [ "$yast2" != "" ] && test -x $yast2); then bYast2=1; else bYast2=0; fi
if ( [ "$zypper" != "" ] && test -x $zypper); then bZypper=1; else bZypper=0; fi
if [ "$bDebian" -eq 0 ] && [ "$bCpan" -eq 0 ]
then
echo; echo "Don't know how to install these modules. Please do it by hand"
exit 0;
fi
echo; echo -n "Should I try to install them automatically? [y|N] "
read res
if [ "$res" != "y" ] && [ "$res" != "Y" ]; then exit 0; fi;
if [ "$bCpan" -eq 1 ];
then
echo; echo -n "Should I use CPAN? Please note that you have to have a C-Compiler like gcc installed. [Y|n] "
read res
if [ "$res" != "y" ] && [ "$res" != "Y" ] && [ "$res" != "" ]; then bCpan=0; fi;
fi
modIndex=0
while [ ${modIndex} -lt ${#failed[@]} ]
do
echo "${failed[$modIndex]}"
if [ "$bCpan" -eq 1 ];
then
$cpan ${failed[$modIndex]}
elif [ "$bDebian" -eq 1 ];
then
debPack=${failed[$modIndex]}
$aptget -y install lib${debPack//::/-}-perl
elif [ "$bYast2" -eq 1 ];
then
yastPack=${failed[$modIndex]}
$yast2 -i perl-${yastPack//::/-}
else
echo "Sorry, don't know how to get this module..."
fi
modIndex=$((${modIndex}+1))
done
checkModules
if [ "$?" -eq "1" ];
then
showMissing
echo; echo "Sorry, could't install all Dependencies. Try it by Hand."
else
echo; echo "Everything fine. All Dependencies are installed."
fi
exit 0
HaCi/bin/cleanupDatabase.pl 0000755 0001750 0001750 00000042532 11410500775 015716 0 ustar fighter fighter #!/usr/bin/perl
package HaCi::HaCi;
use warnings;
use strict;
local $| = 1;
use FindBin;
use lib "$FindBin::Bin/../modules";
chdir "$FindBin::Bin/..";
my $workDir = qx/pwd/;
chomp($workDir);
$ENV{workdir} = $workDir;
use Getopt::Std;
use Data::Dumper qw/Dumper/;
use HaCi::Conf;
use HaCi::Utils qw/getConfig getPlugins getTable initTables finalizeTables initCache/;
$Getopt::Std::STANDARD_HELP_VERSION = 1;
$main::VERSION = 0.1;
our $opts = {};
getopts('cd', $opts);
my $debug = (exists $opts->{d}) ? $opts->{d} : 0;
my @busy = ('|', '/', '-', '\\', '-');
my ($bc, $ec, $sc) = (0, 0, 0);
my ($userTable, $groupTable, $rootTable, $rootACTable, $networkTable, $networkV6Table, $networkACTable, $networkPluginTable,
$templateTable, $templateEntryTable, $templateValueTable, $pluginTable, $pluginConfTable, $pluginValueTable, $settingTable) = ();
our $conf; *conf = \$HaCi::Conf::conf;
&HaCi::Conf::init($workDir);
&getConfig();
&init();
&main();
exit 0;
#--------------------------------------------
END {
&finalizeTables();
}
sub init {
&initTables();
$userTable = $conf->{var}->{TABLES}->{user};
unless (defined $userTable) {
die "Cannot get users. DB Error (user)\n";
}
$groupTable = $conf->{var}->{TABLES}->{group};
unless (defined $groupTable) {
die "Cannot get groups. DB Error (group)\n";
}
$rootTable = $conf->{var}->{TABLES}->{root};
unless (defined $rootTable) {
die "Cannot get roots. DB Error (root)\n";
}
$rootACTable = $conf->{var}->{TABLES}->{rootAC};
unless (defined $rootACTable) {
die "Cannot get rootACs. DB Error (rootAC)\n";
}
$networkTable = $conf->{var}->{TABLES}->{network};
unless (defined $networkTable) {
die "Cannot get Networks. DB Error (network)\n";
}
$networkV6Table = $conf->{var}->{TABLES}->{networkV6};
unless (defined $networkV6Table) {
die "Cannot get Networks. DB Error (networkV6)\n";
}
$networkACTable = $conf->{var}->{TABLES}->{networkAC};
unless (defined $networkACTable) {
die "Cannot get networkACs. DB Error (networkAC)\n";
}
$networkPluginTable = $conf->{var}->{TABLES}->{networkPlugin};
unless (defined $networkPluginTable) {
die "Cannot get networkPlugins. DB Error (networkPlugin)\n";
}
$templateTable = $conf->{var}->{TABLES}->{template};
unless (defined $templateTable) {
die "Cannot get templates. DB Error (template)\n";
}
$templateEntryTable = $conf->{var}->{TABLES}->{templateEntry};
unless (defined $templateEntryTable) {
die "Cannot get templateEntrys. DB Error (templateEntry)\n";
}
$templateValueTable = $conf->{var}->{TABLES}->{templateValue};
unless (defined $templateValueTable) {
die "Cannot get templateValues. DB Error (templateValue)\n";
}
$pluginTable = $conf->{var}->{TABLES}->{plugin};
unless (defined $pluginTable) {
die "Cannot get plugins. DB Error (plugin)\n";
}
$pluginConfTable = $conf->{var}->{TABLES}->{pluginConf};
unless (defined $pluginConfTable) {
die "Cannot get pluginConfs. DB Error (pluginConf)\n";
}
$pluginValueTable = $conf->{var}->{TABLES}->{pluginValue};
unless (defined $pluginValueTable) {
die "Cannot get pluginValues. DB Error (pluginValue)\n";
}
$settingTable = $conf->{var}->{TABLES}->{setting};
unless (defined $settingTable) {
die "Cannot get settings. DB Error (setting)\n";
}
}
sub main {
if ($opts->{c}) {
print "\nPlease make sure to make a database backup before cleaning it up.\n";
if (system("which mysqldump >/dev/null") == 0) {
my $md = qx/which mysqldump/;
chomp($md);
my $dbConf = $conf->{user}->{db};
my $pwd = qx/pwd/;
chomp($pwd);
my $dbnameO = "$pwd/$dbConf->{dbname}.sql";
my $dbname = $dbnameO;
my $cnter = 1;
while ( -f $dbname ) {
$dbname = $dbnameO . '.' . $cnter++;
}
my $backupT = $md . " -u'$dbConf->{dbuser}' -p'XXX' -h'$dbConf->{dbhost}' '$dbConf->{dbname}' > $dbname";
print "Found 'mysqldump':\n\t$backupT\nShould I run this dump? [y|N]: ";
my $bb = ;
chomp($bb);
if (lc($bb) eq 'y') {
my $backupStr = $md . " -u'$dbConf->{dbuser}' -p'$dbConf->{dbpass}' -h'$dbConf->{dbhost}' '$dbConf->{dbname}' > $dbname";
print qx($backupStr);
if ($?) {
print "... Dump was NOT successful!!!\n";
} else {
print "... Dump was successful\n";
}
}
}
print "Continue cleaning up database? [y|N]: ";
my $con = ;
print "\n";
chomp($con);
exit 0 unless lc($con) eq 'y';
}
&checkRootStuff();
&checkBrokenNets();
&checkNetIDStuff();
&checkpluginIDStuff();
&checkTmplIDStuff();
print "\n$bc Items checked!\n";
print '' . ($sc + $ec) . " bad entries found. Deleted [" . $sc . " successful | " . $ec . " unsuccessful]\n" if $opts->{c};
if ($opts->{c} && $sc > 0) {
my $error = 0;
my ($aclCacheHandle, $netCacheHandle) = &initCache();
if (defined $netCacheHandle) {
warn "Cannot set Cache (netCache-DB!)\n" unless $netCacheHandle->set('DB', {});
warn "Cannot set Cache (netCache-FILL!)\n" unless $netCacheHandle->set('FILL', {});
warn "Cannot set Cache (netCache-NET!)\n" unless $netCacheHandle->set('NET', {});
} else {
$error = 1;
}
if (defined $aclCacheHandle) {
warn "Cannot set Cache (aclCache!)\n" unless $aclCacheHandle->set('HASH', {});
} else {
$error = 1;
}
warn "Cannot flush the cache. Please press the 'Flush Cache' button in the web gui.\n\n" if $error;
} else {
print "\nCall this script with '-c' in order to cleanup these issues: $0 -c\n\n";
}
}
sub checkRootStuff {
my $oEC = $ec;
my $oSC = $sc;
print "\nSearch for entries with bad rootID...\n";
# Get Roots
my @rootst = $rootTable->search(['ID'], 0, 0, 0, 1);
if ($#rootst == -1) {
print "\r No roots available\n";
return;
}
my $roots = '';
foreach (@rootst) {
$roots .= ',' if $roots;
$roots .= $_->{ID}
}
# Get stale V4
my @networksNR = $networkTable->search(['ID', 'network', 'description', 'rootID', 'ipv6ID'], {}, 0, "WHERE rootID NOT IN ($roots)");
foreach (@networksNR) {
my $ip = $_;
print "\r" . $busy[$bc++%5];
print "\r $ip->{network}:$ip->{rootID} ($ip->{ipv6ID}) => $ip->{description}: Stale V4 network entry (root doesn't exists)\n" if $debug;
&delEntry($networkTable, $ip->{ID});
}
print "\r " . ($#networksNR + 1) . " stale V4 network entrys found without matching root\n";
# Get stale V6
my @networkV6sNR = $networkV6Table->search(['ID', 'rootID'], {}, 0, "WHERE rootID NOT IN ($roots)");
foreach (@networkV6sNR) {
my $ip = $_;
print "\r" . $busy[$bc++%5];
print "\r $ip->{ID} : $ip->{rootID}: Stale V6 network entry (root doesn't exists)\n" if $debug;
&delEntry($networkV6Table, {ID => $ip->{ID}, rootID => $ip->{rootID}});
}
print "\r " . ($#networkV6sNR + 1) . " stale V6 network entrys found without matching root\n";
# Get stale networkAC
my @networkACsNR = $networkACTable->search(['ID', 'rootID'], {}, 0, "WHERE rootID NOT IN ($roots)");
foreach (@networkACsNR) {
my $ac = $_;
print "\r" . $busy[$bc++%5];
print "\r $ac->{ID} : $ac->{rootID}: Stale network ACL entry (root doesn't exists)\n" if $debug;
&delEntry($networkACTable, $ac->{ID});
}
print "\r " . ($#networkACsNR + 1) . " stale network ACL entrys found without matching root\n";
# Get stale rootAC
my @rootACsNR = $rootACTable->search(['ID', 'rootID'], {}, 0, "WHERE rootID NOT IN ($roots)");
foreach (@rootACsNR) {
my $ac = $_;
print "\r" . $busy[$bc++%5];
print "\r $ac->{ID} : $ac->{rootID}: Stale root ACL entry (root doesn't exists)\n" if $debug;
&delEntry($rootACTable, $ac->{ID});
}
print "\r " . ($#rootACsNR + 1) . " stale root ACL entrys found without matching root\n";
print "\n" if $debug;
print '' . (($sc - $oSC) + ($ec - $oEC)) . " bad entries found. Deleted [" . ($sc - $oSC) . " successful | " . ($ec - $oEC) . " unsuccessful]\n" if $opts->{c};
}
sub checkBrokenNets {
my $oEC = $ec;
my $oSC = $sc;
print "\nSearch for corrupt V6 networks...\n";
# get corrupt V6 networks
my $sNError = 0;
my $brokenNError = 0;
my @networks = $networkTable->search(['ID', 'network', 'description', 'rootID', 'ipv6ID'], {network => 0});
foreach (@networks) {
my $ip = $_;
my $v6ID = $_->{ipv6ID};
print "\r" . $busy[$bc++%5];
unless ($v6ID) {
print "\r $ip->{network}:$ip->{rootID} ($ip->{ipv6ID}) => $ip->{description}: NO network AND no v6ID!\n" if $debug;
$brokenNError++;
&delEntry($networkTable, $ip->{ID});
next;
}
my $ip6 = ($networkV6Table->search(['ID'], {ID => $ip->{ipv6ID}, rootID => $ip->{rootID}}))[0];
if (!defined $ip6) {
print "\r $ip->{network}:$ip->{rootID} ($ip->{ipv6ID}) => $ip->{description}: Stale network entry (no V6 part)\n" if $debug;
&delEntry($networkTable, $ip->{ID});
$sNError++;
}
}
print "\r $sNError stale network entrys found without matching V6 Part\n";
print " $brokenNError broken network entrys found\n";
my $sN6Error = 0;
my @v6Networks = $networkV6Table->search(['ID', 'rootID']);
foreach (@v6Networks) {
my $ip = $_;
my $v6ID = $_->{ID};
print "\r" . $busy[$bc++%5];
my $ip4 = ($networkTable->search(['ID'], {ipv6ID => $v6ID, rootID => $ip->{rootID}}))[0];
if (!defined $ip4) {
print "\r $v6ID : $ip->{rootID}: Stale V6 network entry (no network part)\n" if $debug;
&delEntry($networkV6Table, {ID => $ip->{ID}, rootID => $ip->{rootID}});
$sN6Error++;
}
}
print "\r $sN6Error stale V6 network entrys found without matching network Part\n";
print "\n" if $debug;
print '' . (($sc - $oSC) + ($ec - $oEC)) . " bad entries found. Deleted [" . ($sc - $oSC) . " successful | " . ($ec - $oEC) . " unsuccessful]\n" if $opts->{c};
}
sub checkNetIDStuff {
my $oEC = $ec;
my $oSC = $sc;
print "\nSearch for entries with bad network ID...\n";
# Get Networks
my @netst = $networkTable->search(['ID'], 0, 0, 0, 1);
if ($#netst == -1) {
print "\r No networks available\n";
return;
}
my $nets = {};
foreach (@netst) {
$nets->{$_->{ID}} = 1;
}
# Get stale networkAC
my @networkACs = $networkACTable->search(['ID', 'netID', 'ACL']);
my $cnter = 0;
foreach (@networkACs) {
my $ac = $_;
next if !$ac->{netID} && $ac->{ACL} == 4;
print "\r" . $busy[$bc++%5];
if (!exists $nets->{$ac->{netID}}) {
$cnter++;
&delEntry($networkACTable, $ac->{ID});
print "\r ACL $ac->{ID} : $ac->{netID}: Stale network ACL entry (network doesn't exists)\n" if $debug;
}
}
print "\r $cnter stale network ACL entrys found without matching network\n";
print "\n" if $debug;
# Get stale network plugins
my @networkPlugins = $networkPluginTable->search(['ID', 'netID']);
$cnter = 0;
foreach (@networkPlugins) {
my $plugin = $_;
print "\r" . $busy[$bc++%5];
if ($plugin->{netID} != -1 && !exists $nets->{$plugin->{netID}}) {
$cnter++;
&delEntry($networkPluginTable, $plugin->{ID});
print "\r ID $plugin->{ID} - netID $plugin->{netID}: Stale network plugin entry (network doesn't exists)\n" if $debug;
}
}
print "\r $cnter stale network Plugin entrys found without matching network\n";
print "\n" if $debug;
# Get stale plugin confs
my @pluginConfs = $pluginConfTable->search(['ID', 'netID']);
$cnter = 0;
foreach (@pluginConfs) {
my $plugin = $_;
print "\r" . $busy[$bc++%5];
if ($plugin->{netID} != -1 && !exists $nets->{$plugin->{netID}}) {
$cnter++;
&delEntry($pluginConfTable, $plugin->{ID});
print "\r ID $plugin->{ID} - netID $plugin->{netID}: Stale plugin config entry (network doesn't exists)\n" if $debug;
}
}
print "\r $cnter stale plugin config entrys found without matching network\n";
print "\n" if $debug;
# Get stale plugin values
my @pluginValues = $pluginValueTable->search(['ID', 'netID']);
$cnter = 0;
foreach (@pluginValues) {
my $plugin = $_;
print "\r" . $busy[$bc++%5];
if ($plugin->{netID} != -1 && !exists $nets->{$plugin->{netID}}) {
$cnter++;
&delEntry($pluginValueTable, $plugin->{ID});
print "\r ID $plugin->{ID} - netID $plugin->{netID}: Stale plugin value entry (network doesn't exists)\n" if $debug;
}
}
print "\r $cnter stale plugin value entrys found without matching network\n";
print "\n" if $debug;
# Get stale template values
my @templateValues = $templateValueTable->search(['ID', 'netID']);
$cnter = 0;
foreach (@templateValues) {
my $template = $_;
print "\r" . $busy[$bc++%5];
if ($template->{netID} != -1 && !exists $nets->{$template->{netID}}) {
$cnter++;
&delEntry($templateValueTable, $template->{ID});
print "\r ID $template->{ID} - netID $template->{netID}: Stale template value entry (network doesn't exists)\n" if $debug;
}
}
print "\r $cnter stale template value entrys found without matching network\n";
print "\n" if $debug;
print '' . (($sc - $oSC) + ($ec - $oEC)) . " bad entries found. Deleted [" . ($sc - $oSC) . " successful | " . ($ec - $oEC) . " unsuccessful]\n" if $opts->{c};
}
sub checkpluginIDStuff {
my $oEC = $ec;
my $oSC = $sc;
print "\nSearch for entries with bad plugin ID...\n";
# Get Plugins
my @pluginst = $pluginTable->search(['ID'], 0, 0, 0, 1);
if ($#pluginst == -1) {
print "\r No plugins available\n";
return;
}
my $plugins = {};
foreach (@pluginst) {
$plugins->{$_->{ID}} = 1;
}
# Get stale network plugins
my @networkPlugins = $networkPluginTable->search(['ID', 'pluginID']);
my $cnter = 0;
foreach (@networkPlugins) {
my $plugin = $_;
print "\r" . $busy[$bc++%5];
if (!exists $plugins->{$plugin->{pluginID}}) {
$cnter++;
&delEntry($networkPluginTable, $plugin->{ID});
print "\r ID $plugin->{ID} - netID $plugin->{pluginID}: Stale network plugin entry (plugin doesn't exists)\n" if $debug;
}
}
print "\r $cnter stale network Plugin entrys found without matching plugin\n";
print "\n" if $debug;
# Get stale plugin confs
my @pluginConfs = $pluginConfTable->search(['ID', 'pluginID']);
$cnter = 0;
foreach (@pluginConfs) {
my $plugin = $_;
print "\r" . $busy[$bc++%5];
if (!exists $plugins->{$plugin->{pluginID}}) {
$cnter++;
&delEntry($pluginConfTable, $plugin->{ID});
print "\r ID $plugin->{ID} - pluginID $plugin->{pluginID}: Stale plugin config entry (plugin doesn't exists)\n" if $debug;
}
}
print "\r $cnter stale plugin config entrys found without matching plugin\n";
print "\n" if $debug;
# Get stale plugin values
my @pluginValues = $pluginValueTable->search(['ID', 'pluginID']);
$cnter = 0;
foreach (@pluginValues) {
my $plugin = $_;
print "\r" . $busy[$bc++%5];
if (!exists $plugins->{$plugin->{pluginID}}) {
$cnter++;
&delEntry($pluginValueTable, $plugin->{ID});
print "\r ID $plugin->{ID} - pluginID $plugin->{pluginID}: Stale plugin value entry (plugin doesn't exists)\n" if $debug;
}
}
print "\r $cnter stale plugin value entrys found without matching plugin\n";
print "\n" if $debug;
print '' . (($sc - $oSC) + ($ec - $oEC)) . " bad entries found. Deleted [" . ($sc - $oSC) . " successful | " . ($ec - $oEC) . " unsuccessful]\n" if $opts->{c};
}
sub checkTmplIDStuff {
my $oEC = $ec;
my $oSC = $sc;
print "\nSearch for entries with bad template ID...\n";
# Get tmpls
my @tmplst = $templateTable->search(['ID'], 0, 0, 0, 1);
if ($#tmplst == -1) {
print "\r No templates available\n";
return;
}
my $tmpls = {
0 => 1
};
foreach (@tmplst) {
$tmpls->{$_->{ID}} = 1;
}
# Get stale networks
my @networks = $networkTable->search(['ID', 'tmplID']);
my $cnter = 0;
foreach (@networks) {
my $net = $_;
print "\r" . $busy[$bc++%5];
if (!exists $tmpls->{$net->{tmplID}}) {
$cnter++;
if ($opts->{c}) {
$networkTable->tmplID(0);
unless ($networkTable->update({ID => $net->{ID}})) {
warn $networkTable->errorStrs();
$ec++;
} else {
$sc++;
}
}
print "\r ID $net->{ID} - tmplID $net->{tmplID}: Stale network entry (template doesn't exists)\n" if $debug;
}
}
print "\r $cnter stale network entrys found without matching template\n";
print "\n" if $debug;
# Get stale template Entrys
my @tmplEntrys = $templateEntryTable->search(['ID', 'tmplID']);
$cnter = 0;
foreach (@tmplEntrys) {
my $tmplEntry = $_;
print "\r" . $busy[$bc++%5];
if (!exists $tmpls->{$tmplEntry->{tmplID}}) {
$cnter++;
&delEntry($templateEntryTable, $tmplEntry->{ID});
print "\r ID $tmplEntry->{ID} - tmplID $tmplEntry->{tmplID}: Stale templateEntry entry (template doesn't exists)\n" if $debug;
}
}
print "\r $cnter stale templateEntry entrys found without matching template\n";
print "\n" if $debug;
# Get stale template Values
my @tmplValues = $templateValueTable->search(['ID', 'tmplID']);
$cnter = 0;
foreach (@tmplValues) {
my $tmplValue = $_;
print "\r" . $busy[$bc++%5];
if (!exists $tmpls->{$tmplValue->{tmplID}}) {
$cnter++;
&delEntry($templateValueTable, $tmplValue->{ID});
print "\r ID $tmplValue->{ID} - tmplID $tmplValue->{tmplID}: Stale templateValue entry (template doesn't exists)\n" if $debug;
}
}
print "\r $cnter stale templateValue entrys found without matching template\n";
print "\n" if $debug;
print '' . (($sc - $oSC) + ($ec - $oEC)) . " bad entries found. Deleted/Modified [" . ($sc - $oSC) . " successful | " . ($ec - $oEC) . " unsuccessful]\n" if $opts->{c};
}
sub main::HELP_MESSAGE {
print "
NAME
cleanupDatabase.pl - clean up HaCi database
SYNOPSIS
$0 [-c] [-d]
OPTIONS
-c Clean up issues. Without this option issues will only be reported.
-d Debug mode. Show every issue.
Please make sure to make a database backup before cleaning it up.
";
}
sub delEntry {
my $table = shift;
my $ID = shift;
my $pk = (ref($ID) eq 'HASH') ? $ID : {ID => $ID};
if ($opts->{c}) {
unless($table->delete($pk)) {
warn $table->errorStrs();
$ec++;
} else {
$sc++;
}
}
}
# vim:ts=2:sts=2:sw=2
HaCi/bin/checkPerlDependencies.bash 0000755 0001750 0001750 00000005553 11341116466 017360 0 ustar fighter fighter #!/usr/bin/env bash
#
# Checking for Perl module dependencies
# It can try to install them automatically on Demand
modules="CGI CGI::Ajax CGI::Carp CGI::Cookie CGI::Session Class::Accessor Class::MakeMethods Config::General DBD::mysql Digest::MD5 Digest::SHA Encode Encode::Guess File::Temp HTML::Entities Locale::gettext Log::LogLite Math::BigInt#1.87 Net::CIDR Net::IPv6Addr Net::SNMP Storable Template Time::Local"
aptget=`which apt-get 2>/dev/null`
yast2=`which yast2 2>/dev/null`
zypper=`which zypper 2>/dev/null`
cpan=`which cpan 2>/dev/null`
checkModules() {
index=0
echo "Checking if all Perl Dependencies are available..."
for modt in $modules
do
if echo $modt | grep -q '#'; then
mod=`echo $modt|cut -d '#' -f 1`;
ver=`echo $modt|cut -d '#' -f 2`;
else
mod=$modt
ver=''
fi
echo -n "$mod"
if echo $modt | grep -q '#'; then echo -n " v$ver"; fi
echo -n ': '
if perl -e "use $mod $ver" 2>/dev/null;
then
echo "OK";
else
echo "NO";
failed[$index]=$mod
((index++))
fi
done
if [ "$index" -eq "0" ]
then
return 0
else
return 1
fi
}
showMissing() {
echo; echo "The following are missing:"
modIndex=0
while [ ${modIndex} -lt ${#failed[@]} ]
do
echo "${failed[$modIndex]}"
modIndex=$((${modIndex}+1))
done
}
checkModules
if [ "$?" -eq "0" ]; then echo; echo "Everything fine. All Dependencies are installed."; exit 0; fi
showMissing
if ( test -f /etc/debian_version && [ "$aptget" != "" ] && test -x $aptget); then bDebian=1; else bDebian=0; fi
if ( [ "$cpan" != "" ] && test -x $cpan); then bCpan=1; else bCpan=0; fi
if ( [ "$yast2" != "" ] && test -x $yast2); then bYast2=1; else bYast2=0; fi
if ( [ "$zypper" != "" ] && test -x $zypper); then bZypper=1; else bZypper=0; fi
if [ "$bDebian" -eq 0 ] && [ "$bCpan" -eq 0 ]
then
echo; echo "Don't know how to install these modules. Please do it by hand"
exit 0;
fi
echo; echo -n "Should I try to install them automatically? [y|N] "
read res
if [ "$res" != "y" ] && [ "$res" != "Y" ]; then exit 0; fi;
if [ "$bCpan" -eq 1 ];
then
echo; echo -n "Should I use CPAN? Please note that you have to have a C-Compiler like gcc installed. [Y|n] "
read res
if [ "$res" != "y" ] && [ "$res" != "Y" ] && [ "$res" != "" ]; then bCpan=0; fi;
fi
modIndex=0
while [ ${modIndex} -lt ${#failed[@]} ]
do
echo "${failed[$modIndex]}"
if [ "$bCpan" -eq 1 ];
then
$cpan ${failed[$modIndex]}
elif [ "$bDebian" -eq 1 ];
then
debPack=${failed[$modIndex]}
$aptget -y install lib${debPack//::/-}-perl
elif [ "$bYast2" -eq 1 ];
then
yastPack=${failed[$modIndex]}
$yast2 -i perl-${yastPack//::/-}
else
echo "Sorry, don't know how to get this module..."
fi
modIndex=$((${modIndex}+1))
done
checkModules
if [ "$?" -eq "1" ];
then
showMissing
echo; echo "Sorry, could't install all Dependencies. Try it by Hand."
else
echo; echo "Everything fine. All Dependencies are installed."
fi
exit 0
HaCi/bin/HaCid.pl 0000755 0001750 0001750 00000027436 11410134302 013605 0 ustar fighter fighter #!/usr/bin/perl
package HaCi::HaCi;
use warnings;
use strict;
local $| = 1;
use FindBin;
use lib "$FindBin::Bin/../modules";
chdir "$FindBin::Bin/..";
my $workDir = qx/pwd/;
chomp($workDir);
$ENV{workdir} = $workDir;
use Log::LogLite;
use Data::Dumper;
use POSIX;
use Getopt::Std;
use HaCi::Conf;
use HaCi::Mathematics qw/dec2net getBroadcastFromNet dec2ip net2dec getV6BroadcastNet getCidrFromDec getCidrFromNetv6Dec/;
use HaCi::Utils qw/
getConfig getPlugins getTable getNetworksForPlugin getPluginConfValues updatePluginLastRun getMaintInfosFromNet
initTables finalizeTables netID2Stuff getNextDBNetwork fillHoles getPluginLastRun
/;
$Getopt::Std::STANDARD_HELP_VERSION = 1;
$main::VERSION = 0.1;
my $log;
eval {
$log = new Log::LogLite($ENV{workdir} . '/logs/HaCid.log',3); $log->template('' . "\n");
};
die "Error while opening logfile. Has the user '$>' write access to the logfile '$ENV{workdir}/logs/HaCid.log'?: $@" if $@;
local $SIG{'__WARN__'} = sub {&log($_[0], 2)};
local $SIG{'__DIE__'} = sub {&diel(@_)};
my $progFile = $workDir . '/bin/HaCid.pl';
my @argv = @ARGV;
my $running = 1;
my $plugins = {};
my $pluginData = {};
my $nrOfChilds = 0;
my $maxChilds = 5;
my $pluginReload = 300;
my $lastReload = 0;
my $maxMemCon = 100000;
our $opts = {};
getopts('cdr', $opts);
our $conf; *conf = \$HaCi::Conf::conf;
&HaCi::Conf::init($workDir);
warn "WORKDIR: $workDir\n";
&getConfig();
$maxMemCon = $conf->{user}->{misc}->{maxmemconsumption} if exists $conf->{user}->{misc}->{maxmemconsumption} && $conf->{user}->{misc}->{maxmemconsumption};
if (my $nrOfProz = &checkProcessList()) {
if ($opts->{r} && $nrOfProz == 1) {
&log("Restarting successfull!\n", 3, 1);
} else {
&log("$nrOfProz Processes allready running!\n", 1, 1);
exit 0;
}
}
my $daemon = (exists $opts->{c} && $opts->{c}) ? 0 : 1;
my $debug = (exists $opts->{d} && $opts->{d}) ? 1 : 0;
push @argv, '-r' unless $opts->{r};
&daemonize() if $daemon;
local $SIG{ALRM} = sub {&log("checking Processes", 3); $nrOfChilds = &checkProcessList();alarm 60}; alarm 60;
&init();
&wrPID();
if ($daemon) {
while ($running) {
&checkMemConsumption();
&loadPlugins() if (time - $lastReload) >= $pluginReload;
&cleanupPluginData();
&main();
sleep 1;
}
} else {
&main();
}
&log("Finished!", 2);
&wrPID(1);
exit 0;
#--------------------------------------------
END {
&finalizeTables();
}
sub init {
&initTables();
}
sub main {
&log("starting Main...", 3);
foreach (keys %{$plugins}) {
my $pluginID = $_;
my $plugin = $plugins->{$pluginID}->{NAME};
if ($pluginData->{running}->{$pluginID}) {
&log("Plugin '$plugin' is allready running!", 3);
next;
}
$pluginData->{lastRuns}->{$pluginID} = &getPluginLastRun($pluginID);
if (my $child = &daemonize(1)) {
$pluginData->{running}->{$pluginID} = 1;
$pluginData->{PID}->{$child} = $pluginID;
next;
} else {
&log("Starting Plugin '$plugin'...", 3);
&processPlugin($pluginID);
&log("Plugin '$plugin' sucessfully processed", 3);
exit 0;
}
}
}
sub processPlugin {
my $pluginID = shift;
my $plugin = $plugins->{$pluginID}->{NAME};
&initTables();
my $pluginGlobConfig = &getPluginConfValues($pluginID, -1);
my $interval = $pluginGlobConfig->{def_glob_recurrent_interval};
$interval = 3600 unless defined $interval;
unless (defined $interval && $interval > 0) {
$interval = 'undef' unless defined $interval;
&log(" Interval ($interval) for Plugin '$plugin' is not defined or too small!", 1);
$pluginData->{running}->{$pluginID} = 0;
return ;
}
my $timeDiff = time - ($pluginData->{lastRuns}->{$pluginID} || 0);
if ($timeDiff < $interval) {
&log(" Interval for Plugin '$plugin' is not reached ($timeDiff < $interval)", 3);
$pluginData->{running}->{$pluginID} = 0;
return;
}
&log(" loading Plugin $plugin ($pluginID)...", 3);
my $package = $plugins->{$pluginID}->{PACKAGE};
(my $packageFile = $package . '.pm') =~ s/::/\//g;
eval {
require $packageFile;
};
if ($@) {
&log(" Cannot load Plugin '$plugin': $@", 1);
$pluginData->{running}->{$pluginID} = 0;
return;
}
&log(" getting Networks for Plugin $plugin ($pluginID)...", 3);
my @networkst = &getNetworksForPlugin($pluginID);
my $config = {};
my $networks = [];
foreach (@networkst) {
my $netID = $_;
$config->{$netID} = &getPluginConfValues($pluginID, $netID);
my $netInfos = &getMaintInfosFromNet($netID);
next unless exists $netInfos->{network};
my $onlyHosts = (exists $config->{$netID}->{def_recurrent_onlyHosts} && $config->{$netID}->{def_recurrent_onlyHosts}) ? 1 : 0;
if (!$onlyHosts || $onlyHosts &&
(($netInfos->{ipv6} && &getCidrFromNetv6Dec($netInfos->{network}) == 128) || (!$netInfos->{ipv6} && &getCidrFromDec($netInfos->{network}) == 32))
) {
$netInfos->{origin} = $netID;
push @{$networks}, $netInfos;
}
if ($config->{$netID}->{def_recurrent_withSubnets}) {
my @childs = &getSubnets(0, $netID, $config->{$netID}->{def_recurrent_maxdepth} || 1, $onlyHosts, $netID);
foreach (@childs) {
push @{$networks}, $_;
}
}
}
&log(" " . ($#{$networks} + 1) . ' Networks found for Plugin ' . $plugin . '!', 2);
$config->{-1} = $pluginGlobConfig;
&log(" initiating Plugin $plugin ($pluginID)...", 3);
my $plug;
eval {
$plug = $package->new($pluginID, $conf->{var}->{TABLES}->{pluginValue});
};
if ($@) {
&log(" Error while initiating Plugin '$plugin': $@", 1);
$pluginData->{running}->{$pluginID} = 0;
return;
}
&log(" running Plugin $plugin ($pluginID)...", 2);
$pluginData->{lastRuns}->{$pluginID} = time;
&updatePluginLastRun(
$pluginID,
$pluginData->{lastRuns}->{$pluginID},
0,
''
);
eval {
$plug->run_recurrent($networks, $config);
};
if ($@) {
&log(" Error while running Plugin '$plugin': $@", 1);
}
my $error = 0;
my $errorStr = '';
if ($plug->can('ERROR')) {
$error = $plug->ERROR();
} else {
&log(" Plugin has no ERROR Method!", 2);
}
if ($plug->can('ERRORSTR')) {
$errorStr = $plug->ERRORSTR();
} else {
&log(" Plugin has no ERRORSTR Method!", 2);
}
my $runtime = time - $pluginData->{lastRuns}->{$pluginID};
$pluginData->{running}->{$pluginID} = 0;
&log(" Plugin $plugin finished ($runtime Seconds Runtime)", 2);
&updatePluginLastRun(
$pluginID,
-1,
$runtime,
(($error) ? $errorStr : '')
);
undef $plug;
}
sub getSubnets {
my $level = shift;
my $netID = shift;
my $maxDepth = shift;
my $onlyHosts = shift;
my $origin = shift;
my $subnets = [];
$level++;
my ($rootID, $networkDec, $ipv6) = &netID2Stuff($netID);
my $broadcast = ($ipv6) ? &getV6BroadcastNet($networkDec, 128) : &net2dec(&dec2ip(&getBroadcastFromNet($networkDec)) . '/32');
my $networkT = undef;
while ($networkT = &getNextDBNetwork($rootID, $ipv6, $networkDec)) {
last if $networkT->{network} == $networkDec || $networkT->{network} > $broadcast;
if (!$onlyHosts || $onlyHosts &&
(($ipv6 && &getCidrFromNetv6Dec($networkT->{network}) == 128) || (!$ipv6 && &getCidrFromDec($networkT->{network}) == 32))
) {
$networkT->{origin} = $origin;
push @{$subnets}, $networkT;
}
push @{$subnets}, &getSubnets($level, $networkT->{ID}, $maxDepth, $onlyHosts, $origin) if $level < $maxDepth;
$networkDec = ($ipv6) ? &getV6BroadcastNet($networkT->{network}, 128) : &net2dec(&dec2ip(&getBroadcastFromNet($networkT->{network})) . '/32');
}
return @{$subnets};
}
sub loadPlugins {
&initTables();
$plugins = &getPlugins();
$lastReload = time;
foreach (keys %{$plugins}) {
my $pluginID = $_;
my $plugin = $plugins->{$pluginID}->{NAME};
unless ($plugins->{$pluginID}->{RECURRENT} && $plugins->{$pluginID}->{ACTIVE}) {
delete $plugins->{$pluginID};
next;
}
}
&log((scalar keys %{$plugins}) . " recurrent Plugin(s) found\n", 2);
}
sub daemonize {
my $return = shift || 0;
&log("Maximal number of Childs reached ($maxChilds)", 3) if $nrOfChilds >= $maxChilds;
while ($nrOfChilds >= $maxChilds) {
sleep 1;
}
$SIG{'INT'} = $SIG{'HUP'} = $SIG{'TERM'} = \&exitHandler;
$SIG{'CHLD'} = \&reaper;
my ($sessID, $pid);
if ($pid = &fork) {
$nrOfChilds++;
&log("New Child forked ($pid)! ($nrOfChilds/$maxChilds)", 3);
if ($return) {
return $pid;
} else {
print "Daemon started...\n";
exit 0;
}
}
unless ($sessID = POSIX::setsid()) {
&log("Cannot detach from controlling terminal", 1);
die "Cannot detach from controlling terminal";
}
chdir "/";
umask 0;
foreach (0 .. POSIX::sysconf(&POSIX::_SC_OPEN_MAX)) {
POSIX::close($_);
}
open(STDIN, "+>/dev/null");
open(STDOUT, "+>&STDIN");
# open(STDERR, "+>&STDIN");
$log = new Log::LogLite($ENV{workdir} . '/logs/HaCid.log',3); $log->template('' . "\n");
return 0;
}
sub fork {
my $pid;
FORK: {
if (defined($pid = fork)) {
} elsif ($! =~ /No more process/) {
&log("Cannot fork: $!", 1);
sleep 5;
redo FORK;
} else {
die "Can't fork: $!";
}
}
return $pid;
}
sub diel {
my @msg = @_;
&log(join(', ', @msg), 1);
die $msg[0];
}
sub log {
my $msg = shift;
my $level = shift || 1;
my $local = shift || 0;
$msg = (($level == 1) ? 'ERROR' : ($level == 2) ? 'INFO' : 'DEBUG') . ': ' . $msg;
$msg = $$ . ': ' . $msg;
if (defined $log) {
chomp($msg);
$log->write($msg, $level) if $level < 3 || $debug;
print STDERR "$msg\n" if $local;
} else {
print STDERR "$msg\n";
}
}
sub reaper {
my $child;
while (($child = waitpid(-1, WNOHANG)) > 0) {
sleep 1;
$pluginData->{running}->{$pluginData->{PID}->{$child}} = 0 if exists $pluginData->{PID}->{$child};
$nrOfChilds--;
&log(" Child '$child' exited with: $? ($nrOfChilds/$maxChilds)", 3);
}
$SIG{CHLD} = \&reaper;
}
sub exitHandler {
my $sig = shift;
&log("Catching SIG$sig", 2);
if ($sig eq 'HUP') {
&loadPlugins();
}
elsif ($sig eq 'INT' || $sig eq 'TERM') {
$running = 0;
}
}
sub getPID {
unless (open PID, $conf->{static}->{path}->{hacidpid}) {
&log("Cannot open Pidfile '$conf->{static}->{path}->{hacidpid}' for reading: $!", 2);
return;
}
my $pid = ;
close PID;
return $pid;
}
sub checkProcessList {
my $pid = &getPID();
my $nrOfProz = ($pid) ? qx(ps -p $pid --no-headers | wc -l) : 0;
chomp($nrOfProz);
return $nrOfProz;
}
sub cleanupPluginData {
my $plugin = {};
foreach (keys %{$pluginData->{PID}}) {
my $pid = $_;
my $pluginID = $pluginData->{PID}->{$pid};
my $nrOfProcs = qx/ps -p $pid h | wc -l/;
if (int($nrOfProcs)) {
$plugin->{$pluginID} = 1;
} else {
$plugin->{$pluginID} = 0 unless exists $plugin->{$pluginID};
delete $pluginData->{PID}->{$pid};
}
}
foreach (keys %{$plugin}) {
my $pluginID = $_;
unless ($plugin->{$pluginID}) {
&log(" Clear Plugin '$pluginID' from pluginData, because no Child is working on this Plugin", 3);
$pluginData->{running}->{$pluginID} = 0;
}
}
}
sub main::HELP_MESSAGE {
print "
NAME
HaCid - HaCi Daemon - runns HaCi Plugins periodically
SYNOPSIS
HaCid [-c] [-d]
OPTIONS
-c Cronjob mode. Don't run as daemon. Program exits after one full run
-d Debug mode. Logging all debug messages
";
}
sub wrPID {
my $del = shift || 0;
if ($del) {
unless (unlink $conf->{static}->{path}->{hacidpid}) {
&log("Cannot delete Pidfile '$conf->{static}->{path}->{hacidpid}': $!", 2);
return;
}
} else {
unless (open PID, '>' . $conf->{static}->{path}->{hacidpid}) {
&log("Cannot write Pidfile '$conf->{static}->{path}->{hacidpid}': $!", 2);
return;
}
print PID $$;
close PID;
}
}
sub checkMemConsumption {
my $size = 0;
open PIPE, "/bin/ps wwaxo 'pid,rss' |";
while() {
next unless /^\s*$$\s/;
s/^\s+//g;
chomp;
$size = (split(' ', $_))[1];
}
close PIPE;
&log("Checking size: ${size}kB (max ${maxMemCon}kB)", 3);
if($size > $maxMemCon) {
&log("Max Memory Size reached: ${size}kB/${maxMemCon}kB, restarting ($progFile @ARGV)...", 2);
exec $progFile, @argv or die "Restart failed: $!";
}
}
# vim:ts=2:sts=2:sw=2
HaCi/etc/ 0000755 0001750 0001750 00000000000 11410502172 012270 5 ustar fighter fighter HaCi/etc/internal.conf 0000644 0001750 0001750 00000015067 11410500775 014773 0 ustar fighter fighter # This config is for internal use only.
# Only touch if you know what you are doing!
workdir = $workdir
templateIncludePath = $workdir/Template
templateCompilePath = $workdir/spool
spoolPath = $workdir/spool
authModules = $workdir/modules/HaCi/Authentication
plugins = $workdir/modules/HaCi/Plugins
localePath = $workdir/locale
statusFile = $workdir/spool/status
cacheFile = $workdir/spool/cache
tableHashFile = $workdir/spool/tableHash
HaCid = $workdir/bin/HaCid.pl
templateInit = HaCi.tmpl
imagePathRel = /Images
configFile = HaCi.conf
whois = /usr/bin/whois
imagePath = ${workdir}${imagePathRel}
HaCidPID = ${spoolPath}/HaCid.pid
titleShort = HaCi
titleLong = HaCi - IP Address Administration
version = 0.97c
jsSrcDir = /
jsSrc = /HaCi.js
imagePathRel = /Images
logo = ${imagePathRel}/logo.png
style = bright
maxSubnetSize = 8
enableLocaleSupport = 1
ID = C
name = English
ID = de_DE
name = Deutsch
ID = it_IT
name = Italiano
ID = bright
name = bright
file = /HaCi.css
descr = Bright Layout
ID = black
name = black
file = /HaCi_black.css
descr = Black Layout
debug = 0
ripeDB = 193.0.6.135
sessionTimeout = +1h
maxMemConsumption = 100000
disableCache = 0
searchLimit = 1000
name = UNSPECIFIED
ID = 0
name = ALLOCATED PA
ID = 3
minSize = 21
banParents = 1, 2, 16, 5
name = ALLOCATED PI
ID = 4
minSize = 21
banParents = 1, 2, 16, 5
name = ALLOCATED UNSPECIFIED
ID = 17
banParents = 1, 2, 16, 5
name = SUB-ALLOCATED PA
ID = 15
parents = 3
minSize = 24
banParents = 1, 2, 16
name = LIR-PARTITIONED PA
ID = 6
banParents = 1, 2, 16
name = LIR-PARTITIONED PI
ID = 10
banParents = 1, 2, 16
name = EARLY REGISTRATION
ID = 5
banParents = 1, 2, 16
name = NOT-SET
ID = 11
name = ASSIGNED PA
ID = 1
banish = 1, 2, 16
parents = 3, 17, 15, 6, 5
name = ASSIGNED PI
ID = 2
banish = 1, 2, 16, 5
parents = 4, 17, 10
name = ASSIGNED ANYCAST
ID = 16
banish = 1, 2, 16
parents = 3, 4, 17, 15, 10, 6
name = ALLOCATED-BY-RIR
ID = 12
minSize = 32
banParents = 14
ipv6 = 1
name = ALLOCATED-BY-LIR
ID = 13
parents = 12, 13
banParents = 14
ipv6 = 1
name = ASSIGNED
ID = 14
minSize = 48
parents = 12, 13
banish = 14
ipv6 = 1
name = IN USE
parents = 1, 2, 16, 14
ID = 18
name = RESERVED
ID = 7
name = LOCKED
ID = 8
name = FREE
ID = 9
<0>
long = User Management
short = userMgmt
order = 0
0>
<1>
long = Group Management
short = groupMgmt
order = 1
1>
<2>
long = Template Management
short = tmplMgmt
order = 2
2>
<3>
long = Show Roots
short = showRoots
order = 4
3>
<4>
long = Show Root Details
short = showRootDet
order = 5
4>
<5>
long = Add Root
short = addRoot
order = 6
5>
<6>
long = Edit Root
short = editRoot
order = 7
6>
<7>
long = Show Networks
short = showNets
order = 8
7>
<8>
long = Show Network Details
short = showNetDet
order = 9
8>
<9>
long = Add Network
short = addNet
order = 10
9>
<10>
long = Edit Network
short = editNet
order = 11
10>
<11>
long = Edit Tree
short = editTree
order = 12
11>
<12>
long = Import ASN Routes
short = impASNRoutes
order = 13
12>
<13>
long = Import DNS Zonefile
short = impDNS
order = 14
13>
<14>
long = Import Config
short = impConfig
order = 15
14>
<15>
long = SearchCompare
short = search
order = 16
15>
<16>
long = Plugin Management
short = pluginMgmt
order = 3
16>
type = label
value = Defaults for mode 'on Demand'
type = label
value = Defaults for mode 'recurrent'
name = def_recurrent_withSubnets
descr = With Subnetworks
type = checkbox
checked = 0
help = Work also with Subnetworks
name = def_recurrent_onlyHosts
descr = Only IP addresses
type = checkbox
checked = 0
help = Work only with IP addresses
name = def_recurrent_maxdepth
descr = Max Depth
type = textbox
size = 1
maxLength = 10
help = Max subnet depth
value = 1
name = def_recurrent_resetLastRun
descr = Reset last run
type = checkbox
checked = 0
help = Reset last run so that the Plugin will be run as soon as possible
nodb = 1
value = Defaults for mode 'on Demand'
type = label
value = Defaults for mode 'recurrent'
type = label
name = def_glob_recurrent_interval
descr = Interval (sec)
type = textbox
size = 3
maxLength = 10
help = Time between 2 runs
value = 300
name = def_glob_recurrent_resetLastRun
descr = Reset last run
type = checkbox
checked = 0
help = Reset last run so that the Plugin will be run as soon as possible
nodb = 1
type = hline
thisScript = ${SCRIPT_NAME}
showSubs = 0
status =
# vim:ts=8
HaCi/etc/HaCi.conf.sample 0000644 0001750 0001750 00000002757 11345231162 015243 0 ustar fighter fighter # database parameters
dbHost = localhost
dbName = HaCi
dbUser = HaCi
dbPass = geheim!
# GUI parameters
root = FF0000
new = 777777
reserved = FF00F0
locked = AAAAAA
free = 00AA00
assigned = 000000
invisible = FFFFFF
netBorder = 5555FF
searched = FFAAAA
# technical contact
techContact = support@domain.tld
# preferred style
# bright
# black
style = bright
# direct access to network functions by icons
directAccess = 1
# show error details instead of a basic error warnings
showErrorDetails = 1
# max. number (2^?) of calculated (free) subnets (2^8 => 256)
maxSubnetSize = 8
# show structure of the tree (with lines)
showTreeStructure = 1
# enable locales support (default 1)
enableLocaleSupport = 1
# maximum memory consumption in kB for the HaCi Daemon. If this limit is reached, HaCid will be restarted automatically
maxMemConsumption = 50000
# disable caching mechanismen
disableCache = 0
# automatically upgrade database if needed
autoUpgradeDatabase = 1
# suppress database upgrade error messages if you are sure that everything is okay
ignoreUpgradeFailures = 0
# authentication parameters
## authentication modules
# internal: internal auth
# imap : IMAP auth
authModule = internal
# authenticationmodule parameters
# host = imap.server.tld
# authtype = login
# vim:ts=8
HaCi/etc/startup.pl 0000644 0001750 0001750 00000000604 11345231162 014334 0 ustar fighter fighter use strict;
use FindBin;
$ENV{MOD_PERL} or die "not running under mod_perl!";
use ModPerl::Registry;
use Apache::DBI;
use CGI ();
CGI->compile();
use Digest::SHA;
use CGI::Session;
use CGI::Cookie;
use CGI::Ajax;
use Math::BigInt;
use Math::BigInt::FastCalc;
use Config::General qw(ParseConfig);
use Cache::FastMmap;
use Net::CIDR;
use Net::IPv6Addr;
use Locale::gettext;
use Storable;
HaCi/etc/startup.pl.sample 0000644 0001750 0001750 00000000413 11003701764 015613 0 ustar fighter fighter use strict;
$ENV{MOD_PERL} or die "not running under mod_perl!";
use Apache::Registry ();
use Apache::DBI ();
use DBI ();
use CGI ();
CGI->compile();
use Digest::SHA;
use CGI::Session;
use CGI::Cookie;
use File::Cache;
use Math::BigInt;
use Math::BigInt::FastCalc;
HaCi/logs/ 0000775 0001750 0000041 00000000000 11410502173 012557 5 ustar fighter www-data HaCi/logs/.log_directory 0000644 0001750 0001750 00000000000 10526336525 015333 0 ustar fighter fighter HaCi/locale/ 0000755 0001750 0001750 00000000000 11410502173 012755 5 ustar fighter fighter HaCi/locale/de/ 0000755 0001750 0001750 00000000000 11410502173 013345 5 ustar fighter fighter HaCi/locale/de/LC_MESSAGES/ 0000755 0001750 0001750 00000000000 11410502173 015132 5 ustar fighter fighter HaCi/locale/de/LC_MESSAGES/HaCi.po 0000644 0001750 0001750 00000052042 11341116466 016312 0 ustar fighter fighter domain "HaCi"
#: login
msgid "Authentication"
msgstr "Benutzeranmeldung"
msgid "Language"
msgstr "Sprache"
msgid "Username"
msgstr "Benutzername"
msgid "Password"
msgstr "Passwort"
msgid "Authentication failed!"
msgstr "Authentifizierung schlug fehl!"
msgid "Authentication failed: User not found!"
msgstr "Authentifizierung schlug fehl: Benutzername wurde nicht gefunden!"
msgid "No User given"
msgstr "Keinen Usernamen angegeben"
msgid "Session is expired"
msgstr "Ihre Sitzung ist abgelaufen"
msgid "Authentication failed: Database Error!"
msgstr "Authentifizierung schlug fehl: Datenbank Fehler"
msgid "Authentication failed: Password doesn't match!"
msgstr "Authentifizierung schlug fehl: Passwort stimmt nicht!"
msgid "Support"
msgstr "Unterstützt"
#: misc
msgid "or"
msgstr "oder"
msgid "NEW"
msgstr "NEU"
msgid "Users"
msgstr "Benutzer"
msgid "New User"
msgstr "Neuer Benutzer"
msgid "New Group"
msgstr "Neue Gruppe"
msgid "New Template"
msgstr "Neue Vorlage"
msgid "Login"
msgstr "Anmelden"
msgid "Save result under"
msgstr "Ergebnis speichern unter"
msgid "Right"
msgstr "Rechts"
msgid "Left"
msgstr "Links"
msgid "Compare"
msgstr "Vergleichen"
msgid "Target"
msgstr "Ziel"
msgid "Search,Compare"
msgstr "Suchen, Vergleichen"
msgid "Import ASN Routes"
msgstr "ASN Routen importieren"
msgid "Import DNS Zonefile"
msgstr "DNS Zonefile importieren"
msgid "No IP Addresses found for Origin '%s'."
msgstr "Keine IP Adressen für Origin '%s' gefunden."
msgid "Zone transfer failed: %s"
msgstr "Zonefile transfer fehlgeschlagen: %s"
msgid "Import Config"
msgstr "Konfig importieren"
msgid "No File given!"
msgstr "Keine Datei mitgegeben!"
msgid "Cannot open File in Binmode: %s"
msgstr "Konnte Datei nicht im Binär-Modus öffnen: %s"
msgid "%i IP Addresses found for Origin '%s'. %i were successfully saved under Root '%s'"
msgstr "%i IP Adressen gefunden für Origin '%s'. %i wurden erfolgreich unter dem Startpunkt '%s' gespeichert."
msgid "No Origin given or found!"
msgstr "Kein Origin angegeben oder gefunden"
msgid "Edit Network"
msgstr "Netz bearbeiten"
msgid "Show Root Details"
msgstr "Startpunkt Details anzeigen"
msgid "Show Roots"
msgstr "Startpunke anzeigen"
msgid "Show Networks"
msgstr "Netze anzeigen"
msgid "Show Network Details"
msgstr "Netz Details anzeigen"
msgid "Edit Root"
msgstr "Startpunkt bearbeiten"
msgid "Root Name"
msgstr "Startpunkt"
msgid "Cannot read ConfigFile '%s': %s"
msgstr "Kann die Konfigurations Datei '%s' nicht zum lesen öffnen: %s"
msgid "Abort"
msgstr "Abbrechen"
msgid "Submit"
msgstr "Speichern"
msgid "Change"
msgstr "Ändern"
msgid "New"
msgstr "Neu"
msgid "Delete"
msgstr "Löschen"
msgid "Combine"
msgstr "Zusammenfassen"
msgid "DNS Info for %s"
msgstr "DNS Info für %s"
msgid "RIPE Info for %s"
msgstr "RIPE Info für %s"
msgid "unknown"
msgstr ""
msgid "Nothing found"
msgstr "Nichts gefunden"
msgid "Error while deleting '%s' from '%s': %s"
msgstr "Fehler beim Löschen '%s' von '%s': %s"
msgid "Successfully deleted '%s' from '%s' (%i Networks deleted)"
msgstr "Erfolgreich '%s' von '%s' gelöscht (%i Netze gelöscht)"
msgid "None"
msgstr "Keine"
msgid "invisible"
msgstr "unsichtbar"
msgid "read"
msgstr "lesen"
msgid "write"
msgstr "schreiben"
msgid "Group"
msgstr "Gruppe"
msgid "CSV Preview"
msgstr "CSV Vorschau"
msgid "Cannot parse any CSV Data"
msgstr "Konnte keine CSV Daten parsen"
msgid "[ permission denied ]"
msgstr "[ Zugriff verweigert ]"
msgid "This Network is locked"
msgstr "Dieses Netz ist gesperrt"
msgid "This Network is reserved"
msgstr "Dieses Netz ist reserviert"
msgid "This Network is free"
msgstr "Dieses Netz ist frei"
msgid "Contact"
msgstr "Kontakt"
msgid "Successfully updated Table '%s'."
msgstr "Die Tabelle '%s' wurde erfolgreich aktualisiert."
msgid "Cannot update Table '%s': %s. Please correct this issue by hand (i.e.: remove duplicate entries)!"
msgstr "Konnte Tabelle '%s' nicht aktualisieren: %s. Bitte korrigieren Sie diesen Fehler per Hand (z.B.: doppelte Einträge löschen)!"
msgid "Cannot upgrade tables automatically. Required modules are not available (%s)."
msgstr "Keine automatische Aktualisierung der Tabellen möglich. Benötigte Module sind nicht verfügbar (%s)."
msgid "Automatic upgrade of database disabled. Please upgrade the database schema by hand."
msgstr "Automatische Aktualisierung der Datenbank nicht aktiviert. Bitte aktualisieren Sie das Datenbankschema per Hand."
#: menu
msgid "Back"
msgstr "Zurück"
msgid "Tree"
msgstr "Baum"
msgid "Overview"
msgstr "Übersicht"
msgid "Network"
msgstr "Netzwerk"
msgid "Show all Nets"
msgstr "Zeige alle Netze"
msgid "Add Root"
msgstr "Startpunkt hinzufügen"
msgid "Add Network"
msgstr "Netz hinzufügen"
msgid "Import"
msgstr "Importieren"
msgid "ASN Routes"
msgstr "ASN Routen"
msgid "Add Network %s"
msgstr "Netz %s hinzufügen"
msgid "Edit Network %s"
msgstr "Netz %s bearbeiten"
msgid "Separator"
msgstr "Separator"
msgid "Miscellaneous"
msgstr "Sonstiges"
msgid "Search"
msgstr "Suchen"
msgid "Exact"
msgstr "Exakt"
msgid "Fuzzy Search"
msgstr "Unscharfe Suche"
msgid "Wildcard"
msgstr "Platzhalter"
msgid "Maintenance"
msgstr "Verwaltung"
msgid "User Management"
msgstr "Benutzerverwaltung"
msgid "Group Management"
msgstr "Gruppenverwaltung"
msgid "Logged in as %s"
msgstr "Angemeldet als %s"
msgid "Logout"
msgstr "Abmelden"
msgid "Random Tree"
msgstr "Zufälliger Baum"
msgid "Template Management"
msgstr "Vorlagenverwaltung"
msgid "Flush Cache"
msgstr "Cache leeren"
msgid "About HaCi"
msgstr "Über HaCi"
#: Import
msgid "Import from DNS Zonefiles"
msgstr "von DNS Zonefiles importieren"
msgid "Local Zonefile"
msgstr "Lokales Zonefile"
msgid "%i Routes found. Saved %i new Inetnums of %i found"
msgstr "%i Routen gefunden. %i neue Inetnums von %i gefundenen gesichert"
msgid "Import from Config File"
msgstr "Aus Konfig-Dateien importieren"
msgid "Source"
msgstr "Quelle"
msgid "Config"
msgstr "Konfig"
msgid "Cannot add Root"
msgstr "Kann Startpunkt nicht erstellen"
msgid "AS Number"
msgstr "AS Nummer"
msgid "Remove obsoletes"
msgstr "Alte löschen"
msgid "Only insert new"
msgstr "Nur Neue hinzufügen"
msgid "No Config given!"
msgstr "Keine Konfiguration übergeben!"
#: addRoot
msgid "Name of Root"
msgstr "Name des Startpunktes"
msgid "Description"
msgstr "Beschreibung"
msgid "Sorry, you have to give me a name!"
msgstr "Bitte gib mir einen Namen!"
msgid "Details of Root %s"
msgstr "Details des Startpunktes %s"
msgid "Number of Networks"
msgstr "Anzahl der Subnetze"
msgid "Sorry, this Root '%s' allready exists!"
msgstr "Dieser Startpunkt '%s' existiert schon!"
#: addNet
msgid "Available Variables from the Plugins"
msgstr "Verfügbare Variablen der Plugins"
msgid "Description Helper"
msgstr "Hilfe für die Beschreibung"
msgid "Insert"
msgstr "Einfügen"
msgid "Order"
msgstr "Reihenfolge"
msgid "New Line"
msgstr "Neue Zeile"
msgid "Netaddress"
msgstr "Netzwerk Adresse"
msgid "Netmask"
msgstr "Netz Maske"
msgid "CIDR"
msgstr "CIDR"
msgid "Target Root"
msgstr "Zielpunkt"
msgid "Sorry, you have to give me a %s!"
msgstr "Ich brauche noch ein %s"
msgid "Sorry, this is not a correct Network: %s!"
msgstr "Das ist kein korrektes Netz: %s!"
msgid "Sorry, this doesn't look like a %s: '%s'!"
msgstr "Das sieht nicht wie ein %s aus: '%s'"
msgid "Access Rights"
msgstr "Zugriffsrechte"
msgid "This Network '%s' allready exists!"
msgstr "Dieses Netz '%s' existiert schon!"
msgid "Not enough rights to edit this Network '%s'"
msgstr "Nicht genügend Rechte vorhanden, um dieses Netz '%s' zu editieren."
msgid "Not enough rights to add this Network '%s' under '%s'"
msgstr "Nicht genügend Rechte vorhanden, um dieses Netz '%s' unter '%s' zu erstellen"
msgid "Def. Subnet CIDR"
msgstr "Std. Subnetz CIDR"
msgid "Default Subnet CIDR"
msgstr "Standard Subnetz CIDR"
msgid "The minimum %s size is /%i!"
msgstr "Die kleinste %s Größe ist /%s"
msgid "%ss can only be made from allocations with a status of %s"
msgstr "%ss können nur unter Allokationen mit einem Status von %s angelegt werden"
msgid "%ss can only be made when there's no less specific inetnum (%s) with an 'Assigned' status"
msgstr "%ss können nur angelegt werden, wenn kein weniger spezifisches inetnum (%s) mit einem 'Assigned' status vorhanden ist"
msgid "%ss can only be made when there's no more specific inetnum (%s) with an 'Assigned' status"
msgstr "%ss können nur angelegt werden, wenn kein spezifischeres inetnum (%s) mit einem 'Assigned' status vorhanden ist"
msgid "%s is a new Value for inet6num Objects and so it's not available for inetnum Objects"
msgstr "%s ist ein neuer Wert für inet6num Objekte. Somit ist er nicht für inetnum Objekte verfügbar"
msgid "%ss can only be made when there's no less specific inetnum (%s) with a status of '%s'"
msgstr "%ss können nur angelegt werden, wenn kein weniger spezifisches inetnum (%s) mit einem Status von %s vorhanden ist"
msgid "force"
msgstr "forcieren"
#: treeMenu
msgid "Menu"
msgstr "Menü"
msgid "Edit Menu"
msgstr "Bearbeiten"
msgid "Close Tree"
msgstr "Baum schliessen"
msgid "Jump To"
msgstr "Springe zu"
msgid "Edit"
msgstr "Bearbeiten"
msgid "Finish Edit"
msgstr "Bearbeiten beenden"
msgid "Copy"
msgstr "Kopieren"
msgid "Move"
msgstr "Verschieben"
msgid "to"
msgstr "nach"
msgid "Delete after Copy"
msgstr "Löschen nachm Kopieren"
msgid "Expand Network '%s'"
msgstr "Öffne Netzwerk '%s'"
msgid "Reduce Network '%s'"
msgstr "Schließe Netzwerk '%s'"
msgid "Expand Root '%s'"
msgstr "Öffne StartpunktNetzwerk '%s'"
msgid "Reduce Root '%s'"
msgstr "Schließe Startpunkt '%s'"
#: showNet
msgid "Show"
msgstr "Zeigen"
msgid "Show Subnets"
msgstr "Subnetze anzeigen"
msgid "# of free Subnets with CIDR '%s'"
msgstr "# freier Subnetze mit CIDR '%s'"
msgid "Routing Prefix"
msgstr "Routing Prefix"
msgid "Subnet"
msgstr "Subnetz"
msgid "Customer Address Space"
msgstr "Kundenadressbereich"
msgid "compressed"
msgstr "komprimiert"
msgid "Details of Network %s"
msgstr "Details des Netzes %s"
msgid "Functions"
msgstr "Funktionen"
msgid "Reverse DNS lookup"
msgstr "Rückwärtsauflösung"
msgid "Type"
msgstr "Typ"
msgid "Type Infos of Network %s"
msgstr "Typ Informationen des Netzes %s"
msgid "Split"
msgstr "Aufteilen"
msgid "Split Details"
msgstr "Aufteilungs Details"
msgid "Split Network into these pieces:"
msgstr "Netz in folgende Stücke aufteilen:"
msgid "Template for the Descriptions"
msgstr "Vorlage für die Beschreibungen"
msgid "Delete this network"
msgstr "Dieses Netz löschen"
msgid "Settings for the new Networks"
msgstr "Einstellungen für die neuen Netze"
msgid "# of available Adresses"
msgstr "# verfügbarer Adressen"
#: delNet
msgid "Do you really want to delete the Network '%s'?"
msgstr "Wollen sie wirklich das Netz '%s' löschen?"
msgid "With all Subnets"
msgstr "Mit allen Subnetzen"
msgid "This network contains %i subnets"
msgstr "Dieses Netz beinhaltet %i Subnetze"
#: editRoot
msgid "Edit Root %s"
msgstr "Startpunkt %s bearbeiten"
msgid "Root"
msgstr "Startpunkt"
#: delRoot
msgid "Error while deleting '%s': %s"
msgstr "Fehler beim Löschen '%s': %s"
msgid "Successfully deleted '%s' (%i Networks deleted)"
msgstr "Erfolgreich '%s' gelöscht (%i Netze gelöscht)"
msgid "This Root has %i Subnets"
msgstr "Dieser Startpunkt beinhaltet %i Subnetze"
msgid "Do you really want to delete the Root %s?"
msgstr "Wollen Sie wirklich den Startpunkt %s löschen?"
#: showTemplates
msgid "Templates"
msgstr "Vorlagen"
msgid "Nettype"
msgstr "Netz Typ"
msgid "There are still Entries for this Template left. Please delete them first! (%s)"
msgstr "Es sind noch Einträge für diese Vorlage vorhanden. Bitte vorher löschen! (%s)"
#: editTemplate
msgid "Add"
msgstr "Hinzufügen"
msgid "Replace"
msgstr "Ersetzen"
msgid "Template '%s' for '%s'"
msgstr "Vorlage '%s' für '%s'"
msgid "New "
msgstr "Neue "
msgid "Preview"
msgstr "Vorschau"
msgid "Position"
msgstr "Position"
msgid "No Template for this ID '%i' available!"
msgstr "Keine Vorlage für diese ID '%i' gefunden"
msgid "Parameters"
msgstr "Parameter"
msgid "Size"
msgstr "Größe"
msgid "Entries (separated with semicolons)"
msgstr "Einträge (getrennt mit Semikolons)"
msgid "HLine"
msgstr "HLinie"
msgid "Textfield"
msgstr "Textfeld"
msgid "Textarea"
msgstr "Textbereich"
msgid "Popup-Menu"
msgstr "Popup-Menü"
msgid "Text"
msgstr "Text"
msgid "Sorry, you have to give me a Name!"
msgstr "Es muss ein Name angegeben werden!"
msgid "Do you really want to delete the Template %s?"
msgstr "Wollen Sie wirklich die Vorlage %s löschen?"
msgid "Successfully deleted Template '%s'"
msgstr "Erfolgreich Vorlage '%s' gelöscht"
msgid "No Templates deleted. Nothing found!"
msgstr "Keine Vorlagen gelöscht. Nix gefunden!"
msgid "Rows"
msgstr "Reihen"
msgid "Columns"
msgstr "Spalten"
msgid "Created from"
msgstr "Erstellt von"
msgid "Created on"
msgstr "Erstellt am"
msgid "Modified by"
msgstr "Geändert von"
msgid "Modified on"
msgstr "Geändert am"
msgid "Structure"
msgstr "Struktur"
#: ShowGroups
msgid "Groups"
msgstr "Gruppen"
msgid "Group '%s'"
msgstr "Gruppe '%s'"
msgid "Permissions"
msgstr "Rechte"
#: delGroup
msgid "There are still Users in this Group left. Please remove them from this Group first! (%s)"
msgstr "Es sind noch Benutzer in der Gruppe eingetragen. Bitte tragen sie diese erstmal aus der Gruppe aus! (%s)"
msgid "No Group deleted. Nothing found!"
msgstr "Keine Gruppe gelöscht. Nix gefunden!"
msgid "Successfully deleted Group '%s'"
msgstr "Erfolgreich Gruppe '%s' gelöscht"
msgid "Do you really want to delete the Group %s?"
msgstr "Wollen Sie wirklich die Gruppe %s löschen?"
#: editUser
msgid "User '%s'"
msgstr "Benutzer '%s'"
msgid "Group Association"
msgstr "Gruppenzugehörigkeit"
msgid "Password Validation"
msgstr "Passwort Wiederholung"
msgid "No Password given!"
msgstr "Kein Passwort angegeben!"
msgid "Password are not equal"
msgstr "Passwörter sind nicht gleich!"
msgid "Password is only for buildin 'HaCi' authentication!"
msgstr "Das Passwort ist nur für die eingebaute 'HaCi' Authentifizierung!"
msgid "Not Authenticated!!!"
msgstr "Nicht Angemeldet!!!"
#: delUser
msgid "No User deleted. Nothing found!"
msgstr "Kein Benutzer gelöscht. Nix gefunden"
msgid "Successfully deleted User '%s'"
msgstr "User '%s' erfolgreich gelöscht"
msgid "Do you really want to delete the User %s?"
msgstr "Wollen sie wirklich den Benutzer '%s' löschen?"
#: showAuthMeths
msgid "Authentication Management"
msgstr "Authentifizierungsverwaltung"
msgid "Authentication Methods"
msgstr "Authentifizierungs Methoden"
#: combineNets
msgid "Combine Networks"
msgstr "Netze Zusammenfassen"
msgid "%i. Possibility"
msgstr "%i. Möglichkeit"
msgid "Combine these networks"
msgstr "Diese Netze zusammenfassen"
msgid "Settings for the new Network"
msgstr "Einstellungen für das neue Netz"
msgid "Netaddress doesn't match!"
msgstr "Netzadresse passt nicht!"
msgid "Foreign Networks will be included (e.g. '%s')"
msgstr "Fremde Netze werden mit eingeschlossen (z.B. '%s')"
msgid "This Network allready exists!"
msgstr "Dieses Netz existiert schon!"
#: pluginMgmt
msgid "Plugin Management"
msgstr "Pluginverwaltung"
msgid "Configure Plugin '%s'"
msgstr "Konfiguriere Plugin '%s'"
#: plugins
msgid "Global Configuration of '%s'"
msgstr "Globale Konfiguration von '%s'"
msgid "Configuration of '%s' for '%s'"
msgstr "Konfiguration von '%s' für '%s'"
msgid "Status of Host"
msgstr "Status des Hosts"
msgid "Alive"
msgstr "Lebendig"
msgid "alive"
msgstr "lebendig"
msgid "Dead"
msgstr "Tot"
msgid "Ping Info for %s"
msgstr "Ping Info für %s"
msgid "active"
msgstr "aktiv"
msgid "default"
msgstr "standard"
msgid "Default"
msgstr "Standard"
msgid "on Demand"
msgstr "auf Abruf"
msgid "recurrent"
msgstr "regelmäßig"
msgid "last Run"
msgstr "letzter Aufruf"
msgid "Configure"
msgstr "Konfigurieren"
msgid "Reset last run"
msgstr "Letzen Aufruf resetten"
#plugins
msgid "DNS PTR-Record for current IP address"
msgstr "DNS PTR-Record für die jeweilige IP Adresse"
msgid "Ping Status of current IP address (dead|alive)"
msgstr "Ping Status der jeweiligen IP Adresse (dead|alive)"
msgid "Mac Address related to the IP address"
msgstr "Mac Adresse der IP Adresse"
msgid "Infos for Plugin '%s'"
msgstr "Informationen für Plugin '%s'"
msgid "This Plugin will ping associated IP adresses and saves its status in DB. After that, it will collect the corresponding MAC addresses with SNMP from a specific router and save the result in DB, too. In the Output there were all IP addresses listed with their status and MAC address if available. With this method you catch all available Hosts, even if they deny ping."
msgstr "Dieses Plugin pingt alle ihm zugeordneten IP Adressen und speichert deren Status in der DB. Danach sammelt es die passenden MAC Adressen mittels SNMP von einem bestimmten Router und speichert die Ergebnisse ebenfalls in der DB. In der Ausgabe werden alle IP Adressen mit ihrem Status und, wenn vorhanden, ihrer MAC Adresse dargestellt. Mit dieser Methode können alle verfügbaren Geräte erkannt werden, auch wenn sie eigentlich Ping verbieten."
msgid "This Plugin runs recurrent in background and collects DNS PTR-Records for its associated IP Addresses an saves them in DB. In the Output will all IP Adresses be listet with their corresponding PTR-Records."
msgstr "Dieses Plugin läuft regelmäßig im Hintergrund und sammelt DNS PTR-Records für alle ihm zugeordneten IP Adressen und speichert diese in der DB. In der Ausgabe werden alle IP Adressen mit deren zugehörigen PTR-Records aufgelistet."
msgid "This Plugin queries on demand the DNS PTR-Record for the current IP adress and displays it."
msgstr "Dieses Plugin fragt auf Abruf den DNS PTR-Record für die jeweilige IP Adresse ab und zeigt ihn an."
msgid "This Plugins pings the current IP adress on Demand and displays its status."
msgstr "Dieses Plugin pingt die jeweilige IP Adresse auf Abruf und zeigt deren Status an."
msgid "This Plugin runns recurrent in background and pings all associated IP addresses. In the Output it will display all IP addresses with their Status."
msgstr "Dieses Plugin läuft regelmäßig im Hintergrund und pingt alle ihm zugeordneten IP Adressen. In der Ausgabe werden alle IP Adressen mit ihrem Status angezeigt."
msgid "This Plugin queries on Demand the Whois DB for the current network and displays the Result."
msgstr "Dieses Plugin fragt auf Abruf die Whois DB für das jeweilige Netzwerk ab und zeigt das Ergebnis an."
msgid "IP addresses"
msgstr "IP Adressen"
msgid "MACs found"
msgstr "MACs gefunden"
msgid "ARP Entry"
msgstr "ARP Eintrag"
msgid "Nr of Bytes (0-1024)"
msgstr "Byteanzahl (0-1024)"
msgid "Timeout"
msgstr "Zeitüberschreitung"
msgid "Protocoll"
msgstr "Protokoll"
msgid "Router for SNMP-Connection"
msgstr "Router für die SNMP Verbindung"
msgid "With Subnetworks"
msgstr "Inklusive Subnetze"
msgid "Only IP addresses"
msgstr "Nur IP Adressen"
msgid "Max Depth"
msgstr "Maximale Tiefe"
msgid "Runtime"
msgstr "Laufzeit"
msgid "sec"
msgstr "sek"
msgid "Close Error Details"
msgstr "Schließe Fehler Details"
msgid "Error Details for Plugin %s"
msgstr "Fehler Details für Plugin %s"
msgid "Error Details"
msgstr "Fehler Details"
msgid "Error"
msgstr "Fehler"
msgid "IP address"
msgstr "IP Adresse"
msgid "Error while loading Plugin '%s'. Details in Error Logfile."
msgstr "Fehler beim Laden des Plugins '%s'. Details stehen im Fehler Log."
msgid "This doesn't look like a network '%s'."
msgstr "Das sieht nicht wie ein Netz aus '%s'."
msgid "Program Whois '%s' isn't executable"
msgstr "Das Whois Programm '%s' ist nicht ausführbar"
msgid "This doesn't look like an IP address '%s'."
msgstr "Das sieht nicht wie eine IP Adresse aus '%s'."
msgid "Defaults for mode 'recurrent'"
msgstr "Standards für den Modus 'regelmäßig'"
msgid "Defaults for mode 'on Demand'"
msgstr "Standards für den Modus 'auf Abruf'"
msgid "The HaCi Daemon is not started."
msgstr "Der HaCi Daemon ist nicht gestartet."
#: showSubnets
msgid "Show free Subnets of '%s' with CIDR '%s'"
msgstr "Zeige freie Subnetze von '%s' mit CIDR '%s'"
msgid "CIDR (Subnet Size)"
msgstr "CIDR (Subnetz Größe)"
msgid "Free Subnets"
msgstr "Freie Subnetze"
msgid "No free Subnets with this CIDR available"
msgstr "Keine freien Subnetze mit dieser CIDR verfügbar"
msgid "Create"
msgstr "Erstellen"
msgid "No."
msgstr "Nr."
#: showSettings
msgid "Settings"
msgstr "Einstellungen"
msgid "Change own Password"
msgstr "Eigenes Passwort ändern"
msgid "Old Password"
msgstr "Altes Passwort"
msgid "New Password"
msgstr "Neues Passwort"
msgid "Old Password is not correct!"
msgstr "Altes Passwort ist nicht richtig!"
msgid "Sorry, Username not found!"
msgstr "Benutzername nicht gefunden!"
msgid "Successfully changed Password"
msgstr "Passwort erfolgreich geändert"
msgid "Cannot change Password: %s"
msgstr "Konnte Passwort nicht ändern : %s"
msgid "View"
msgstr "Ansicht"
msgid "View Settings"
msgstr "Ansichtseinstellungen"
msgid "Show Tree Structure"
msgstr "Baumstruktur anzeigen"
msgid "Errors while updating Setting for '%s': %s"
msgstr "Wärend die Einstellungen für '%s' aktualisiert wurden, sind Fehler aufgetreten: %s"
HaCi/locale/de/LC_MESSAGES/HaCi.mo 0000644 0001750 0001750 00000053372 11341116466 016316 0 ustar fighter fighter Þ• . Œ ™ ü ` x Q ™ 2 ë T . 9 ƒ U ½ Y Y m Ç Ñ
Û æ
ì
÷ + 4 : I c z &