Changeset 301


Ignore:
Timestamp:
Oct 4, 2017, 8:47:26 PM (7 years ago)
Author:
g7moreau
Message:
  • Add option --no-rebuildsw to updatedb database to force no switch map build
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/klask

    r300 r301  
    77use strict;
    88use warnings;
    9 use version; our $VERSION = qv('0.6.7');
     9use version; our $VERSION = qv('0.7.0');
    1010
    1111use Readonly;
     
    11181118 klask help
    11191119
    1120  klask updatedb [--verbose|-v] [--verb-description|-d] [--chk-hostname|-h] [--chk-location|-l]
     1120 klask updatedb [--verbose|-v] [--verb-description|-d] [--chk-hostname|-h] [--chk-location|-l] [--no-rebuildsw|-R]
    11211121 klask exportdb [--format|-f txt|html]
    11221122 klask removedb IP* computer*
     
    12731273   @ARGV = @_;
    12741274
    1275    my ($verbose, $verb_description, $check_hostname, $check_location);
     1275   my ($verbose, $verb_description, $check_hostname, $check_location, $no_rebuildsw);
    12761276
    12771277   GetOptions(
     
    12801280      'chk-hostname|h'     => \$check_hostname,
    12811281      'chk-location|l'     => \$check_location,
     1282      'no-rebuildsw|-R'    => \$no_rebuildsw,
    12821283      );
    12831284
     
    13071308   my $switch_connection = YAML::Syck::LoadFile("$KLASK_SW_FILE");
    13081309   if ($switch_checksum ne $switch_connection->{'checksum'}) { # Verify checksum
    1309       print "WARNING: switch database is going to be rebuilt\n";
    1310       update_switchdb(verbose => $verbose);
     1310      if ($no_rebuildsw) {
     1311         print "WARNING: switch database is outdate, please rebuild if with updatesw command\n";
     1312      else {
     1313         print "WARNING: switch database is going to be rebuilt\n";
     1314         update_switchdb(verbose => $verbose)
     1315         }
    13111316      }
    13121317
     
    30063011 klask help
    30073012
    3008  klask updatedb [--verbose|-v] [--verb-description|-d] [--chk-hostname|-h] [--chk-location|-l]
     3013 klask updatedb [--verbose|-v] [--verb-description|-d] [--chk-hostname|-h] [--chk-location|-l] [--no-rebuildsw|-R]
    30093014 klask exportdb [--format|-f txt|html]
    30103015 klask removedb IP* computer*
     
    31193124=head2 updatedb
    31203125
    3121  klask updatedb [--verbose|-v] [--verb-description|-d] [--chk-hostname|-h] [--chk-location|-l]
     3126 klask updatedb [--verbose|-v] [--verb-description|-d] [--chk-hostname|-h] [--chk-location|-l] [--no-rebuildsw|-R]
    31223127
    31233128This command will scan networks and update the computer database.
     
    31393144The idea of the C<active> scan mode is to force computer to regulary send packet over the network.
    31403145
     3146At the beginning, the command verify that the switch map checksum is always valid.
     3147Otherwise, a rebuild procedure will ne done automatically.
     3148
    31413149=head2 exportdb
    31423150
     
    31783186The list of the switches must be given in the file F</etc/klask/klask.conf> (see L</CONFIGURATION>).
    31793187
     3188The database has a checksum which depend of all the active switches.
     3189It's use when rebuilding the database in case of change in switch configuration (one more for example).
    31803190
    31813191=head2 exportsw
Note: See TracChangeset for help on using the changeset viewer.