ServDoc_0210netlowlevel

Code Index:



NAME

ServDoc_0210netlowlevel - describe the network


VERSION

$Id: ServDoc_0210netlowlevel,v 1.8 2004/02/19 07:17:05 uherbst Exp $


SYNOPSIS

ServDoc_0210netlowlevel [-h|help] [-v|version] [--debug NETLL,intensity]


DESCRIPTION

ServDoc_0210netlowlevel tries to describe ALL important things about your network

Supported Systems

This module should work on

AIX
HP/UX
Solaris
Linux (RedHat and SuSE)

Things to describe - network low level configuration

Low Level network servers and services

xinetd (if running)
telnet,ftp (if running)
ssh (if running)
DNS Server (if running)
only bind is supported

DHCP Server (if running)
Printservices (if running)


OPTIONS

-h|help
This help.

-v|version
Version

--debug NETLL,intensity
Turn on Debugging for that module.

The debug feature for that module is named ``NETLL''.


AUTHORS

Ulrich Herbst <Ulrich.Herbst@gmx.de>


#!/usr/bin/perl -w

#----------------------------------------------------------------------

# standard perl modules
use strict;                       # print error about unknown variables ...
use English;                      # long internal variable names;
use FindBin;                      # In which directory is ServDoc itself ?
                                  # There has to be the module and the lib dir!
use lib $FindBin::Bin. "/lib";    # Here are the ServDoc-perl-modules
use File::Basename;               # basename and similar
use vars qw($options);

# our own perl modules
use ServDoc;

#----------------------------------------------------------------------

$options->{Version} =
  '$Id: ServDoc_0210netlowlevel,v 1.8 2004/02/19 07:17:05 uherbst Exp $';

# We need the cmdline to call the modules with the same debug options.
$options->{cmdline} = join " ", @ARGV;

sub debug { ServDoc_debug( "NETLL", $options, shift, shift ); }

$options = &process_cmdline($options);

my $h = "Net%%+Low Level Services%%+";
%{$options->{lang}->{en}}=
  (
   noinetd       => $h . "(x)inetd",
   noinetd_short => '',
   noinetd_long  => '',
   noinetdrun    => "I think you haven't (x)inetd running.",

   xinetd        => $h . 'xinetd Configuration',
   xinetd_short  => i18n_std('filecontent','/etc/xinetd.conf'),
   xinetd_long   => '',

   xinetdd       => $h . 'xinetd Config%%+Service ',
   xinetdd_long  => '',

   inetd         => $h . 'inetd Configuration',
   inetd_short   => i18n_std('filecontent','/etc/inetd.conf'),
   inetd_long    => '',

   services      => $h . 'Well-Known Services',
   services_short=> i18n_std('filecontent','/etc/services'),
   services_long => "Services here listed are wellknown and have therefor a "
   . "name and a portnumber. That doesn't mean, they are "
   . "installed or running on your system!",
);

$h = "Netzwerk%%+Standarddienste%%+";
%{$options->{lang}->{de}}=
  (
   noinetd       => $h . "(x)inetd",
   noinetd_short => '',
   noinetd_long  => '',
   noinetdrun    => "Ich vermute, hier läuft kein (x)inetd.",

   xinetd        => $h . 'xinetd Konfiguration',
   xinetd_short  => i18n_std('filecontent','/etc/xinetd.conf'),
   xinetd_long   => '',

   xinetdd       => $h . 'xinetd Konfiguration%%+Service ',
   xinetdd_long  => '',

   inetd         => $h . 'inetd Konfiguration',
   inetd_short   => i18n_std('filecontent','/etc/inetd.conf'),
   inetd_long    => '',

   services      => $h . 'Dienste und Portnummern',
   services_short=> i18n_std('filecontent','/etc/services'),
   services_long => "Hier sind Dienste und ihre Standard-Portnummern ".
   "aufgelistet. Das heisst nicht, dass dieser Dienst hier auch l&auml;uft."
);
debug(9,i18n_std('running',$0));

#----------------------------------------------------------------------

# Main

# If we are not on HP/UX,Solaris, AIX, Linux, return silently.
if ( ! is_unix() ) {
  debug( 1, i18n_std('unsupported','Network Low Level Services'));
  exit 0;
}

# (X)inetd shouldn't be OS specific.
my @inetd = ps_grep ( "x{0,1}inetd\\b" );
if ( ! @inetd ) {
  report_i18n('string','noinetd',i18n_mesg('noinetdrun'));
} else {
  if ( $inetd[0] =~ /xinetd/ ) {
    # xinetd has a little more complex configuration structure than
    # inetd
    report_i18n('file','xinetd','/etc/xinetd.conf');
    foreach (listdir("/etc/xinetd.d")) {
      report_file (i18n_mesg('xinetdd',basename($_)),
                   i18n_std('filecontent',$_),
                   i18n_mesg('xinetdd_long'),
                   $_);
    }
  } else { # xinetd
    # Here we have inetd
    report_i18n('file','inetd','/etc/inetd.conf');
    }
} # inetd
report_i18n('file','services','/etc/services');